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

后端 未结 3 1667
一生所求
一生所求 2020-12-23 19:23

I recently updated to Resharper 8, and when I tried to run a suite of projects. These tests contain two suites of integration tests that both use IISExpress to run a website

3条回答
  •  没有蜡笔的小新
    2020-12-23 20:14

    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.

提交回复
热议问题