示例#1
0
        public void CanReadWhile_AutomaticlyMakesAnInitialReadOnStart()
        {
            var input = new StringReader("123bcdef");
            var reader = new InputReader(input);
            Assert.True(reader.ReadNextLine());

            Assert.AreEqual("123", reader.ReadWhile(Char.IsNumber));
            Assert.AreEqual(3, reader.Index);
        }
示例#2
0
        public void CanReadWhile()
        {
            var input = new StringReader("a123bcdef");
            var reader = new InputReader(input);
            Assert.True(reader.ReadNextLine());

            Assert.True(reader.Read());
            Assert.True(reader.Read());
            Assert.AreEqual("123",reader.ReadWhile(Char.IsNumber));
            Assert.AreEqual(4,reader.Index);
        }