public void ReadAndPeek() { StringScanner scanner = new StringScanner(Text); int i=0; while (!scanner.AtEnd) { Assert.Less(i, Text.Length); Assert.AreEqual(Text[i], scanner.Peek()); scanner.Read(); ++i; } Assert.AreEqual(Text.Length, i); }
public void Offset_NotIncrementedAfterPeek() { StringScanner scanner = new StringScanner(Text); scanner.Peek(); Assert.AreEqual(0, scanner.Offset); }
public void Peek_AtEnd_NullChar() { StringScanner scanner = new StringScanner(Text); scanner.Seek(Text.Length); Assert.IsTrue(scanner.AtEnd); Assert.AreEqual('\0', scanner.Peek()); }