The goal of this work is to use existing NUnit
extensibility mechanisms to achieve AssemblyLoadContext
-level isolation between unit-test runs.
Typical use case is testing a code which mutates static state, or have complex logic in type initializers.
AssemblyLoadContext
is a new scoping concept in .NET Core
, which is intended to replace AppDomain
s in many cases.
- Test method isolation is not achieved (only test classes can be isolated).
IsolatedTests3.TestSharedVariableIncrement
tests are failing, because they're using the sameAssemblyLoadContext
. AssemblyLoadContext
unloadability. Currently, all created contexts are not unloaded. DotNet Core Unloadability Design Docs.- The design is poor. Better design can be supported by NUnit maintainers, see the issue.