Exemplo n.º 1
0
        public void SendKeepaliveMessage_SentMessage_ShouldBeOutboundKeepaliveMessage()
        {
            using (var messageSender = Mock.Of <IMessageSender>())
            {
                using (var unicastMessageSender = new UnicastMessageSender(messageSender))
                {
                    var networkDevice = CreateNetworkDevice();

                    unicastMessageSender.SendKeepaliveMessage(networkDevice);

                    Mock.Get(messageSender).Verify(ms => ms.Send(It.IsAny <OutboundKeepaliveMessage>(), It.IsAny <IPAddress>()));
                }
            }
        }
Exemplo n.º 2
0
        public void SendKeepaliveMessage_Destination_ShouldMatch()
        {
            using (var messageSender = Mock.Of <IMessageSender>())
            {
                using (var unicastMessageSender = new UnicastMessageSender(messageSender))
                {
                    var networkDevice = CreateNetworkDevice();

                    unicastMessageSender.SendKeepaliveMessage(networkDevice);

                    Mock.Get(messageSender).Verify(ms => ms.Send(It.IsAny <IOutboundMessage>(), It.Is <IPAddress>(ip => ip.Equals(networkDevice.IPAddress))));
                }
            }
        }