Ame*_*sed 19 c# nunit visual-studio visual-studio-2017
我使用的是最新的VS2017版本15.6.4,NUnit3TestAdapter 3.10.0和Nunit版本3.9.0.0.
当我尝试在测试资源管理器中运行单元测试时,测试显示为灰色,当我右键单击并运行选定的测试时,我看到以下错误:没有测试可用 这里是我的测试类看起来如何
[TestFixture]
public partial class ListViewBOTest
{
[Test]
public void TestSearch_DateTime()
{
Assert.AreEqual(1,0);
}
}
Run Code Online (Sandbox Code Playgroud)
输出中的文字:
[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) ==========
Run Code Online (Sandbox Code Playgroud)
Pet*_*ris 31
确保您已从此处安装了NUnit3测试适配器
https://marketplace.visualstudio.com/items?itemName=NUnitDevelopers.NUnit3TestAdapter
hem*_*hem 15
你能检查下面的步骤,看看它是否有效?
Test > Test Settings > Default Processor Architecture
并记下是否X86
已选中或X64
Build
部分Properties
.确保选择Platform target
下拉列表Any CPU
或者至少它与上面的架构相匹配step 1
.现在,如果您构建解决方案并尝试运行这些测试,您应该会看到它们现在正在运行.
归档时间: |
|
查看次数: |
10904 次 |
最近记录: |