public void BacktrackAfterEnding()
 {
     BufferedCharReader reader = new BufferedCharReader(new StringReader(";"));
     Assert.IsTrue(reader.More());
     Assert.AreEqual(';', reader.Next());
     Assert.IsFalse(reader.More());
     reader.Back();
     Assert.IsTrue(reader.More());
     Assert.AreEqual(';', reader.Next());
     Assert.IsFalse(reader.More());
 }
        public void BacktrackAfterEnding()
        {
            BufferedCharReader reader = new BufferedCharReader(new StringReader(";"));

            Assert.IsTrue(reader.More());
            Assert.AreEqual(';', reader.Next());
            Assert.IsFalse(reader.More());
            reader.Back();
            Assert.IsTrue(reader.More());
            Assert.AreEqual(';', reader.Next());
            Assert.IsFalse(reader.More());
        }
 public void CountersUnaffectedWhenReadingPastEOF()
 {
     BufferedCharReader reader = new BufferedCharReader(new StringReader("abc"));
     Assert.AreEqual('a', reader.Next());
     Assert.AreEqual('b', reader.Next());
     Assert.AreEqual('c', reader.Next());
     Assert.IsFalse(reader.More());
     Assert.AreEqual(0, reader.Next());
     Assert.AreEqual(3, reader.CharCount, "CharCount");
     Assert.AreEqual(1, reader.LineNumber, "LineNumber");
     Assert.AreEqual(3, reader.LinePosition, "LinePosition");
 }
        public void CountersUnaffectedWhenReadingPastEOF()
        {
            BufferedCharReader reader = new BufferedCharReader(new StringReader("abc"));

            Assert.AreEqual('a', reader.Next());
            Assert.AreEqual('b', reader.Next());
            Assert.AreEqual('c', reader.Next());
            Assert.IsFalse(reader.More());
            Assert.AreEqual(0, reader.Next());
            Assert.AreEqual(3, reader.CharCount, "CharCount");
            Assert.AreEqual(1, reader.LineNumber, "LineNumber");
            Assert.AreEqual(3, reader.LinePosition, "LinePosition");
        }