我使用的是最新的VS2017版本15.6.4、NUnit3TestAdapter 3.10.0和Nunit版本3.9.0.0。
当我尝试在测试资源管理器中运行单元测试时,测试将呈灰色显示,当我右键单击并运行选定的测试时,我看到以下错误:No test is available Here是我的测试类的外观
[TestFixture]
public partial class ListViewBOTest
{
[Test]
public void TestSearch_DateTime()
{
Assert.AreEqual(1,0);
}
}
来自输出的文本:
[3/26/2018 10:53:55 AM Informational] ------ Run test started ------
[3/26/2018 10:53:55 AM Informational] NUnit Adapter 3.10.0.21: Test execution started
[3/26/2018 10:53:55 AM Informational] Running all tests in C:\Projects\MVPPlant\DEV\CMMSdg.Plant\CMMSdg.Plant\Sln.2010\CMMSdg.Plant.BusinessObjects.Test\bin\Debug\CMMSdg.Plant.BusinessObjects.Test.dll
[3/26/2018 10:53:56 AM Informational] NUnit failed to load C:\Projects\MVPPlant\DEV\CMMSdg.Plant\CMMSdg.Plant\Sln.2010\CMMSdg.Plant.BusinessObjects.Test\bin\Debug\CMMSdg.Plant.BusinessObjects.Test.dll
[3/26/2018 10:53:56 AM Informational] NUnit Adapter 3.10.0.21: Test execution complete
[3/26/2018 10:53:56 AM Warning] No test is available in C:\Projects\MVPPlant\DEV\CMMSdg.Plant\CMMSdg.Plant\Sln.2010\CMMSdg.Plant.BusinessObjects.Test\bin\Debug\CMMSdg.Plant.BusinessObjects.Test.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
[3/26/2018 10:53:56 AM Informational] ========== Run test finished: 0 run (0:00:01.0435303) ==========
发布于 2018-05-16 16:36:18
我遇到了和Amete Blessed相同的问题,并且注释掉了其他的Test方法,使Test Explorer工作并运行我的测试
发布于 2018-05-29 22:05:02
发布于 2018-03-27 01:37:28
你能检查下面的步骤,看看它是否工作吗?
X86
,则转到Test > Test Settings > Default Processor Architecture
并记下,或者转到项目的Build
窗口中的Properties
部分,测试就是在这里编写的。确保将Platform target
下拉菜单选择为Any CPU
或至少与上述step 1
.中的体系结构相匹配
现在,如果您构建解决方案并尝试运行这些测试,您应该会看到它们现在正在运行。
https://stackoverflow.com/questions/49495900
复制相似问题