Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #4
0
        public void DeserializeTestCaseShouldReturnExpected()
        {
            List <byte> data = data1();
            DynamicObjectInformation info         = serializer.Deserialize(data);
            DynamicObjectInformation expectedInfo = PlayerInformation1();

            Assert.That(info.Equals(expectedInfo));
        }
Beispiel #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]);
            }
        }
Beispiel #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;
 }
Beispiel #8
0
        public void EqualsItselfShouldReturnTrue()
        {
            DynamicObjectInformation test = new DynamicObjectInformation(new Vector2(), new Vector2(), 0);

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

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