public void ShouldIncrementDecrementBusyCounter() { var busyWatcher = new BusyWatcher(); busyWatcher.AddWatch(); Assert.IsTrue(busyWatcher.IsBusy); busyWatcher.RemoveWatch(); Assert.IsFalse(busyWatcher.IsBusy); }
public void ShouldIncrementDecrementBusyCounter() { var busyWatcher = new BusyWatcher(); busyWatcher.AddWatch(); Assert.IsTrue(busyWatcher.IsBusy); busyWatcher.RemoveWatch(); Assert.IsFalse(busyWatcher.IsBusy); }
public void ShouldNestBusyState() { var busyWatcher = new BusyWatcher(); busyWatcher.AddWatch(); Assert.IsTrue(busyWatcher.IsBusy); using (busyWatcher.GetTicket()) { Assert.IsTrue(busyWatcher.IsBusy); } Assert.IsTrue(busyWatcher.IsBusy); busyWatcher.RemoveWatch(); Assert.IsFalse(busyWatcher.IsBusy); }
public void ShouldNestBusyState() { var busyWatcher = new BusyWatcher(); busyWatcher.AddWatch(); Assert.IsTrue(busyWatcher.IsBusy); using (busyWatcher.GetTicket()) { Assert.IsTrue(busyWatcher.IsBusy); } Assert.IsTrue(busyWatcher.IsBusy); busyWatcher.RemoveWatch(); Assert.IsFalse(busyWatcher.IsBusy); }