Beispiel #1
0
        public void TestPayload()
        {
            using (var stream = new MemoryStream())
            {
                var source = new ForwardedMulticastData(
                    "host",
                    "user",
                    "__admin__",
                    "heartbeat",
                    true,
                    new DataPacket[]
                {
                    new DataPacket(
                        new HashSet <int> {
                        1
                    },
                        new byte[] { 1, 2, 3, 4, 5, 6 })
                });

                source.Write(new DataWriter(stream));
                stream.Seek(0, SeekOrigin.Begin);
                var dest = Message.Read(new DataReader(stream));
                Assert.AreEqual(source, dest);
            }
        }
Beispiel #2
0
 public void TestHeartbeat()
 {
     using (var stream = new MemoryStream())
     {
         var source = new ForwardedMulticastData(
             "user",
             "host",
             "__admin__",
             "heartbeat",
             true,
             null);
         source.Write(new DataWriter(stream));
         stream.Seek(0, SeekOrigin.Begin);
         var dest = Message.Read(new DataReader(stream));
         Assert.AreEqual(source, dest);
     }
 }