public static void AreDifferentWhenSecondItemIsDifferent() { var left = new Target { _field = "test", Property1 = new ReferenceStruct { Property1 = 5, Property2 = "test" }, }; var right = new Target { _field = "test", Property1 = new ReferenceStruct { Property1 = 5, Property2 = "Test" }, }; Assert.NotEqual(left, right); Assert.NotEqual(left.GetHashCode(), right.GetHashCode()); }
public static void AreEqualWhenAllPropertiesAreEqual() { var left = new Target { _field = "test", Property1 = new ReferenceStruct { Property1 = 5, Property2 = "test" }, }; var right = new Target { _field = "test", Property1 = new ReferenceStruct { Property1 = 5, Property2 = "test" }, }; Assert.Equal(left, right); Assert.Equal(left.GetHashCode(), right.GetHashCode()); }