コード例 #1
0
        public void ExecuteGeneralDiag()
        {
            // arrange
            InstrumentDiagnosticAction action = Helper.GetDiagnosticAction(DeviceType.MX4);

            InitializeForTest(action);

            InstrumentDiagnosticOperation diagOperation = new InstrumentDiagnosticOperation(action);
            InstrumentDiagnosticEvent     diag          = (InstrumentDiagnosticEvent)diagOperation.Execute();

            Assert.True(diag.Diagnostics.Count == 2);

            instrumentController.Verify(x => x.ClearInstrumentErrors(), Times.Once);
        }
コード例 #2
0
        public void GetNothingActionDueToInstrumentCriticalError()
        {
            // arrange
            InstrumentDiagnosticAction    action    = new InstrumentDiagnosticAction();
            InstrumentDiagnosticOperation operation = new InstrumentDiagnosticOperation(action);
            InstrumentDiagnosticEvent     dsEvent   = new InstrumentDiagnosticEvent(operation);

            instrument = Helper.GetInstrumentForTest(DeviceType.VPRO, DeviceSubType.VentisPro4);
            dsEvent.InstrumentInCriticalError = true;

            Initialize();
            CreateMasterForTest();
            // act
            nextAction = scheduler.GetNextAction(dsEvent);

            // assert
            Xunit.Assert.True(nextAction is NothingAction);
        }
コード例 #3
0
        public void ExecuteDiagnosticsForMX6InstrumentErrorsOnCustomerAccount()
        {
            // arrange
            InstrumentDiagnosticAction action = Helper.GetDiagnosticAction(DeviceType.MX6);

            InitializeForTest(action);

            InstrumentDiagnosticOperation diagOperation = new InstrumentDiagnosticOperation(action);

            diagOperation.criticalErrorsList = DiagErrorDataAccess.Object.FindAll();

            InstrumentDiagnosticEvent diag = (InstrumentDiagnosticEvent)diagOperation.Execute();

            Assert.True(diag.Diagnostics.Count == 2 && diag.InstrumentInCriticalError &&
                        diag.InstrumentCriticalErrorCode == diagOperation.criticalErrorsList[0].Code.ToString());

            instrumentController.Verify(x => x.ClearInstrumentErrors(), Times.Never);
        }