public void EnterExitBusyModeTogglesIsBusy()
        {
            var model = new TermListViewModelDraft();

            Assert.AreEqual(false, model.IsBusy);

            model.InvokeEnterBusyMode();
            Assert.AreEqual(true, model.IsBusy);

            model.InvokeExitBusyMode();
            Assert.AreEqual(false, model.IsBusy);
        }
        public void EnterExitBusyModeConsiderNesting()
        {
            var model = new TermListViewModelDraft();

            var busyModeChangeCount = 0;

            model.PropertyChanged += (sender, e) => busyModeChangeCount++;

            // Verify that IsBusy changed only once.
            model.InvokeEnterBusyMode();
            model.InvokeEnterBusyMode();
            model.InvokeEnterBusyMode();
            Assert.AreEqual(1, busyModeChangeCount);

            busyModeChangeCount = 0;

            // Verify that IsBusy changed only once.
            model.InvokeExitBusyMode();
            model.InvokeExitBusyMode();
            model.InvokeExitBusyMode();
            Assert.AreEqual(1, busyModeChangeCount);
        }