public void CanHashCodeTwoNullableDifferentTypeTriplets() { var triplet1 = new Triplet<string, int?, Type>("1", 2, typeof(Console)); var triplet2 = new Triplet<string, int?, Type>("1", 2, typeof(Console)); var triplet3 = new Triplet<string, int?, Type>("1", null, typeof(Console)); triplet2.GetHashCode().Should().Be(triplet1.GetHashCode()); triplet3.GetHashCode().Should().Not.Be(triplet1.GetHashCode()); }
public void CanHashCodeTwoNullableTriplets() { var pair1 = new Triplet<int?>(1, null, 42); var pair2 = new Triplet<int?>(1, null, 42); var pair3 = new Triplet<int?>(null, 2, null); pair2.GetHashCode().Should().Be(pair1.GetHashCode()); pair3.GetHashCode().Should().Not.Be(pair1.GetHashCode()); }
public override int GetHashCode() { return(triplet.GetHashCode()); }