public void RegisterCommand_WhenThrows_ShouldCatch() { Mock.Arrange(() => _remoteApiMap.RegisterCommand("action", Arg.IsAny <Action>(), string.Empty)).Throws <Exception>(); _sut = new TraceableRemoteApiMap(_remoteApiMap, _remoteRecordsSender, _recorder); Action a = () => { }; _sut.RegisterCommand("action", a, string.Empty); Mock.Assert(() => _recorder.DefaultException(Arg.IsAny <Object>(), Arg.IsAny <Exception>()), Occurs.Exactly(1)); }
public void RegisterCommand_WhenCalled_ShouldRegisterCommand() { _sut = new TraceableRemoteApiMap(_remoteApiMap, _remoteRecordsSender, _recorder); Action a = () => { }; _sut.RegisterCommand("action", a, string.Empty); Mock.Assert(() => _remoteApiMap.RegisterCommand("action", a, string.Empty), Occurs.Exactly(1)); }