Пример #1
0
        public void TextHelperTest_IsNewLineBeforePositionTest()
        {
            ITextProvider tp = new TextStream("01\n34\r678\r\nBC");

            tp.IsNewLineBeforePosition(0).Should().BeFalse();
            tp.IsNewLineBeforePosition(1).Should().BeFalse();
            tp.IsNewLineBeforePosition(2).Should().BeFalse();
            tp.IsNewLineBeforePosition(3).Should().BeTrue();
            tp.IsNewLineBeforePosition(4).Should().BeFalse();
            tp.IsNewLineBeforePosition(5).Should().BeFalse();
            tp.IsNewLineBeforePosition(6).Should().BeTrue();
            tp.IsNewLineBeforePosition(7).Should().BeFalse();
            tp.IsNewLineBeforePosition(8).Should().BeFalse();
            tp.IsNewLineBeforePosition(9).Should().BeFalse();
            tp.IsNewLineBeforePosition(10).Should().BeTrue();
            tp.IsNewLineBeforePosition(11).Should().BeTrue();
            tp.IsNewLineBeforePosition(12).Should().BeFalse();
        }