示例#1
0
        public void EqualsDifferentInOnlyTimeShouldReturnTrue()
        {
            DynamicObjectInformation test0 = new DynamicObjectInformation(new Vector2(), new Vector2(), 0);
            DynamicObjectInformation test1 = new DynamicObjectInformation(new Vector2(), new Vector2(), 1);

            Assert.That(test0.Equals(test1));
        }
示例#2
0
        public void EqualsACopyShouldReturnTrue()
        {
            DynamicObjectInformation test0 = new DynamicObjectInformation(new Vector2(), new Vector2(), 0);
            DynamicObjectInformation test1 = new DynamicObjectInformation(new Vector2(), new Vector2(), 0);

            Assert.That(test0.Equals(test1));
        }
示例#3
0
        public void EqualsEntirelyDifferentShouldReturnFalse()
        {
            DynamicObjectInformation test0 = new DynamicObjectInformation(new Vector2(0, 0), new Vector2(1, 1), 0);
            DynamicObjectInformation test1 = new DynamicObjectInformation(new Vector2(1, 1), new Vector2(0, 0), 0);

            Assert.That(!test0.Equals(test1));
        }
示例#4
0
        public void DeserializeTestCaseShouldReturnExpected()
        {
            List <byte> data = data1();
            DynamicObjectInformation info         = serializer.Deserialize(data);
            DynamicObjectInformation expectedInfo = PlayerInformation1();

            Assert.That(info.Equals(expectedInfo));
        }
示例#5
0
        public void SerializeTestCaseShouldReturnExpected()
        {
            DynamicObjectInformation info = PlayerInformation2();
            List <byte> data         = serializer.Serialize(info);
            List <byte> expectedData = data2();

            for (int i = 0; i < data.Count; i++)
            {
                Assert.AreEqual(data [i], expectedData [i]);
            }
        }
示例#6
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));
        }
 protected override void SetState(DynamicObjectInformation state)
 {
     this.state = state;
 }
示例#8
0
        public void EqualsItselfShouldReturnTrue()
        {
            DynamicObjectInformation test = new DynamicObjectInformation(new Vector2(), new Vector2(), 0);

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

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