Resharper 9 Ultimate:文件中未找到任何测试

时间:2016-02-02 20:08:50

标签: unit-testing resharper

如何让我的新单元测试出现在Resharper Unit Test Explorer中? 我已经尝试了清除Resharper Cache,以管理员身份重启VS2013并重建解决方案。仍然没有运气 - Resharper无法看到我的单元测试。

我用VS2013运行Resharper Ultimate 9.2。

这是我的单元测试类的示例:

[TestClass]
public abstract class MyUnitTestBase<ITestComponent>: where 
ITestComponent:TestComponent, new() 
{
    [TestMethod]
    public void MyAssertion()
    {           
    }
}

1 个答案:

答案 0 :(得分:0)

最后我弄清楚了:因为我的测试类是chdir("/var/www/my_system"); $myfile = fopen("cron.txt", "w") or die("Unable to open file!"); $txt = "John Doe\n"; fwrite($myfile, $txt); $txt = "Jane Doe\n"; fwrite($myfile, $txt); fclose($myfile);

abstract

当然,抽象类不具备实例,因此Resharper无法检测到它。一旦我为它创建了一个子类,单元测试现在显示:

[TestClass]
public abstract class MyUnitTestBase<ITestComponent>: where 
ITestComponent:TestComponent, new() 
{
    [TestMethod]
    public void MyAssertion()
    {           
    }
}
相关问题