public void adding_multiple_roles() { var node = new AuthorizationNode(); node.AddRole("RoleA"); node.AddRole("RoleB"); node.AddRole("RoleC"); var authorizationBehavior = toBehavior(node); authorizationBehavior.Policies.Count.ShouldEqual(3); authorizationBehavior.Policies[0].ShouldBeOfType<AllowRole>().Role.ShouldEqual("RoleA"); authorizationBehavior.Policies[1].ShouldBeOfType<AllowRole>().Role.ShouldEqual("RoleB"); authorizationBehavior.Policies[2].ShouldBeOfType<AllowRole>().Role.ShouldEqual("RoleC"); }
public void adding_a_role() { var node = new AuthorizationNode(); node.AddRole("RoleA"); var authorizationBehavior = toBehavior(node); authorizationBehavior.Policies.Count.ShouldEqual(1); authorizationBehavior.Policies.First().ShouldBeOfType<AllowRole>().Role.ShouldEqual("RoleA"); }
public void SetUp() { chain = new BehaviorChain(); var node = new AuthorizationNode(); node.AddRole("RoleA"); node.AddRole("RoleB"); node.AddRole("RoleC"); chain.AddToEnd(node); endpointObjectDef = node.As<IAuthorizationRegistration>().ToEndpointAuthorizorObjectDef(); }
public void with_rules() { var node = new AuthorizationNode(); node.AddRole("Role A"); node.HasRules().ShouldBeTrue(); }