private void InitializeMocks(InteractiveDiagnosticAction diagAction) { controllerWrapper = MockHelper.GetControllerMock(diagAction.DockingStation, null); consoleService = MockHelper.GetConsoleServiceMock(); pumpManager = MockHelper.GetPumpMock(); lcdMock = MockHelper.GetLCDMock(); smartCardWrapper = MockHelper.GetSmarcardWrapper(); }
internal static InteractiveDiagnosticAction GetInteractiveDiagnosticAction(DeviceType deviceType) { InteractiveDiagnosticAction action = new InteractiveDiagnosticAction(); action.DockingStation = GetDockingStationForTest(deviceType); return(action); }
private void InitializeForTest(InteractiveDiagnosticAction action) { InitializeMocks(action); Configuration.DockingStation = action.DockingStation; Configuration.Schema = Helper.GetSchemaForTest(); CreateMasterForMockTest(); }
public void ExecuteInteractiveDiagnosticsButNoTestsEnabled() { // arrange InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.MX4); InitializeForTest(action); InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action); InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute(); Assert.DoesNotContain("Controller.Key", diag.Details); }
// For docking stations with no lid switches, there's no need to perform the test. public void ExecuteInteractiveDiagnosticsForTestLidSwitches() { // arrange InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.MX6); action.DiagnoseLidSwitches = true; InitializeForTest(action); InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action); InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute(); Assert.Contains("Pump adapter present:", diag.Details); }
// For docking stations with no lid switches, there's no need to perform the test. public void SkipInteractiveDiagnosticsForTestLidSwitchesForDiffusionOnlyDocks() { // arrange InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.GBPRO); action.DiagnoseLidSwitches = true; InitializeForTest(action); InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action); InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute(); Assert.DoesNotContain("Pump adapter present:", diag.Details); }
public void ExecuteInteractiveDiagnosticsForTestBuzzer() { // arrange InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.MX6); action.DiagnoseBuzzer = true; InitializeForTest(action); InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action); InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute(); Assert.Contains("Buzzer works correctly: PASSED", diag.Details); }
// This test is for testing the instrument's battery charging, so dock expects instrument to be present public void ExecuteInteractiveDiagnosticsForBatteryChargingWhenInstrumentNotDocked() { // arrange InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.MX4); action.DiagnoseBatteryCharging = true; InitializeForTest(action); InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action); InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute(); Assert.Contains("Instrument present: FAILED", diag.Details); }
// For docking stations with no lid switches, there's no need to perform the test. public void ExecuteInteractiveDiagnosticsForTestiGas() { // arrange InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.MX6); action.DiagnoseIGas = true; InitializeForTest(action); InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action); InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute(); Assert.Contains("Pressure switch #3 pressure: PASSED", diag.Details); }
public void ExecuteInteractiveDiagnosticsForTestInstrumentCommunicationWithoutInstrument() { // arrange InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.MX4); action.DiagnoseInstrumentCommunication = true; InitializeForTest(action); InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action); InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute(); Assert.Contains("Instrument present: FAILED", diag.Details); }
public void ExecuteInteractiveDiagnosticsForBatteryChargingForNonRechargableBatteries() { // arrange InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.TX1); action.DiagnoseBatteryCharging = true; InitializeForTest(action); InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action); InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute(); Assert.DoesNotContain("Controller.Key", diag.Details); }
public void ExecuteInteractiveDiagnosticsForTestCradleGasFlowForSC() { // arrange InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.SC); action.DiagnoseCradleGasFlow = true; InitializeForTest(action); InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action); InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute(); Assert.Contains("Cradle flow through hose: PASSED", diag.Details); Assert.DoesNotContain("Cradle routes flow to lid:", diag.Details); }
// This test is for testing the instrument's battery charging, so dock expects instrument to be present // This calls discoverdocked instrument and thereby throws exception, however is exception is NOT thrown public void ExecuteInteractiveDiagnosticsForBatteryChargingWhenInstrumentIsDockedAndFetchInstrumentBatteryDetails() // TODO { // arrange InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.MX4); action.DiagnoseBatteryCharging = true; InitializeForTest(action); controllerWrapper.Setup(x => x.IsDocked()).Returns(true); InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action); InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute(); Assert.Contains("Battery installed: PASSED", diag.Details); }
// For new Ventis Cradle docking station, there's no need to perform the test. public void SkipInteractiveDiagnosticsForTestLidSwitchesForNewVentisCradle() { // arrange InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.MX4); action.DiagnoseLidSwitches = true; InitializeForTest(action); Configuration.DockingStation.HasNewVentisCradle = true; InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action); InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute(); Assert.DoesNotContain("Pump adapter present:", diag.Details); }
public void SkipInteractiveDiagnosticsForTestCradleGasFlowForVentisLS() { // arrange InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.MX4); action.DiagnoseCradleGasFlow = true; InitializeForTest(action); Configuration.DockingStation.PartNumber = Configuration.VENTISLS_PARTNUMBER; InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action); InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute(); Assert.DoesNotContain("Cradle routes flow to lid:", diag.Details); Assert.DoesNotContain("Cradle routes flow to hose:", diag.Details); }
// For docking stations with no lid switches, there's no need to perform the test. public void ExecuteInteractiveDiagnosticsForTestLidSwitchesOnlyForDiffusionLidForVentisLS() { // arrange InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.MX4); action.DiagnoseLidSwitches = true; InitializeForTest(action); Configuration.DockingStation.PartNumber = Configuration.VENTISLS_PARTNUMBER; InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action); InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute(); Assert.DoesNotContain("Pump adapter present:", diag.Details); Assert.Contains("Diffusion lid raised: PASSED", diag.Details); }
public void ExecuteInteractiveDiagnosticsForTestFlowRateForDSX() { // arrange InteractiveDiagnosticAction action = Helper.GetInteractiveDiagnosticAction(DeviceType.MX4); action.DiagnoseFlowRate = true; InitializeForTest(action); controllerWrapper.SetupSequence(x => x.GetKeyPress()) .Returns(new KeyPress(Key.Left, new TimeSpan(0, 0, 5))) .Returns(new KeyPress(Key.Right, new TimeSpan(0, 0, 5))) .Returns(new KeyPress(Key.Middle, new TimeSpan(0, 0, 5))); InteractiveDiagnosticOperation interactiveDiagOperation = new InteractiveDiagnosticOperation(action); InteractiveDiagnosticEvent diag = (InteractiveDiagnosticEvent)interactiveDiagOperation.Execute(); Assert.Contains("Flow Offset: PASSED", diag.Details); }
public InteractiveDiagnosticOperation( InteractiveDiagnosticAction interactiveDiagnosticAction ) : base( interactiveDiagnosticAction ) { }