I'd like to write some integration tests for view-models in my WPF solution, where threads' principal is set globally with
NUnit doesn't provide mechanism to do the same from test code, with something like:
It is possible to do it through NUnit's "Settings Dialog", but it is not what I need (more about this solution under Test Loader Settings - Advanced / Principal Policy.
Is there a way to run a test with globally set principal, so that it is available to all threads within code stack under test? Is there a NUnit plugin that can provide such functionality or is there a way to run a test with new AppDomain, to which I would be able to set custom principal (how would I do that)?
I tried to do something similar with MsTest where
PrincipalPolicy.WindowsPrincipal is the default setting, but I was unable to set thread principal to AppDomain as well.