public void WhenCreatingNewViewModelThenItWasInitializedCorrectly() { var alertsControlViewModel = new AlertsControlViewModel(this.smartDetectorRunner, this.systemProcessClientMock.Object); Assert.AreEqual(this.smartDetectorRunner, alertsControlViewModel.SmartDetectorRunner, "Unexpected smart detector runner"); Assert.IsNull(alertsControlViewModel.SelectedAlert, "Selected alert should be null"); Assert.IsNull(alertsControlViewModel.AlertDetailsControlViewModel, "Alert details control view model should be null"); }
public void WhenAlertDetailsControlClosedEventWasInvokedThenSelectedAlertWasSetToNull() { var alertsControlViewModel = new AlertsControlViewModel(this.smartDetectorRunner, this.systemProcessClientMock.Object); var emulationAlert = EmulationAlertHelper.CreateEmulationAlert(new TestAlert()); alertsControlViewModel.SelectedAlert = emulationAlert; Assert.IsNotNull(alertsControlViewModel.AlertDetailsControlViewModel, "Alert details control view model should not be null"); Assert.AreEqual(emulationAlert, alertsControlViewModel.AlertDetailsControlViewModel.Alert, "Unexpected alert details control view model"); alertsControlViewModel.AlertDetailsControlViewModel.CloseControlCommand.Execute(parameter: null); Assert.IsNull(alertsControlViewModel.SelectedAlert, "Selected alert should be null"); }
public void WhenAlertWasSelectedThenAlertDetailsViewModelWasUpdatedAccordingly() { var alertsControlViewModel = new AlertsControlViewModel(this.smartDetectorRunner, this.systemProcessClientMock.Object); EmulationAlert emulationAlert = EmulationAlertHelper.CreateEmulationAlert(new TestAlert()); alertsControlViewModel.SelectedAlert = emulationAlert; Assert.IsNotNull(alertsControlViewModel.AlertDetailsControlViewModel, "Alert details control view model should not be null"); Assert.AreEqual(emulationAlert, alertsControlViewModel.AlertDetailsControlViewModel.Alert, "Unexpected alert details control view model"); EmulationAlert anotherEmulationAlert = EmulationAlertHelper.CreateEmulationAlert(new TestAlert()); alertsControlViewModel.SelectedAlert = anotherEmulationAlert; Assert.IsNotNull(alertsControlViewModel.AlertDetailsControlViewModel, "Alert details control view model should not be null"); Assert.AreEqual(anotherEmulationAlert, alertsControlViewModel.AlertDetailsControlViewModel.Alert, "Unexpected alert details control view model"); }