public void ShouldFailForDoubleLeave() { var @lock = new SlimLock(); @lock.Enter(); @lock.Leave(); Assert.Catch <Exception>(() => @lock.Leave(), "Enter/Leave should have balance"); }
public void ShouldEnterAndLeaveInSingleThreadWithTry() { var @lock = new SlimLock(); Assert.IsTrue(@lock.TryEnter()); @lock.Leave(); }
public void ShouldEnterAndLeaveInSingleThread() { var @lock = new SlimLock(); @lock.Enter(); @lock.Leave(); }