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)); }
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)); }
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)); }
public void DeserializeTestCaseShouldReturnExpected() { List <byte> data = data1(); DynamicObjectInformation info = serializer.Deserialize(data); DynamicObjectInformation expectedInfo = PlayerInformation1(); Assert.That(info.Equals(expectedInfo)); }
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]); } }
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; }
public void EqualsItselfShouldReturnTrue() { DynamicObjectInformation test = new DynamicObjectInformation(new Vector2(), new Vector2(), 0); Assert.That(test.Equals(test)); }
public void EqualsNullShouldReturnFalse() { DynamicObjectInformation test = new DynamicObjectInformation(new Vector2(), new Vector2(), 0); Assert.That(!test.Equals(null)); }