public void Different_relations_should_not_have_equal_hash_code() { // Given var first = new HttpLinkRelation("alternate"); var second = new HttpLinkRelation(new Uri("http://nancyfx.org/rels/"), "home"); var third = new HttpLinkRelation("http://nancyfx.org/rels/nancy"); // When var firstHashCode = first.GetHashCode(); var secondHashCode = second.GetHashCode(); var thirdHashCode = third.GetHashCode(); // Then firstHashCode.ShouldNotEqual(secondHashCode); secondHashCode.ShouldNotEqual(thirdHashCode); }
public void Different_relations_should_not_have_equal_hash_code() { // Given var first = new HttpLinkRelation("alternate"); var second = new HttpLinkRelation(new Uri("http://nancyfx.org/rels/"), "home"); var third = new HttpLinkRelation("http://nancyfx.org/rels/nancy"); // When var firstHashCode = first.GetHashCode(); var secondHashCode = second.GetHashCode(); var thirdHashCode = third.GetHashCode(); // Then firstHashCode.ShouldNotEqual(secondHashCode); secondHashCode.ShouldNotEqual(thirdHashCode); }
public void Iana_relations_with_different_casing_and_prefix_should_have_equal_hash_code() { // Given var first = new HttpLinkRelation("AlterNate"); var second = new HttpLinkRelation("ALTERNATE"); var third = new HttpLinkRelation("alternate"); var fourth = new HttpLinkRelation(HttpLinkRelation.IanaLinkRelationPrefix + "alternate"); // When var firstHashCode = first.GetHashCode(); var secondHashCode = second.GetHashCode(); var thirdHashCode = third.GetHashCode(); var fourthHashCode = fourth.GetHashCode(); // Then firstHashCode.ShouldEqual(secondHashCode); secondHashCode.ShouldEqual(thirdHashCode); thirdHashCode.ShouldEqual(fourthHashCode); }
public void Iana_relations_with_different_casing_and_prefix_should_have_equal_hash_code() { // Given var first = new HttpLinkRelation("AlterNate"); var second = new HttpLinkRelation("ALTERNATE"); var third = new HttpLinkRelation("alternate"); var fourth = new HttpLinkRelation(HttpLinkRelation.IanaLinkRelationPrefix + "alternate"); // When var firstHashCode = first.GetHashCode(); var secondHashCode = second.GetHashCode(); var thirdHashCode = third.GetHashCode(); var fourthHashCode = fourth.GetHashCode(); // Then firstHashCode.ShouldEqual(secondHashCode); secondHashCode.ShouldEqual(thirdHashCode); thirdHashCode.ShouldEqual(fourthHashCode); }