gpt4 book ai didi

visual-studio - 无法在 Visual Studio 2017 上运行 Xunit 测试

转载 作者:行者123 更新时间:2023-11-28 19:41:44 25 4
gpt4 key购买 nike

无法在我的 Visual Studio 2017 上运行所有 XUnit 测试。版本 15.6.4

它们可以在 TestExploer 中查看,当我从那里运行它们时,我得到如下信息:

[27.03.2018 12:21:46 Informational] ------ Load Playlist started ------
[27.03.2018 12:21:46 Informational] ========== Load Playlist finished
(0:00:00,0215566) ==========
[27.03.2018 12:22:27 Informational] Executing test method 'Lebara.Remittance.Test.ServiceImplementation.RiskEngineServiceTest.ShouldTest'
[27.03.2018 12:22:27 Informational] ------ Run test started ------
[27.03.2018 12:22:29 Warning] Multiple test adapters with the same uri
'executor://xunit/VsTestRunner2' were found. Ignoring adapter
'Xunit.Runner.VisualStudio.TestAdapter.VsTestRunner'. Please uninstall the
conflicting adapter(s) to avoid this warning.
[27.03.2018 12:22:29 Warning] [xUnit.net 00:00:00.0209459] Skipping:
Lebara.Remittance.Test (could not find dependent assembly
'Microsoft.Extensions.DependencyModel, Version=1.1.0')
[27.03.2018 12:22:29 Warning] No test is available in C:\ReposNew\Lebara.Remittance\Lebara.Remittance\Lebara.Remittance.Test\bin\Debug\Lebara.Remittance.Test.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
[27.03.2018 12:22:29 Informational] ========== Run test finished: 0 run
(0:00:02,1543479) ==========
[27.03.2018 12:34:19 Informational] Executing test method 'Lebara.Remittance.Test.ServiceImplementation.RiskEngineServiceTest.ShouldTest'
[27.03.2018 12:34:19 Informational] ------ Run test started ------
[27.03.2018 12:34:20 Warning] Multiple test adapters with the same uri
'executor://xunit/VsTestRunner2' were found. Ignoring adapter
'Xunit.Runner.VisualStudio.TestAdapter.VsTestRunner'. Please uninstall the
conflicting adapter(s) to avoid this warning.
[27.03.2018 12:34:20 Warning] [xUnit.net 00:00:00.0200861] Skipping:
Lebara.Remittance.Test (could not find dependent assembly
'Microsoft.Extensions.DependencyModel, Version=1.1.0')
[27.03.2018 12:34:20 Warning] No test is available in C:\ReposNew\Lebara.Remittance\Lebara.Remittance\Lebara.Remittance.Test\bin\Debug\Lebara.Remittance.Test.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
[27.03.2018 12:34:20 Informational] ========== Run test finished: 0 run
(0:00:00,7088116) ==========

我尝试删除 %TEMP%\VisualStudioTestExplorerExtensions - 没有任何帮助。

问题是,几天前我就可以运行它们了。我没有改变任何事情。只是不知道发生了什么。

我也有这个警告

 [27.03.2018 12:22:29 Warning] Multiple test adapters with the same uri 
'executor://xunit/VsTestRunner2' were found. Ignoring adapter
'Xunit.Runner.VisualStudio.TestAdapter.VsTestRunner'. Please uninstall the
conflicting adapter(s) to avoid this warning.
[27.03.2018 12:22:29 Warning] [xUnit.net 00:00:00.0209459] Skipping:
Lebara.Remittance.Test (could not find dependent assembly
'Microsoft.Extensions.DependencyModel, Version=1.1.0')

最佳答案

我在使用 xUnit 时遇到了问题。一些重要的事情:

1) 确保“Microsoft Visual Studio 测试平台”扩展已启用

2) 确保“测试 => 测试设置 => 默认处理器架构”与您的构建匹配。

3) 安装 nuget 包 'xunit.runner.visualstudio'

关于visual-studio - 无法在 Visual Studio 2017 上运行 Xunit 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49509715/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com