Пример #1
0
 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);
     }
 }
Пример #2
0
 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);
     }
 }
Пример #3
0
 public bool Equals(MyValueTypeViaFields other)
 {
     return(X == other.X && Z == other.Z);
 }
Пример #4
0
 public bool Equals(MyValueTypeViaFields other)
 {
     return X == other.X && Z == other.Z;
 }