Esempio n. 1
0
        public virtual void TestObtain()
        {
            LockMock lock_Renamed = new LockMock(this);
            Lock.LOCK_POLL_INTERVAL = 10;

            Assert.Throws<LockObtainFailedException>(() => lock_Renamed.Obtain(Lock.LOCK_POLL_INTERVAL),
                                                 "Should have failed to obtain lock");
            Assert.AreEqual(lock_Renamed.lockAttempts, 2, "should attempt to lock more than once");
        }
Esempio n. 2
0
        public virtual void TestObtain()
        {
            LockMock lock_Renamed = new LockMock(this);

            Lock.LOCK_POLL_INTERVAL = 10;

            Assert.Throws <LockObtainFailedException>(() => lock_Renamed.Obtain(Lock.LOCK_POLL_INTERVAL),
                                                      "Should have failed to obtain lock");
            Assert.AreEqual(lock_Renamed.lockAttempts, 2, "should attempt to lock more than once");
        }
Esempio n. 3
0
		public virtual void  TestObtain()
		{
			LockMock lock_Renamed = new LockMock(this);
			Lock.LOCK_POLL_INTERVAL = 10;
			
			try
			{
				lock_Renamed.Obtain(Lock.LOCK_POLL_INTERVAL);
				Assert.Fail("Should have failed to obtain lock");
			}
			catch (System.IO.IOException e)
			{
				Assert.AreEqual(lock_Renamed.lockAttempts, 2, "should attempt to lock more than once");
			}
		}
Esempio n. 4
0
        public virtual void TestObtain()
        {
            LockMock @lock = new LockMock(this);

            Lock.LOCK_POLL_INTERVAL = 10;

            try
            {
                @lock.Obtain(Lock.LOCK_POLL_INTERVAL);
                Assert.Fail("Should have failed to obtain lock");
            }
            catch (IOException e)
            {
                Assert.AreEqual(@lock.LockAttempts, 2, "should attempt to lock more than once");
            }
        }