예제 #1
0
        public void ShouldIncrementDecrementBusyCounter()
        {
            var busyWatcher = new BusyWatcher();
            busyWatcher.AddWatch();
            Assert.IsTrue(busyWatcher.IsBusy);

            busyWatcher.RemoveWatch();
            Assert.IsFalse(busyWatcher.IsBusy);
        }
예제 #2
0
        public void ShouldIncrementDecrementBusyCounter()
        {
            var busyWatcher = new BusyWatcher();

            busyWatcher.AddWatch();
            Assert.IsTrue(busyWatcher.IsBusy);

            busyWatcher.RemoveWatch();
            Assert.IsFalse(busyWatcher.IsBusy);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }