Hiding Thread.CurrentPrincipal from your code(jonkruger.com)
submitted by
david_holland(605) 3 years, 1 month ago
You can get information about the current user who is logged in using Thread.CurrentPrincipal. The problem with this is that it’s difficult to work with it in tests. It forces you to set the current principal in your test setup so that your code will work correctly, and this can be difficult if not impossible in situations where you’re using Windows Authentication (if you’re using Forms Authentication, it’s not quite as painful, but it’s still a pain).
|category: Unit Testing
|Views: 19
tags:
Testing another
Everyones tags:
Your Tags: