public void Should_provide_correct_hash_codes() { var partitioning1a = new Partitioning("partitioning1"); var partitioning1b = new Partitioning("partitioning1"); var partitioning2a = new Partitioning("partitioning2"); Assert.Equal(partitioning1a.GetHashCode(), partitioning1b.GetHashCode()); Assert.NotEqual(partitioning1a.GetHashCode(), partitioning2a.GetHashCode()); }
public void Should_make_correct_equal_comparisons() { var partitioning1_a = new Partitioning("partitioning1"); var partitioning1_b = new Partitioning("partitioning1"); var partitioning2 = new Partitioning("partitioning2"); Assert.Equal(partitioning1_a, partitioning1_b); Assert.Equal(partitioning1_a.GetHashCode(), partitioning1_b.GetHashCode()); Assert.True(partitioning1_a.Equals((object)partitioning1_b)); Assert.NotEqual(partitioning1_a, partitioning2); Assert.NotEqual(partitioning1_a.GetHashCode(), partitioning2.GetHashCode()); Assert.False(partitioning1_a.Equals((object)partitioning2)); }