예제 #1
0
        public void TryAcquireTest3()
        {
            var softlock = new SoftLock();

            softlock.TryAcquire();

            softlock.TryAcquire().Should().BeFalse();
        }
예제 #2
0
        public void IsLockAcquired_WillReturnFalse_WhenPriorLockHasNotBeenAcquired()
        {
            var softlock = new SoftLock();

            // call nothing, should be false by default

            softlock.IsLockAcquired.Should().BeFalse();
        }
예제 #3
0
        public void TryAcquireTest3()
        {
            var softLock = new SoftLock();

            softLock.TryAcquire();

            Assert.IsTrue(softLock.IsLockAcquired);
        }
예제 #4
0
        public void IsLockAcquired_WillReturnTrue_WhenPriorLockHasBeenAcquired()
        {
            var softlock = new SoftLock();

            // This will set the lock to true
            softlock.TryAcquire();

            softlock.IsLockAcquired.Should().BeTrue();
        }
예제 #5
0
        public void TryAcquireTest1()
        {
            var softlock = new SoftLock();

            // Prove that the lock is not acquired initially
            softlock.IsLockAcquired.Should().BeFalse();

            // This will set the lock to true
            softlock.TryAcquire();

            softlock.IsLockAcquired.Should().BeTrue();
        }
예제 #6
0
        public void TryAcquireTest1()
        {
            var softLock = new SoftLock();

            // Prove that the lock is not acquired initially
            Assert.IsFalse(softLock.IsLockAcquired);

            // This will set the lock to true
            softLock.TryAcquire();

            Assert.IsTrue(softLock.IsLockAcquired);
        }
예제 #7
0
        public void ReleaseTest()
        {
            var softlock = new SoftLock();

            softlock.TryAcquire();

            // prove it is locked
            softlock.IsLockAcquired.Should().BeTrue("If this failed we have issues in TryAcquire");

            softlock.Release();

            // verify it has been released
            softlock.IsLockAcquired.Should().BeFalse();
        }
예제 #8
0
        public void ReleaseTest()
        {
            var softLock = new SoftLock();

            softLock.TryAcquire();

            // prove it is locked
            Assert.IsTrue(softLock.IsLockAcquired, "If this failed we have issues in TryAcquire");

            softLock.Release();

            // verify it has been released
            Assert.IsFalse(softLock.IsLockAcquired);
        }
예제 #9
0
        public void TryAcquireTest2()
        {
            var softlock = new SoftLock();

            softlock.TryAcquire().Should().BeTrue();
        }
예제 #10
0
        public void TryAcquireTest2()
        {
            var softLock = new SoftLock();

            Assert.IsFalse(softLock.IsLockAcquired);
        }