Beispiel #1
0
        public void SendSubscribeMessage_SentMessage_ShouldBeOutboundSubscribeMessage()
        {
            using (var messageSender = Mock.Of <IMessageSender>())
            {
                using (var unicastMessageSender = new UnicastMessageSender(messageSender))
                {
                    var networkDevice = CreateNetworkDevice();

                    unicastMessageSender.SendSubscribeMessage(networkDevice);

                    Mock.Get(messageSender).Verify(ms => ms.Send(It.IsAny <OutboundSubscribeMessage>(), It.IsAny <IPAddress>()));
                }
            }
        }
Beispiel #2
0
        public void SendSubscribeMessage_Destination_ShouldMatch()
        {
            using (var messageSender = Mock.Of <IMessageSender>())
            {
                using (var unicastMessageSender = new UnicastMessageSender(messageSender))
                {
                    var networkDevice = CreateNetworkDevice();

                    unicastMessageSender.SendSubscribeMessage(networkDevice);

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