Exemplo n.º 1
0
        public void SendMessage_ShouldSendMessage()
        {
            var mockMessageHandler = new Mock <IMessageHandler>();
            var backend            = new TestableBackend(mockMessageHandler.Object);

            var message = new dogma.Message.Message(MessageType.SYNTAX_ERROR, null);

            backend.SendMessage(message);

            mockMessageHandler.Verify(handler => handler.SendMessage(message));
        }
Exemplo n.º 2
0
        public void RemoveMessageListener_ShouldRemoveAMessageListener()
        {
            var mockMessageHandler = new Mock <IMessageHandler>();
            var backend            = new TestableBackend(mockMessageHandler.Object);

            var messageListener = Mock.Of <IMessageListener>();

            backend.RemoveMessageListener(messageListener);

            mockMessageHandler.Verify(handler => handler.RemoveListener(messageListener));
        }