public void TestDefaultsToPermissionRequested() { // Arrange SystemPermission systemPermission = new SystemPermission(); // Act // Assert Assert.AreEqual(SystemPermission.Requested, systemPermission.GetState()); Assert.AreEqual("REQUESTED", systemPermission.GetState()); }
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()); }
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()); }