Ejemplo n.º 1
0
        public void ACLRule_CanAccessRole_ShouldReturnTrueIfRoleIsAdmin()
        {
            var testAclRule = new TestACLRule();

            testAclRule.CanAccess(new UserRole { Name = UserRole.Administrator },
                                  "test").Should().BeTrue();
        }
Ejemplo n.º 2
0
        public void ACLRule_CanAccessUser_ShouldReturnTrueIfUserIsAdmin()
        {
            var testAclRule = new TestACLRule();

            testAclRule.CanAccess(new User { Roles = new HashSet<UserRole> { new UserRole { Name = UserRole.Administrator } } },
                                  "test").Should().BeTrue();
        }
Ejemplo n.º 3
0
        public void ACLRule_AppName_IfTheAppIsSetShouldBeTheNameOfTheApp()
        {
            var testAclRule = new TestACLRule();

            testAclRule.SetApp(new TestApp());

            testAclRule.AppName.Should().Be("Test");
        }
Ejemplo n.º 4
0
        public void ACLRule_AppName_IfAppIsNullShouldBeSystem()
        {
            var testAclRule = new TestACLRule();

            testAclRule.SetApp(null);

            testAclRule.AppName.Should().Be("System");
        }
Ejemplo n.º 5
0
 public void ACLRule_AppName_IfTheAppIsSetShouldBeTheNameOfTheApp()
 {
     var testAclRule = new TestACLRule();
     
     testAclRule.SetApp(new TestApp());
     
     testAclRule.AppName.Should().Be("Test");
 }
Ejemplo n.º 6
0
        public void ACLRule_AppName_IfAppIsNullShouldBeSystem()
        {
            var testAclRule = new TestACLRule();
            
            testAclRule.SetApp(null);

            testAclRule.AppName.Should().Be("System");
        }
Ejemplo n.º 7
0
        public void ACLRule_CanAccessRole_ShouldReturnTrueIfRoleIsAdmin()
        {
            var testAclRule = new TestACLRule();

            testAclRule.CanAccess(new UserRole {
                Name = UserRole.Administrator
            },
                                  "test").Should().BeTrue();
        }
Ejemplo n.º 8
0
        public void ACLRule_CanAccessUser_ShouldReturnTrueIfUserIsAdmin()
        {
            var testAclRule = new TestACLRule();

            testAclRule.CanAccess(new User {
                Roles = new HashSet <UserRole> {
                    new UserRole {
                        Name = UserRole.Administrator
                    }
                }
            },
                                  "test").Should().BeTrue();
        }