Is it possible to let Resharper (or NUnit?) know that I want each test to look for an
App.config under it's own project, even when running all tests in a solution together?
I'm using NUnit and the test-runner that ships with Resharper, and I've got several test-projects in the same solution. Some of my tests depend on config-files located under their respective projects.
When I run a test-project by itself, it will use it's internal
App.config, and everything works fine. When I try to run all the tests in the solution, or use the shortcut to
run all tests in current test session however, no config-file will be selected, and any test depending on a config will fail by default.
For this reason, I typically end up running all tests in the solution once first, then right clicking the nodes in the test-runner for each of the config-dependent projects, and running them separately afterwards.Answer1:
Apparently assemblies containing NUnit-tests <a href="http://www.nunit.org/index.php?p=assemblyIsolation&r=2.5.5" rel="nofollow">can be run in separate processes or domains using command line options</a>.
For the testrunner under Resharper, this setting can be found under
Resharper > Options > Unit Testing.
There is an option "<em>Use separate AppDomain for each assempbly with tests</em>". Checking that solved my problem.
<img alt="enter image description here" class="b-lazy" data-src="https://i.stack.imgur.com/z4sjj.png" data-original="https://i.stack.imgur.com/z4sjj.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" />