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()); }
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); }