Esempio n. 1
0
        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");
        }
Esempio n. 2
0
        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");
        }
Esempio n. 3
0
        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");
        }