public void TestHashCodeOnEquivalentInstances() { StringSegment helloWorld1Segment = new StringSegment("hello world", 2, 7); StringSegment helloWorld2Segment = new StringSegment("hello world", 2, 7); Assert.AreEqual( helloWorld1Segment.GetHashCode(), helloWorld2Segment.GetHashCode() ); }
public void TestHashCodeOnDifferingInstances() { StringSegment helloWorldSegment = new StringSegment("hello world", 2, 7); StringSegment howAreYouSegment = new StringSegment("how are you", 1, 9); Assert.AreNotEqual( helloWorldSegment.GetHashCode(), howAreYouSegment.GetHashCode() ); }