使用版本3.11加载NUnit失败

问题描述 投票:0回答:1

当我降低到3.10它工作,我不知道为什么它停止了最新。我尝试的一切都不起作用。

这是输出中显示的内容。我尝试了许多在线发现的选项,但似乎没有任何帮助:

[13/03/2019 17:10:44 Informational] ------ Run test started ------
[13/03/2019 17:10:45 Informational] NUnit Adapter 3.13.0.0: Test execution started
[13/03/2019 17:10:45 Informational] Running all tests in E:\xxx\xxx\xxx.Tests\bin\Debug\xxx.Tests.dll
[13/03/2019 17:10:45 Informational]    NUnit failed to load E:\xxx\xxx\xxx.xxx\bin\Debug\xxx.Tests.dll
[13/03/2019 17:10:45 Informational] NUnit Adapter 3.13.0.0: Test execution complete
[13/03/2019 17:10:45 Warning] No test matches the given testcase filter `FullyQualifiedName=xxx.xxx.xxxTestss.xxxxnameshouldbesomething` in E:\xxx\xxx\xxx.Tests\bin\Debug\xxx.Tests.dll
[13/03/2019 17:10:45 Informational] ========== Run test finished: 0 run (0:00:01.6716706) ==========

我在这里创建了一个基本测试来确认:

Imports NUnit.Framework
Imports Should

<TestFixture()>
Public Class UnitTest1

    <Test()> Public Sub TestMethod1()
        Dim b As Boolean = False
        b.ShouldBeFalse
    End Sub

End Class

我尝试删除TestFixture,将其重命名为TestClass(但我需要使用NUnit!)

如此奇怪......我在解决方案中有一个项目确实有效并没有帮助,我找不到任何区别。

我甚至尝试创建一个新的空项目......但这甚至不适用于任何版本的NUnit(但我想我会将其作为一个单独的问题提出)。

visual-studio unit-testing nuget nunit nunit-3.0
1个回答
1
投票

出于某种原因发现的问题,Microsoft.VisualStudio.QualityTools.UnitTestFramework标志“Copy Local”对我的项目设置为false。

当我将其更改为true时,我的测试现在正在被选中并运行:)

版本3.10似乎不需要这个,这就是为什么在降低版本时,它又开始工作了。

(我不认为设置此标志会影响本地运行)

© www.soinside.com 2019 - 2024. All rights reserved.