Running NUnit through Resharper 8 tests fail when crossing between projects due to AppDomain

回眸只為那壹抹淺笑 提交于 2019-11-29 21:15:35
Daniel Dyson

The Workaround:

Have you tried in Visual Studio going to ReSharper -> Options -> Tools -> Unit Testing

Change the setting "Run up to 1 assemblies in parallel" to a higher number. I tried one for each test project. Max is number of cores, I think.

Counterintuitive I know, but it worked for me and I am using AppDomain.CurrentDomain.BaseDirectory in the failing tests

The Cause A caching optimization bug in ReSharper 8. Working Directory is not set properly. Perhaps running in parallel creates a separate process for each test, so they don't trip over each other's settings.

The Fix JetBrains claim that this will be fixed in version 8.0.1

Update: There is a new unit testing option added in Resharper 8.1 to accomodate this scenario. Find it at ReSharper -> Options -> Tools -> Unit Testing -> "Use Separate AppDomain for each assembly with tests.

We see the same issue. I think it's a bug. See: http://youtrack.jetbrains.com/issue/RSRP-380761

This has now been fixed in Resharper 8.0.2: http://youtrack.jetbrains.com/issue/RSRP-374143#comment=27-572929

Do not forget to tick new option ReSharper | Options | Tools | Unit Testing | "Use separate AppDomain for each assembly with test" to get it works.

i.e. There is now a new option in the Unit Testing settings.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!