예제 #1
0
        public void RegisterWrongCommandHandler_WhenThrows_ShouldCatch()
        {
            Mock.Arrange(() => _remoteApiMap.RegisterWrongCommandHandler(Arg.IsAny <Action>())).Throws <Exception>();
            _sut = new TraceableRemoteApiMap(_remoteApiMap, _remoteRecordsSender, _recorder);

            Action a = () => { };

            _sut.RegisterWrongCommandHandler(a);

            Mock.Assert(() => _recorder.DefaultException(Arg.IsAny <Object>(), Arg.IsAny <Exception>()), Occurs.Exactly(1));
        }
예제 #2
0
        public void RegisterWrongCommand_WhenCalled_ShouldRegisterWrongCommand()
        {
            _sut = new TraceableRemoteApiMap(_remoteApiMap, _remoteRecordsSender, _recorder);

            Action a = () => { };

            _sut.RegisterWrongCommandHandler(a);

            Mock.Assert(() => _remoteApiMap.RegisterWrongCommandHandler(a),
                        Occurs.Exactly(1));
        }
예제 #3
0
        public ApiOperator(
            IMonitoredRemoteOperator monitoredRemoteOperator,
            ITraceableRemoteApiMap traceableRemoteApiMap,
            IApplicationRecorder applicationRecorder)
        {
            _traceableRemoteApiMap   = traceableRemoteApiMap;
            _monitoredRemoteOperator = monitoredRemoteOperator;
            _applicationRecorder     = applicationRecorder;

            _traceableRemoteApiMap.RegisterWrongCommandHandler(WrongCommandHandler);
            _monitoredRemoteOperator.Start();
        }