public static void AreEqualWhenAllPropertiesAreEqual() { var left = new Target { _field = "test", Property1 = new Tuple <int, string>(5, "test"), }; var right = new Target { _field = "test", Property1 = new Tuple <int, string>(5, "test"), }; Assert.AreEqual(left, right); Assert.AreEqual(left.GetHashCode(), right.GetHashCode()); }
public static void AreDifferentWhenSecondTupleItemIsDifferent() { var left = new Target { _field = "test", Property1 = new Tuple <int, string>(5, "test"), }; var right = new Target { _field = "test", Property1 = new Tuple <int, string>(5, "Test"), }; Assert.AreNotEqual(left, right); Assert.AreNotEqual(left.GetHashCode(), right.GetHashCode()); }
public static void ImplementsIEquatable() { var target = new Target(); Assert.IsTrue(target is IEquatable <Target>); }