예제 #1
0
		public void LockHandler_RefreshLock_Test()
		{
			Node node = CreateTestPage();

			LockHandler target = new LockHandler(node);
			if (!target.Locked)
			{
				target.Lock();
			}
			long time = GetNodeInfo_LastLockUpdate(node).Ticks;

			Thread.Sleep(10);

			target.RefreshLock();

			Assert.IsTrue(GetNodeInfo_LastLockUpdate(node).Ticks > time);
		}
예제 #2
0
		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
			);
		}
예제 #3
0
		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));
		}
예제 #4
0
		public void LockHandler_Lock_LockedTest()
		{
			Node node = CreateTestPage();

			LockHandler target = new LockHandler(node);

			target.Lock();
			DateTime dt1 = target.LastLockUpdate;

			Thread.Sleep(10);

			target.Lock();
			DateTime dt2 = target.LastLockUpdate;

			Assert.IsTrue(dt1 < dt2);
		}
예제 #5
0
 public LockedNodeException(LockHandler lockHandler, string message)
     : base(message)
 {
     this._lockHandler = lockHandler;
 }
예제 #6
0
 public LockedNodeException(LockHandler lockHandler)
     : base(String.Concat(lockHandler.Node.Path, ": is locked."))
 {
     this._lockHandler = lockHandler;
 }
예제 #7
0
		public LockedNodeException(LockHandler lockHandler, string message)
			: base(message)
		{
			this._lockHandler = lockHandler;
		}
예제 #8
0
		public LockedNodeException(LockHandler lockHandler)
			: base(String.Concat(lockHandler.Node.Path, ": is locked."))
		{
			this._lockHandler = lockHandler;
		}