Ejemplo n.º 1
0
        public void ObjectSpawnStartedMessage()
        {
            ObjectSpawnStartedMessage message = new ObjectSpawnStartedMessage();

            byte[] arr = MessagePackingTest.PackToByteArray(message);

            ObjectSpawnStartedMessage fresh = MessagePackingTest.UnpackFromByteArray <ObjectSpawnStartedMessage>(arr);

            Assert.That(fresh, Is.EqualTo(message));
        }
Ejemplo n.º 2
0
        public void ObjectSpawnStartedMessageTest()
        {
            // try setting value with constructor
            ObjectSpawnStartedMessage message = new ObjectSpawnStartedMessage();

            byte[] arr = MessagePacker.Pack(message);
            Assert.DoesNotThrow(() => {
                ObjectSpawnStartedMessage fresh = MessagePacker.Unpack <ObjectSpawnStartedMessage>(arr);
            });
        }
Ejemplo n.º 3
0
        public void ObjectSpawnStartedMessage()
        {
            // try setting value with constructor
            ObjectSpawnStartedMessage message = new ObjectSpawnStartedMessage();

            byte[] arr = MessagePackingTest.PackToByteArray(message);
            Assert.DoesNotThrow(() =>
            {
                ObjectSpawnStartedMessage fresh = MessagePackingTest.UnpackFromByteArray <ObjectSpawnStartedMessage>(arr);
            });
        }
Ejemplo n.º 4
0
        public void ObjectSpawnStartedMessageTest()
        {
            // try setting value with constructor
            ObjectSpawnStartedMessage message = new ObjectSpawnStartedMessage();

            // serialize
            NetworkWriter writer = new NetworkWriter();

            message.Serialize(writer);
            byte[] writerData = writer.ToArray();

            // deserialize the same data - do we get the same result?
            ObjectSpawnStartedMessage fresh = new ObjectSpawnStartedMessage();

            fresh.Deserialize(new NetworkReader(writerData));
        }