Exemplo n.º 1
0
        public void DalbajobusAtjungiamNuoServako()
        {
            var chatListener = new FakeServerChatListener();
            var sut = new ChatServerApplication(chatListener);
            sut.Start();
            var messageSource = new FakeCommunicationChannel();
            var messageLoxasRecipient = new FakeDalbajobasCommunicationChannel();
            chatListener.SimulateConnectToServer(messageLoxasRecipient);
            chatListener.SimulateConnectToServer(messageSource);

            messageSource.SimulateMessageReceived("foo");
            messageSource.SimulateMessageReceived("bar");
            Assert.Equal("foo", messageLoxasRecipient.LastMessageSent);
        }
Exemplo n.º 2
0
        public void ZinuteIssiustaNormaliemsNetJeiServakeYraDalbajobu()
        {
            var chatListener = new FakeServerChatListener();
            var sut = new ChatServerApplication(chatListener);
            sut.Start();
            var messageSource = new FakeCommunicationChannel();
            var messageLoxasRecipient = new FakeDalbajobasCommunicationChannel();
            var messageRecipient = new FakeCommunicationChannel();
            chatListener.SimulateConnectToServer(messageLoxasRecipient);
            chatListener.SimulateConnectToServer(messageRecipient);
            chatListener.SimulateConnectToServer(messageSource);

            messageSource.SimulateMessageReceived("foo");

            Assert.Equal("foo", messageRecipient.LastMessageSent);
        }