예제 #1
0
        private static SocketIoPacket BaseDecodeTest(string message, SocketIoPacket expectedPacket)
        {
            var packet = SocketIoPacket.Decode(message);

            packet.Prefix.Should().Be(expectedPacket.Prefix);
            packet.Namespace.Should().Be(expectedPacket.Namespace);
            packet.Value.Should().Be(expectedPacket.Value);

            return(packet);
        }
예제 #2
0
        private static SocketIoPacket BaseDecodeTest(string message, SocketIoPacket expectedPacket)
        {
            var packet = SocketIoPacket.Decode(message);

            Assert.AreEqual(expectedPacket.Prefix, packet.Prefix, $"{nameof(BaseDecodeTest)}.{nameof(packet.Prefix)}: {message}");
            Assert.AreEqual(expectedPacket.Namespace, packet.Namespace, $"{nameof(BaseDecodeTest)}.{nameof(packet.Namespace)}: {message}");
            Assert.AreEqual(expectedPacket.Value, packet.Value, $"{nameof(BaseDecodeTest)}.{nameof(packet.Value)}: {message}");

            return(packet);
        }
예제 #3
0
        private static void BaseDecodeEncodeTest(string message)
        {
            var packet = SocketIoPacket.Decode(message);

            BaseEncodeTest(packet, message);
        }