Beispiel #1
0
        public void Received_WhenWrongCommand_ShouldCallWrongCommandHandler()
        {
            bool wasCalled = false;

            _sut.RegisterWrongCommandHandler(() => wasCalled = true);
            var result = _instructionsReceiverMock.SimulateCommandReceived("reset p:12".ToEnumerableByte());

            Assert.True(wasCalled);
            Assert.Equal(result, Enumerable.Empty <byte>());
        }
Beispiel #2
0
 public void RegisterWrongCommandHandler(Action action)
 {
     SafeExecution.TryCatch(() => _remoteApiMap.RegisterWrongCommandHandler(action),
                            exception => _recorder.DefaultException(this, exception));
 }