[英]Nunit Test. Visual Studio. Namespace , class issue
.I m very new to programming, and I think I'm loosing my mind trying to understand what's the problem here. .我对编程很陌生,我想我正在失去理智,试图理解这里的问题。 Does Anyone have any suggestions?
有没有人有什么建议?
The Test Project has Reference set to OrderManagementSystem.Domain and OrderManagementSystem.Controllers.测试项目的 Reference 设置为 OrderManagementSystem.Domain 和 OrderManagementSystem.Controllers。 The Controllers Class is Public.
控制器 Class 是公共的。 Im able to access Classes from Domain Namespace, but not Controllers??
我能够从域名空间访问类,但不能访问控制器? What did i do wrong?
我做错了什么?
This error is because your class name is Controllers
and namespace also contains .Controllers
.此错误是因为您的 class 名称是
Controllers
并且命名空间也包含.Controllers
。
Either update the name of class or remove .Controllers
from the namespace OrderManagementSystem.Controllers
更新 class 的名称或从命名空间
OrderManagementSystem.Controllers
中删除.Controllers
In Controllers.cs file,在 Controllers.cs 文件中,
using Systems;
....
//Remove .Controllers from namespace
namespace OrderManagementSystems
{
public class Controllers
{
//Your code
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.