title: Tests using NSubstitute fail when running in Mono pipeline
body: <pre><code>System.TypeInitializationException : The type initializer for 'NSubstitute.Core.SubstitutionContext' threw an exception.
        ---- System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.
        -------- System.NullReferenceException : Object reference not set to an instance of an object
        Stack Trace:
            at NSubstitute.Substitute.For (System.Type[] typesToProxy, System.Object[] constructorArguments) [0x00000] in &lt;12c131832e33409abe0da20ca32c0932&gt;:0 
            at NSubstitute.Substitute.For[T] (System.Object[] constructorArguments) [0x00000] in &lt;12c131832e33409abe0da20ca32c0932&gt;:0 
            at TriplogWebAPITest.Admin.AdminTripControllerTest..ctor () [0x0000c] in &lt;77e0d73ea5c74efc8252fdf5f78920f3&gt;:0 
            at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke(System.Reflection.MonoCMethod,object,object[],System.Exception&amp;)
            at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00005] in &lt;2943701620b54f86b436d3ffad010412&gt;:0 
  </code></pre>
  <p>when running the unit tests on my local machine, everything is fine, the tests run and turn out positive.
  but then i update my branch and the pipeline in gitlab has a go at it, then it fails. with the stacktrace stated above. Its not always this test, and it doesnt always fail, just very often.</p>
  <p>i have tried to see if mono has an issue using NSubstitute and that turned out nothing, i also tried to find out if the console runner we use has any forum threads or known issues with NSubstitute and i havent found anything.</p>
  <p>NSubsitute ver 4.2.1
  Mono ver 5.14
  xUnit.net Console Runner v2.4.1</p>
  <p>does anyone have any clue as to what the source of the problem is?
  and what a potential solution could be?</p>