Exemplo n.º 1
0
        public void Constructor_WhenCalled_ShouldSubscribe()
        {
            _applicationRecorder.ArrangeSet(x => x.RecordReceived += null).IgnoreArguments().Occurs(1);

            _sut = new RemoteRecordsSender(_consistentMessageSender, _applicationRecorder, _recorder);

            _applicationRecorder.AssertAll();
        }
Exemplo n.º 2
0
        public void ActivateAndSendCache_WhenCalled_ShouldSendCorrect2()
        {
            Mock.Arrange(() => _applicationRecorder.GetCache()).Returns(new [] { "message1", "message2" });
            _sut = new RemoteRecordsSender(_consistentMessageSender, _applicationRecorder, _recorder);

            _sut.ActivateAndSendCache();

            Mock.Assert(() => _consistentMessageSender.SendRemote("message1\r\nmessage2\r\n"),
                        Occurs.Exactly(1));
        }
Exemplo n.º 3
0
        public void ActivateAndSendCache_WhenCalled_ShouldSendCorrect()
        {
            Mock.Arrange(() => _applicationRecorder.GetCache()).Returns(Enumerable.Empty <string>());
            _sut = new RemoteRecordsSender(_consistentMessageSender, _applicationRecorder, _recorder);

            _sut.ActivateAndSendCache();

            Mock.Assert(() => _consistentMessageSender.SendRemote(string.Empty),
                        Occurs.Exactly(1));
        }
Exemplo n.º 4
0
        public TraceableRemoteApiMap(
            IRemoteApiMap remoteApiMap,
            IRemoteRecordsSender remoteRecordsSender,
            IRecorder recorder)
        {
            _remoteApiMap        = remoteApiMap;
            _remoteRecordsSender = remoteRecordsSender;
            _recorder            = recorder;

            RegisterCommand(RemoteApiCommands.TRACE, TraceHandler);
        }
Exemplo n.º 5
0
 public TraceableRemoteApiMapTests()
 {
     _remoteApiMap        = Mock.Create <IRemoteApiMap>();
     _remoteRecordsSender = Mock.Create <IRemoteRecordsSender>();
     _recorder            = Mock.Create <IRecorder>();
 }