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