public void LockHandler_Unlock_Test() { Node node = CreateTestPage(); LockHandler target = new LockHandler(node); if (!target.Locked) { target.Lock(); } target.Unlock(VersionStatus.Approved, VersionRaising.None); Assert.IsTrue(!GetNodeInfo_Locked(node)); }
public void LockHandler_Lock_Test() { Node node = CreateTestPage(); LockHandler target = new LockHandler(node); if (target.Locked) { target.Unlock(VersionStatus.Approved, VersionRaising.None); } target.Lock(); Assert.IsTrue( !(string.IsNullOrEmpty(GetNodeInfo_LockToken(node))) && GetNodeInfo_LockedById(node) == User.Current.Id && GetNodeInfo_LockDate(node) != DateTime.MinValue && GetNodeInfo_LastLockUpdate(node) != DateTime.MinValue && GetNodeInfo_LockTimeout(node) > 0 ); }