コード例 #1
0
        public void Can_do_roundtrip()
        {
            DisconnectMessage           msg        = new DisconnectMessage(DisconnectReason.AlreadyConnected);
            DisconnectMessageSerializer serializer = new DisconnectMessageSerializer();

            byte[]            serialized   = serializer.Serialize(msg);
            DisconnectMessage deserialized = serializer.Deserialize(serialized);

            Assert.AreEqual(msg.Reason, deserialized.Reason);
        }
コード例 #2
0
        public void Can_do_roundtrip()
        {
            DisconnectMessage           msg        = new DisconnectMessage(DisconnectReason.AlreadyConnected);
            DisconnectMessageSerializer serializer = new DisconnectMessageSerializer();

            byte[] serialized = serializer.Serialize(msg);
            Assert.AreEqual("0xc105", serialized.ToHexString(true), "bytes");
            DisconnectMessage deserialized = serializer.Deserialize(serialized);

            Assert.AreEqual(msg.Reason, deserialized.Reason, "reason");
        }