public void RoundTripImmutableTypeViaFields() { using (var ms = new MemoryStream()) { var val = new MyValueTypeViaFields(123, 456); Serializer.Serialize(ms, val); ms.Position = 0; var clone = Serializer.Deserialize <MyValueTypeViaFields>(ms); Assert.AreEqual(123, clone.X); Assert.AreEqual(456, clone.Z); } }
public void RoundTripImmutableTypeViaFields() { using (var ms = new MemoryStream()) { var val = new MyValueTypeViaFields(123, 456); Serializer.Serialize(ms, val); ms.Position = 0; var clone = Serializer.Deserialize<MyValueTypeViaFields>(ms); Assert.AreEqual(123, clone.X); Assert.AreEqual(456, clone.Z); } }
public bool Equals(MyValueTypeViaFields other) { return(X == other.X && Z == other.Z); }
public bool Equals(MyValueTypeViaFields other) { return X == other.X && Z == other.Z; }