public void WhenCreatingNewViewModelThenItWasInitializedCorrectly()
        {
            var emulationStatusControlViewModel = new EmulationStatusControlViewModel(this.smartDetectorRunnerMock.Object, this.tracerMock.Object, this.notificationService);

            Assert.AreEqual(this.smartDetectorRunnerMock.Object, emulationStatusControlViewModel.SmartDetectorRunner, "Unexpected smart detector runner");
            Assert.AreEqual(this.tracerMock.Object, emulationStatusControlViewModel.Tracer, "Unexpected tracer");
        }
        public void WhenExecutingClearTracerBoxCommandCommandThenTheTracerBoxWasCleared()
        {
            var emulationStatusControlViewModel = new EmulationStatusControlViewModel(this.smartDetectorRunnerMock.Object, this.tracerMock.Object, this.notificationService);

            emulationStatusControlViewModel.ClearTracerBoxCommand.Execute(parameter: null);

            this.tracerMock.Verify(m => m.Clear(), Times.Once());
        }
Exemple #3
0
        public void WhenExecutingSwitchTabCommandThenTheTabWasSwitched()
        {
            var emulationStatusControlViewModel = new EmulationStatusControlViewModel(this.smartDetectorRunnerMock.Object, this.notificationService);

            bool tabSwitchedToAlertsControlEventWasFired = false;

            this.notificationService.TabSwitchedToAlertsControl += () =>
            {
                tabSwitchedToAlertsControlEventWasFired = true;
            };

            emulationStatusControlViewModel.SwitchTabCommand.Execute(parameter: null);

            Assert.IsTrue(tabSwitchedToAlertsControlEventWasFired);
        }