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>()); }
public void RegisterWrongCommandHandler(Action action) { SafeExecution.TryCatch(() => _remoteApiMap.RegisterWrongCommandHandler(action), exception => _recorder.DefaultException(this, exception)); }