运行一个测试类遇到一下问题:
namespace TestSample.Sample
{
[TestClass]
class CynthiaTest
{
[TestMethod]
public void UITestSample()
{
DemoAPIs.SendWinKey();
DemoAPIs demo = new DemoAPIs();
demo.LaunchMiCity();
}
}
}
编译运行会遇到如下error:
Result Message: UTA004: Illegal use of attribute on TestSample.Sample.CynthiaTest.UITestSample. The TestMethodAttribute can be defined only inside a class marked with the TestClass attribute.
解决方法:在Class前面加上public
因为:test class必须都是public的因为最终调用这个测试类的之外的一些