问题描述
嗨
有人可以指点我一篇文章或者告诉我如何在我的单元测试中设置windows身份。我正在测试一些需要获取windows主体的代码但是当我使用VSTS测试它时,Thread.CurrentPrincipal已经设置为通用主体。我似乎找到了关于如何控制这个的任何文档,所以任何帮助赞赏。 (我已经尝试在代码中设置app域主体策略无效 - 我认为它已经被单元测试框架代码设置为通用主体了吗?)。
Adrian
http://www.adriancolquhoun.com
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
这篇关于在单元测试中设置Windows标识的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!