Exemple #1
0
 public When_The_Operation_Response_Is_Valid(byte[] operationResponseParams, byte status, int returnValue)
 {
     _operationResponseParams = operationResponseParams;
     _expectedResult          = new OperationResponseDto
     {
         Status  = status,
         Returns = returnValue
     };
 }
 protected override void When()
 {
     _result = SUT.SendOperation(
         new OperationDto
     {
         Device    = 2,
         Operation = 3,
         Params    = new[] { 28536 }
     }
         );
 }
 protected override void When()
 {
     _result = SUT.SendOperation(
         new OperationDto
     {
         Device    = 1,
         Operation = 1,
         Params    = new int[] { }
     }
         );
 }
Exemple #4
0
        protected override void When()
        {
            Operation = new OperationDto
            {
                Device = 1, Operation = 1, Params = new[] { 1 }
            };
            Payload = new byte[] { 1, 1, 1, 1 };
            MockSocketClient
            .Recieve()
            .Returns(_operationResponseParams);

            _result = SUT.SendOperation(Operation);
        }
        protected override void When()
        {
            var operationResponse = new OperationResponseDto {
                Status = _errorCode
            };

            MockControlLine
            .SendOperation(Arg.Any <OperationDto>())
            .Returns(operationResponse);
            MockErrorService
            .Validate(Arg.Any <byte>())
            .Returns(_moveResult);

            _result = SUT.MoveAxisAbsolute(new DoorAxis(), 120);
        }
        protected override void When()
        {
            var operationResponse = new OperationResponseDto {
                Status = _errorCode
            };

            MockControlLine
            .SendOperation(Arg.Any <OperationDto>())
            .Returns(operationResponse);
            MockErrorService
            .Validate(Arg.Any <byte>())
            .Returns(_moveResult);

            _result = SUT.MoveAxisSearch(new DoorAxis(), new CeilingDigitalSensor(), _direction);
        }
Exemple #7
0
        protected override void When()
        {
            Payload   = new byte[] { 115, 121, 2, 255, 255 };
            Operation = new OperationDto
            {
                Operation = 115,
                Device    = 121,
                Params    = new[] { 65535 }
            };
            _operationResponse = new OperationResponseDto
            {
                Status  = 115,
                Returns = 65535
            };

            MockSocketClient
            .Recieve()
            .Returns(new byte[] { 115, 2, 255, 255, 0, 0, 0, 0 });

            _result = SUT.SendOperation(Operation);
        }