public static void AreEqualWhenAttributedPropertiesAreEqual() { var left = new Target { _field = "test", Property1 = 5, Property2 = 3.5, Property3 = true }; var right = new Target { _field = "test", Property1 = 5, Property2 = 3.5, Property3 = false }; Assert.Equal(left, right); Assert.Equal(left.GetHashCode(), right.GetHashCode()); }
public static void AreDifferentWhenOneAttributedPropertyIsDifferent() { var left = new Target { _field = "test", Property1 = 5, Property2 = 4.5, Property3 = true }; var right = new Target { _field = "test", Property1 = 5, Property2 = 3.5, Property3 = false }; Assert.NotEqual(left, right); Assert.NotEqual(left.GetHashCode(), right.GetHashCode()); }
public static void AreDifferentWhenTheFieldIsDifferentInCase() { var left = new Target { _field = "test", Property1 = 5, Property2 = 3.5, Property3 = false }; var right = new Target { _field = "Test", Property1 = 5, Property2 = 3.5, Property3 = false }; Assert.NotEqual(left, right); Assert.NotEqual(left.GetHashCode(), right.GetHashCode()); }