Beispiel #1
0
        public void DeserializeTestCaseShouldReturnExpected()
        {
            List <byte> data = data1();
            DynamicObjectInformation info         = serializer.Deserialize(data);
            DynamicObjectInformation expectedInfo = PlayerInformation1();

            Assert.That(info.Equals(expectedInfo));
        }
Beispiel #2
0
        public void SerializeThenDeserializeShouldPreserveOriginal()
        {
            // Serialize some information
            DynamicObjectInformation info = PlayerInformation1();
            List <byte> data = serializer.Serialize(info);

            // Make sure the serializer isn't just spitting out the same thing
            Assert.That(!info.Equals(data));

            // Deserialize the result
            DynamicObjectInformation resultingInfo = serializer.Deserialize(data);

            // Check the information is the same as the original
            Assert.That(resultingInfo.Equals(info));
        }
Beispiel #3
0
        public void EqualsItselfShouldReturnTrue()
        {
            DynamicObjectInformation test = new DynamicObjectInformation(new Vector2(), new Vector2(), 0);

            Assert.That(test.Equals(test));
        }
Beispiel #4
0
        public void EqualsNullShouldReturnFalse()
        {
            DynamicObjectInformation test = new DynamicObjectInformation(new Vector2(), new Vector2(), 0);

            Assert.That(!test.Equals(null));
        }