Ejemplo n.º 1
0
        public void TryAcquireTest3()
        {
            var softlock = new SoftLock();

            softlock.TryAcquire();

            softlock.TryAcquire().Should().BeFalse();
        }
Ejemplo n.º 2
0
        public void IsLockAcquired_WillReturnFalse_WhenPriorLockHasNotBeenAcquired()
        {
            var softlock = new SoftLock();

            // call nothing, should be false by default

            softlock.IsLockAcquired.Should().BeFalse();
        }
Ejemplo n.º 3
0
        public void TryAcquireTest3()
        {
            var softLock = new SoftLock();

            softLock.TryAcquire();

            Assert.IsTrue(softLock.IsLockAcquired);
        }
Ejemplo n.º 4
0
        public void IsLockAcquired_WillReturnTrue_WhenPriorLockHasBeenAcquired()
        {
            var softlock = new SoftLock();

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

            softlock.IsLockAcquired.Should().BeTrue();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 9
0
        public void TryAcquireTest2()
        {
            var softlock = new SoftLock();

            softlock.TryAcquire().Should().BeTrue();
        }
Ejemplo n.º 10
0
        public void TryAcquireTest2()
        {
            var softLock = new SoftLock();

            Assert.IsFalse(softLock.IsLockAcquired);
        }