예제 #1
0
        public void ComparisonMembers_NotEquals()
        {
            var position  = new SequencePosition(null, 2);
            var position2 = new SequencePosition(2, 2);

            Assert.False(position.Equals(position2));
            Assert.False(position.Equals((object)position2));
            Assert.NotEqual(position.GetHashCode(), position2.GetHashCode());
        }
예제 #2
0
        public void ComparisonMembers_IntSegment()
        {
            var position  = new SequencePosition(2, 2);
            var position2 = new SequencePosition(2, 2);

            Assert.True(position.Equals(position2));
            Assert.True(position.Equals((object)position2));
            Assert.Equal(position.GetHashCode(), position2.GetHashCode());
        }
예제 #3
0
        public void ComparisonMembers_NotNullSegment()
        {
            var segment   = new object();
            var position  = new SequencePosition(segment, 2);
            var position2 = new SequencePosition(segment, 2);

            Assert.True(position == position2);
            Assert.True(position.Equals(position2));
            Assert.True(position.Equals((object)position2));
            Assert.False(position != position2);
            Assert.Equal(position.GetHashCode(), position2.GetHashCode());
        }