Esempio n. 1
0
 public void Peek_NullReader_ReturnsNullChar()
 {
     using (var scanner = new TextReaderStream(TextReader.Null))
     {
         Assert.Equal('\0', scanner.Peek());
     }
 }
Esempio n. 2
0
        public void Peek_LongString_ReturnsSameAsPop()
        {
            const string input = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

            using (var scanner = new TextReaderStream(new StringReader(input)))
            {
                while (!scanner.IsCompleted)
                {
                    char ch = scanner.Peek();
                    Assert.Equal(scanner.Pop(), ch);
                }

                Assert.Equal(true, scanner.IsCompleted);
            }
        }