Abstract testing framework.
https://www.nuget.org/packages/Test.It/
Let your unit test specification inherit Specification
or SpecificationAsync
to utilize a simple BDD test design. See the tests for examples.
When testing multiple tests in parallel it can sometimes be problematic to isolate logs between the tests, specifically when using globally defined logging frameworks like NLog. In order to handle that, use the Output
or OutputCapturer
classes to capture logs per test. See the tests for example.
Setting up output for Trace
and Console
must be done explicitly by using Output.WriteToTrace()
and Output.WriteToConsole()
. Make sure to reset the output by disposing the returned 'subscription' when done.
It's usually not recommended using any of these when running tests, specifically not when running tests in parallel since it is hard to isolate the output per test. Testing frameworks like XUnit therefor provides output helpers which can be wired up with the OutputCapturer
.