예제 #1
0
        public void Should_make_correct_object_equal_comparisons()
        {
            object partitioning1a = new Partitioning("partitioning1");
            object partitioning1b = new Partitioning("partitioning1");
            object partitioning2a = new Partitioning("partitioning2");

            Assert.True(partitioning1a.Equals(partitioning1b));

            Assert.False(partitioning1a.Equals(partitioning2a));
        }
예제 #2
0
        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));
        }