简体   繁体   中英

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. The Controllers Class is Public. 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 .

Either update the name of class or remove .Controllers from the namespace OrderManagementSystem.Controllers

In Controllers.cs file,

using Systems;
....

//Remove .Controllers from namespace
namespace OrderManagementSystems
{
    public class Controllers
    {
          //Your code
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM