Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. namespace System.Security.Principal
  2. {
  3. public static class IdentityExtensions
  4. {
  5. public static bool HasContentPermission
  6. (this IIdentity identity, int contentID)
  7. {
  8. // I do stuff here
  9. return result;
  10. }
  11. }
  12. }
  13.  
  14. bool hasPermission = User.Identity.HasPermission(contentID);
  15.  
  16. using System.Security.Principal;
  17.  
  18. namespace MyUnitTests
  19. {
  20. [TestMethod]
  21. public void HasContentPermission_PermissionRecordExists_ReturnsTrue()
  22. {
  23. IIdentity identity;
  24. bool result = identity.HasContentPermission(...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement