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

            testAclRule.CanAccess(new UserRole { Name = UserRole.Administrator },
                                  "test").Should().BeTrue();
        }
Esempio 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();
        }
Esempio n. 3
0
        public void ACLRule_AppName_IfTheAppIsSetShouldBeTheNameOfTheApp()
        {
            var testAclRule = new TestACLRule();

            testAclRule.SetApp(new TestApp());

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

            testAclRule.SetApp(null);

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

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

            testAclRule.CanAccess(new UserRole {
                Name = UserRole.Administrator
            },
                                  "test").Should().BeTrue();
        }
Esempio 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();
        }