Exemplo n.º 1
0
        public void ShouldIncrementDecrementBusyCounter()
        {
            var busyWatcher = new BusyWatcher();
            busyWatcher.AddWatch();
            Assert.IsTrue(busyWatcher.IsBusy);

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

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

            busyWatcher.RemoveWatch();
            Assert.IsFalse(busyWatcher.IsBusy);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }