NUnit TestExecutionContext is null when running ASB callback
NUnit 3.7.0 has introduced a controlled change on how TestExecutionContext
is returned
- In version 3.6.1 it was guarding again null
- In vesion 3.7.0 guarding was removed an assumption was made that assertions should be executed under test thread. In case assertion is not running under a test thread, assertions will fail.
With WindowsAzure.ServiceBus ASB client, message pumps are executed as separate threads, so any assertion would be considered to be outside of the testing thread. This repro demonstrates that.
Questions:
- Should NUnit assumption be challenged?
- What does ASB Client do to cause
CallContext.GetData(CONTEXT_KEY)
to benull
?