Esempio n. 1
0
        public void CharAtCorrectlyReturnsLocation()
        {
            var buffer = new LineTrackingStringBuffer("foo\rbar\nbaz\r\nbiz", "test.cshtml");
            var chr    = buffer.CharAt(14);

            Assert.Equal('i', chr.Character);
            Assert.Equal(new SourceLocation("test.cshtml", 14, 3, 1), chr.Location);
        }
Esempio n. 2
0
        public SeekableTextReader(char[] source, string filePath)
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            _buffer = new LineTrackingStringBuffer(source, filePath);
            UpdateState();
        }
Esempio n. 3
0
        public void CtorInitializesProperties()
        {
            var buffer = new LineTrackingStringBuffer(string.Empty, "test.cshtml");

            Assert.Equal(0, buffer.Length);
        }