public void DeniedProcessorShouldAlwaysDeny() { var processor = new AuthorizationProcesser(_nullPrincipal, new DeniedAuthorizer()); Assert.Throws <EntityErrorsException>(() => processor.Process(_entitySaveMap), "Denied Processor didn't deny."); }
public void WhitelistMembershipShouldBypassAuthorization() { var processor = new AuthorizationProcesser(_adminBob, new DeniedAuthorizer(), _adminRole); Assert.DoesNotThrow(() => processor.Process(_entitySaveMap), "Whitelisted user should have bypassed authorization check."); }
public void AllowedProcessorShouldAlwaysSucceed() { var processor = new AuthorizationProcesser(_nullPrincipal, new AllowedAuthorizer()); Assert.DoesNotThrow(() => processor.Process(_entitySaveMap), "Allowed Processor didn't allow."); }