public void compare_two_string_by_length_using_get_hash_code() { const string string1 = "lorem"; const string string2 = "ipsum"; var comparer = new PropertyComparer <string>(x => x.Length); Assert.Equal(comparer.GetHashCode(string1), comparer.GetHashCode(string2)); }
public void compare_two_string_by_length_using_get_hash_code() { const string string1 = "lorem"; const string string2 = "ipsum"; var comparer = new PropertyComparer<string>(x => x.Length); Assert.Equal(comparer.GetHashCode(string1), comparer.GetHashCode(string2)); }
public void TestHashCode() { var entity1 = new Comparable { Id = 1, Name = "Name", Description = "Description" }; var entity2 = new Comparable { Id = 1, Name = "Name", Description = "Description" }; var comparer = new PropertyComparer <Comparable>(); Assert.Equal(comparer.GetHashCode(entity1), comparer.GetHashCode(entity2)); }