Ask a questionAsk a question
 

Proposed AnswerSetting the windows identity in a unit test

  • Tuesday, November 25, 2008 2:19 PMDr Adrian Colquhoun Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi

    Could someone point me to an article or advise me how to set the windows identity in my unit tests. I am testing some code that needs to grab the windows principal but when I test it using VSTS the Thread.CurrentPrincipal is already set to a generic principal. I could seem to find any documentation on how to control this so any help appreciated. (I've tried setting the app domain principal policy in code to no effect - I think it has already been set to generic principal by the unit test framework code?).

    Thanks

    Adrian 
    http://www.adriancolquhoun.com

All Replies