【发布时间】:2016-08-10 13:14:23
【问题描述】:
请注意,我对 C# 和测试还很陌生。
我的测试没有显示在测试资源管理器中。我正在使用 Visual Studio 2015 更新 3 以及使用新的 asp.net 核心项目结构。
我的 project.json 文件如下所示:
{
"version": "1.0.0-*",
"description": "Tests for the earthworm",
"dependencies": {
"earthworm": "1.0.0-*",
"NSubstitute": "2.0.0-rc",
"NUnit.Runners": "3.4.1",
"NUnit3TestAdapter": "3.4.1",
"NUnitLite": "3.4.1",
"NUnit.Console": "3.4.1",
"Microsoft.Dnx.TestHost": "1.0.0-rc1-final",
"Microsoft.Dnx.Runtime": "1.0.0-rc1-final"
},
"testRunner": "nunit",
"commands": {
"Test": "earthworm.test"
},
"frameworks": {
"dnx451": {}
}
}
当我单击测试资源管理器中的全部运行按钮时,应该会找到我的所有测试,我得到以下输出:
Discovering tests in 'C:\Users\daniel\Repos\earthworm\test\earthworm.test\project.json'
然后测试资源管理器中没有显示任何内容。 我试过查看Testing .NET Core using NUnit 3,所以看起来如果您使用的是最新的框架,它是可能的。我只想知道 dnx451 是如何做到这一点的。
【问题讨论】: