Ejemplo n.º 1
0
        public void TestJsonToInitializedMessage()
        {
            string clientInitializedJson = @"{
                tag: ""init_done"",
                senderId: ""726288bd-a6a0-41de-bbba-96fe63bab1c7""
            }";
            var    msgBytes = Encoding.UTF8.GetBytes(clientInitializedJson);

            var message = GameMessage.FromBytes(msgBytes);

            Assert.IsInstanceOfType(message, typeof(ClientInitialized));
        }
Ejemplo n.º 2
0
        public void TestJsonToCustomMessage()
        {
            string customJson = @"{
                tag: ""oink"",
                senderId: ""726288bd-a6a0-41de-bbba-96fe63bab1c7"",
                foo: ""bar"",
                value: 12345
            }";
            var    msgBytes   = Encoding.UTF8.GetBytes(customJson);

            var message = GameMessage.FromBytes(msgBytes);

            Assert.IsInstanceOfType(message, typeof(CustomMessage));
        }