gpt4 book ai didi

visual-studio - 由于 FileNotFoundException、异常转换测试,NUnit VS Adapter 无法发现测试

转载 作者:行者123 更新时间:2023-12-03 23:55:36 24 4
gpt4 key购买 nike

尝试通过 Visual Studio 测试资源管理器运行测试时,解决方案中的所有测试(使用 Typemock 的测试和不使用 Typemock 的测试)都出现以下错误:

[2/12/2018 11:35:36 AM Informational] NUnit VS Adapter 2.1.1.0 discovering tests is started [2/12/2018 11:35:37 AM Error] Exception System.IO.FileNotFoundException, Exception converting Manager.Tests.MessageLoggerTest.AddMessage_WhenAddMessageIsCalled_ThenAddMessagesToList ...



我在 Xamarin 论坛上只发现了一个在线问题,但没有修复( https://forums.xamarin.com/discussion/119513/xamarin-ui-tests-filenotfoundexception )。

我用 Visual Studio Enterprise 2017, version 15.5.6 , NUnit 2.6.4 , NUnitTestAdapter 2.1.1Typemock 8.6.0.22 .

通过 Typemock runner (Test Navigator) 运行测试按预期工作。

编辑

我觉得有点尴尬,我无法重现我原来的错误。在工作中,我们使用代码库的多个分支。现在,一个分支工作正常。我可以通过 VS runner (Test Explorer) 发现和运行测试。

在另一个分支上,当重建 1. 测试项目时,我得到 StackOverflowException而不是 FileNotFoundException .但它也发现了项目中的 43 个测试中的 41 个。 2.测试项目也得到 StackOverflowException并没有发现 295 个测试。

[2/20/2018 10:43:40 AM Informational] ------ Discover test started ------ [2/20/2018 10:43:44 AM Informational] NUnit VS Adapter 2.1.1.0 discovering tests is started [2/20/2018 10:43:54 AM Error] The active test discovery was aborted. Reason: Process is terminated due to StackOverflowException.

[2/20/2018 10:43:54 AM Informational] ========== Discover test finished: 41 found (0:00:13.8969695) ==========



比较过 solution文件, project文件和 NuGet包配置。分支之间的唯一区别是 packages.config线:
<package id="Typemock.Isolator" version="8.6.0.18" targetFramework="net452" />
工作分支有 targetFramework="net452" ,失败的分支有 targetFramework="net462" .但是将框架更改为 net452没有帮助。

将不得不深入挖掘,看看有什么不同。感谢任何人的帮助和时间。

最佳答案

尝试从库中安装适用于 Visual Studio 的 NUnit 2 测试适配器扩展。这为我解决了同样使用 NUnit 2.6.4 的项目的问题。

关于visual-studio - 由于 FileNotFoundException、异常转换测试,NUnit VS Adapter 无法发现测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48744718/

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