public void PeekWithoutLookahead() { StringReader reader = new StringReader("Test"); ScanningTextReader scanningReader = new ScanningTextReader(reader); Assert.AreEqual('T', scanningReader.Peek()); Assert.AreEqual('T', scanningReader.Read()); Assert.AreEqual('e', scanningReader.Peek()); }
public void PeekWithLookahead() { StringReader reader = new StringReader("Test"); ScanningTextReader scanningReader = new ScanningTextReader(reader); Assert.AreEqual('T', scanningReader.LookAhead(0)); Assert.AreEqual('s', scanningReader.LookAhead(2)); Assert.AreEqual('T', scanningReader.Peek()); Assert.AreEqual('T', scanningReader.Read()); Assert.AreEqual('e', scanningReader.Read()); Assert.AreEqual('s', scanningReader.LookAhead(0)); Assert.AreEqual('s', scanningReader.Peek()); Assert.AreEqual("st", scanningReader.ReadToEnd()); }
public void PeekWithLookahead() { StringReader reader = new StringReader("Test"); ScanningTextReader scanningReader = new ScanningTextReader(reader); Assert.AreEqual('T', scanningReader.LookAhead(0)); Assert.AreEqual('s', scanningReader.LookAhead(2)); Assert.AreEqual('T', scanningReader.Peek()); Assert.AreEqual('T', scanningReader.Read()); Assert.AreEqual('e', scanningReader.Read()); Assert.AreEqual('s', scanningReader.LookAhead(0)); Assert.AreEqual('s', scanningReader.Peek()); Assert.AreEqual("st", scanningReader.ReadToEnd()); }
public void PeekWithoutLookahead() { StringReader reader = new StringReader("Test"); ScanningTextReader scanningReader = new ScanningTextReader(reader); Assert.AreEqual('T', scanningReader.Peek()); Assert.AreEqual('T', scanningReader.Read()); Assert.AreEqual('e', scanningReader.Peek()); }