예제 #1
0
        protected override void When()
        {
            _mockRecoveryTask = Substitute.For <IRunnable>();
            _mockRecoveryTask
            .Run()
            .Returns(SequenceResultEnum.Fail);
            _recoveryOptions = new RecoveryOptionsDto(true, _mockRecoveryTask.Run);

            MockFirstTask
            .GetRunCount()
            .Returns(_runCountFirst);
            MockFirstTask
            .Run()
            .Returns(SequenceResultEnum.Success);

            MockSecondTask
            .GetRunCount()
            .Returns(_runCountSecond);
            MockSecondTask
            .Run()
            .Returns(SequenceResultEnum.Success);

            MockThirdTask
            .RecoveryOptions
            .Returns(_recoveryOptions);
            MockThirdTask
            .GetRunCount()
            .Returns(_runCountThird);
            MockThirdTask
            .Run()
            .Returns(SequenceResultEnum.Fail);

            _result = SUT.Run();
        }
        protected override void When()
        {
            MockFirstTask
            .GetRunCount()
            .Returns(_runCountFirst);
            MockFirstTask
            .Run()
            .Returns(SequenceResultEnum.Success);

            MockSecondTask
            .GetRunCount()
            .Returns(_runCountSecond);
            MockSecondTask
            .Run()
            .Returns(SequenceResultEnum.Success);

            MockThirdTask
            .GetRunCount()
            .Returns(_runCountThird);
            MockThirdTask
            .Run()
            .Returns(SequenceResultEnum.Success);

            _result = SUT.Run();
        }
예제 #3
0
        protected override void When()
        {
            _recoveryOptions = new RecoveryOptionsDto();

            MockFirstTask
            .GetRunCount()
            .Returns(_runCountFirst);
            MockFirstTask
            .Run()
            .Returns(SequenceResultEnum.Success);

            MockSecondTask
            .GetRunCount()
            .Returns(_runCountSecond);
            MockSecondTask
            .Run()
            .Returns(SequenceResultEnum.Success);

            MockThirdTask
            .RecoveryOptions
            .Returns(_recoveryOptions);
            MockThirdTask
            .GetRunCount()
            .Returns(_runCountThird);
            MockThirdTask
            .Run()
            .Returns(SequenceResultEnum.Fail);

            _result = SUT.Run();
        }
        protected override void When()
        {
            MockLowerSequenceTask
            .Run()
            .Returns(SequenceResultEnum.Success);
            MockUpperSequenceSecondTask
            .Run()
            .Returns(SequenceResultEnum.Success);

            _result = SUT.Run();
        }
        protected override void When()
        {
            MockLowerSequenceTask
            .Run()
            .Returns(SequenceResultEnum.Fail);
            MockLowerSequenceTask
            .RecoveryOptions
            .Returns(new RecoveryOptionsDto());
            MockLowerSequenceRecoveryTask
            .Run()
            .Returns(SequenceResultEnum.Fail);

            _result = SUT.Run();
        }
예제 #6
0
        protected override void When()
        {
            MockAnalogOperations
            .Read(Arg.Any <IDevice>())
            .Returns(new OperationResult
            {
                ResultStatus = OperationResultEnum.Failiure
            });
            MockValidateOperationService
            .GetSequenceResult(Arg.Any <OperationResultEnum>())
            .Returns(SequenceResultEnum.Fail);

            _result = SUT.Run();
        }
        protected override void When()
        {
            MockErrorValidateOperationService
            .GetSequenceResult(Arg.Any <OperationResultEnum>())
            .Returns(_expectedResult);
            MockAxisOperations
            .MoveAxisSearch(
                Arg.Any <IDevice>(),
                Arg.Any <IDevice>(),
                Arg.Any <bool>()
                )
            .Returns(_operationResult);

            _result = SUT.Run();
        }
        protected override void When()
        {
            MockAnalogOperations
            .Read(Arg.Any <IDevice>())
            .Returns(new OperationResult
            {
                ResultStatus = OperationResultEnum.Succeess,
                Return       = _lightLuxLevel
            });
            MockValidateOperationService
            .GetSequenceResult(Arg.Any <OperationResultEnum>())
            .Returns(SequenceResultEnum.Success);

            _result = SUT.Run();
        }
 public When_Run(OperationResultEnum operationResult, SequenceResultEnum expectedResult)
 {
     _operationResult = operationResult;
     _expectedResult  = expectedResult;
 }
예제 #10
0
 protected override void When()
 {
     Result = SUT
              .Build()
              .Run();
 }