public void ShouldIncrementDecrementBusyCounter()
        {
            var busyWatcher = new BusyWatcher();
            busyWatcher.AddWatch();
            Assert.IsTrue(busyWatcher.IsBusy);

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

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

            busyWatcher.RemoveWatch();
            Assert.IsFalse(busyWatcher.IsBusy);
        }
Exemple #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);
        }
        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);
        }