public void TestEquals_Nullable() { NullableStruct f1 = new NullableStruct { f = 5 }; NullableStruct f2 = new NullableStruct { f = 5 }; Assert.IsTrue(f1.Equals(f2)); f1 = new NullableStruct { f = null }; f2 = new NullableStruct { f = null }; Assert.IsTrue(f1.Equals(f2)); f1 = new NullableStruct { f = 1 }; f2 = new NullableStruct { f = 2 }; Assert.IsFalse(f1.Equals(f2)); f1 = new NullableStruct { f = 1 }; f2 = new NullableStruct { f = null }; Assert.IsFalse(f1.Equals(f2)); }
public void TestEquals_Nullable () { NullableStruct f1 = new NullableStruct { f = 5 }; NullableStruct f2 = new NullableStruct { f = 5 }; Assert.IsTrue (f1.Equals (f2)); f1 = new NullableStruct { f = null }; f2 = new NullableStruct { f = null }; Assert.IsTrue (f1.Equals (f2)); f1 = new NullableStruct { f = 1 }; f2 = new NullableStruct { f = 2 }; Assert.IsFalse (f1.Equals (f2)); f1 = new NullableStruct { f = 1 }; f2 = new NullableStruct { f = null }; Assert.IsFalse (f1.Equals (f2)); }