Beispiel #1
0
        public void SendDiscoveryMessage_SentMessage_ShouldBeOutboundDiscoveryMessage()
        {
            var messageSender          = Mock.Of <IMessageSender>();
            var broadcastMessageSender = new BroadcastMessageSender(messageSender);

            broadcastMessageSender.SendDiscoveryMessage();

            Mock.Get(messageSender).Verify(ms => ms.Send(It.IsAny <OutboundDiscoveryMessage>(), It.IsAny <IPAddress>()));
        }
Beispiel #2
0
        public void SendDiscoveryMessage_DestinationIPAddress_ShouldBeBroadcastAddress()
        {
            var messageSender          = Mock.Of <IMessageSender>();
            var broadcastMessageSender = new BroadcastMessageSender(messageSender);

            broadcastMessageSender.SendDiscoveryMessage();

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