예제 #1
0
        public void Equality()
        {
            var range = new MultiRange {
                1, 2, 10, 100
            };
            var equalRange = new MultiRange {
                1, 2, 10, 100
            };
            var differentRange = new MultiRange {
                1, 2, 11, 100
            };

            Assert.True(range.Equals(range));
            Assert.True(range.Equals(equalRange));
            Assert.True(!range.Equals(differentRange));
            Assert.True(!range.Equals(null));

            Assert.True(range.Equals((object)range));
            Assert.True(range.Equals((object)equalRange));
            Assert.True(!range.Equals((object)differentRange));
            Assert.True(!range.Equals((object)null));
        }