我正在开发一个针对dnx451的ASP.NET 5应用程序。
与“普通”类库项目不同,测试类在构建后不会被VS2015测试资源管理器发现。
我在安装了NUnit测试适配器VS扩展(2.0.0.0)的情况下尝试了这两种方法,并将NUnitTestAdapter NuGet包添加到测试项目中。
我是不是遗漏了什么,或者这是DNX执行模型的一个普遍问题?
发布于 2015-10-06 19:42:40
您的project.json文件中是否有用于nunit的等效命令?
"commands": {
"test": "xunit.runner.dnx"
},您是否重新构建了您的解决方案?
发布于 2016-04-13 03:44:44
我们使用在ASP.NET核心应用程序中运行测试。我的主要问题实际上是找到这个包的文档,可以在上找到。
Main方法可能如下所示:使用NUnitLite;public class Program { public int Main(string[] args) { return new AutoRun().Execute(args);}}
project.json文件中,命令Test将运行除使用[Category("SlowTest")]注释的测试之外的所有测试。{ "version":"1.0.0-*","description":“SelfServicePortal测试”,“依赖项”:{ " SelfServicePortal“:"1.0.0-*","NSubstitute":"1.9.2","NUnit.Runners":"3.0.1","NUnitLite":"3.0.1","NUnit.Console":"3.0.1","Microsoft.Dnx.Runtime":"1.0.0-rc1-final“},"commands":{ "Test":"SelfServicePortal.Tests -where \"cat != SlowTest\"”},"frameworks":{ "dnx451":{ }
希望这能有所帮助。以下是一些不必要的审查的测试运行:

https://stackoverflow.com/questions/32901141
复制相似问题