예제 #1
0
        public void CompareTo_SameLineAndColumn_Equal()
        {
            // Arrange
            var x = new SourcePosition(1, 6);
            var y = new SourcePosition(1, 6);

            // Act
            var result = x.CompareTo(y);

            // Assert
            Assert.AreEqual(0, result);
        }
예제 #2
0
        public void CompareTo_SameLineSmallerColumn_ReturnSmaller()
        {
            // Arrange
            var x = new SourcePosition(1, 4);
            var y = new SourcePosition(1, 8);

            // Act
            var result = x.CompareTo(y);

            // Assert
            Assert.IsTrue(result < 0);
        }
예제 #3
0
        public void CompareTo_SmallerZeroBasedLineNumber_ReturnSmaller()
        {
            // Arrange
            var x = new SourcePosition(1, 4);
            var y = new SourcePosition(3, 8);

            // Act
            var result = x.CompareTo(y);

            // Assert
            Assert.IsTrue(result < 0);
        }
예제 #4
0
        public void CompareTo_SameLineSmallerColumn_ReturnSmaller()
        {
            // Arrange
            SourcePosition x = new SourcePosition(
                zeroBasedLineNumber: 1,
                zeroBasedColumnNumber: 4);
            SourcePosition y = new SourcePosition(
                zeroBasedLineNumber: 1,
                zeroBasedColumnNumber: 8);

            // Act
            int result = x.CompareTo(y);

            // Assert
            Assert.True(result < 0);
        }
예제 #5
0
        public void CompareTo_SameLineAndColumn_Equal()
        {
            // Arrange
            SourcePosition x = new SourcePosition(
                zeroBasedLineNumber: 1,
                zeroBasedColumnNumber: 6);
            SourcePosition y = new SourcePosition(
                zeroBasedLineNumber: 1,
                zeroBasedColumnNumber: 6);

            // Act
            int result = x.CompareTo(y);

            // Assert
            Assert.Equal(0, result);
        }
예제 #6
0
        public void CompareTo_LargerZeroBasedLineNumber_ReturnLarger()
        {
            // Arrange
            SourcePosition x = new SourcePosition(
                zeroBasedLineNumber: 2,
                zeroBasedColumnNumber: 4);
            SourcePosition y = new SourcePosition(
                zeroBasedLineNumber: 1,
                zeroBasedColumnNumber: 8);

            // Act
            int result = x.CompareTo(y);

            // Assert
            Assert.True(result > 0);
        }
예제 #7
0
        public void CompareTo_SameLineSmallerColumn_ReturnSmaller()
        {
            // Arrange
            SourcePosition x = new SourcePosition
            {
                ZeroBasedLineNumber   = 1,
                ZeroBasedColumnNumber = 4
            };
            SourcePosition y = new SourcePosition
            {
                ZeroBasedLineNumber   = 1,
                ZeroBasedColumnNumber = 8
            };

            // Act
            int result = x.CompareTo(y);

            // Assert
            Assert.IsTrue(result < 0);
        }
예제 #8
0
        public void CompareTo_SameLineAndColumn_Equal()
        {
            // Arrange
            SourcePosition x = new SourcePosition
            {
                ZeroBasedLineNumber   = 1,
                ZeroBasedColumnNumber = 6
            };
            SourcePosition y = new SourcePosition
            {
                ZeroBasedLineNumber   = 1,
                ZeroBasedColumnNumber = 6
            };

            // Act
            int result = x.CompareTo(y);

            // Assert
            Assert.AreEqual(0, result);
        }
예제 #9
0
        public void CompareTo_LargerZeroBasedLineNumber_ReturnLarger()
        {
            // Arrange
            SourcePosition x = new SourcePosition
            {
                ZeroBasedLineNumber   = 2,
                ZeroBasedColumnNumber = 4
            };
            SourcePosition y = new SourcePosition
            {
                ZeroBasedLineNumber   = 1,
                ZeroBasedColumnNumber = 8
            };

            // Act
            int result = x.CompareTo(y);

            // Assert
            Assert.IsTrue(result > 0);
        }