public void CallHandlerWithoutProviderUsesDefaultProvider() { using (new PrincipalSwitcher(FredPrincipal)) { AuthorizationTestTarget testTarget = GetTarget(AllowJackPolicySet); string currentPrincipalName = testTarget.GetCurrentPrincipalName(); } }
public void ShouldAllowJackToCallGetCurrentPrincipalName() { using (new PrincipalSwitcher(JackPrincipal)) { AuthorizationTestTarget testTarget = GetTarget(AllowBasedOnTokensPolicySet); string currentPrincipalName = testTarget.GetCurrentPrincipalName(); } }
public void AuthorizationCanBeDeniedByCallHandler() { using (new PrincipalSwitcher(JackPrincipal)) { AuthorizationTestTarget testTarget = GetTarget(AllowFredPolicySet); testTarget.GetCurrentPrincipalName(); } }
public void ShouldNotAllowFredToCallGetCurrentPrincipalName() { using (new PrincipalSwitcher(FredPrincipal)) { AuthorizationTestTarget testTarget = GetTarget(AllowBasedOnTokensPolicyContainer); string currentPrincipalName = testTarget.GetCurrentPrincipalName(); } }
public void CallHandlerDoesNothingWhenUserIsAuthorized() { using (new PrincipalSwitcher(FredPrincipal)) { AuthorizationTestTarget testTarget = GetTarget(AllowFredPolicySet); string currentPrincipalName = testTarget.GetCurrentPrincipalName(); Assert.AreEqual("Fred", currentPrincipalName); } }