Example #1
0
        public void MalformedMessage()
        {
            byte[] malformedMessage = null;
            using (var mdns = new MulticastService())
            {
                mdns.MalformedMessage += (s, e) => malformedMessage = e;

                var msg      = new byte[] { 0xff };
                var endPoint = new IPEndPoint(IPAddress.Loopback, 5353);
                var udp      = new UdpReceiveResult(msg, endPoint);
                mdns.OnDnsMessage(this, udp);

                CollectionAssert.AreEqual(msg, malformedMessage);
            }
        }