示例#1
0
        public void TestClaimedBy()
        {
            SystemUser       user       = new SystemUser();
            SystemProfile    profile    = new SystemProfile();
            SystemPermission permission = new SystemPermission(user, profile);

            Assert.AreEqual(PermissionState.REQUESTED, permission.GetState());

            SystemAdmin admin = new SystemAdmin();

            permission.ClaimedBy(admin);
            Assert.AreEqual(PermissionState.CLAIMED, permission.GetState());
            Assert.AreEqual(false, permission.IsGranted());
        }
示例#2
0
        public void TestClaimedByWithUnixConcerned()
        {
            SystemUser    user    = new SystemUser();
            SystemProfile profile = new SystemProfile();

            profile.SetUnixPermissionRequired(true);
            SystemPermission permission = new SystemPermission(user, profile);

            Assert.AreEqual(PermissionState.UNIX_REQUESTED, permission.GetState());

            SystemAdmin admin = new SystemAdmin();

            permission.ClaimedBy(admin);
            Assert.AreEqual(PermissionState.UNIX_CLAIMED, permission.GetState());
            Assert.AreEqual(false, permission.IsGranted());
        }