Example #1
0
        public void CreateSubParser()
        {
            var f = new GenericParserFactory <Parser>("filename", new StringReader("abc"));
            var p = f.CreateSubParser("bc", new CharacterPosition(1, 2));

            Assert.IsNotNull(p);
            Assert.IsInstanceOfType(p, typeof(Parser));
            var r = p.Read(2);

            Assert.AreEqual("bc", r);
        }
Example #2
0
        public void CreateParser()
        {
            var f = new GenericParserFactory <Parser>("filename", new StringReader("abc"));
            var p = f.CreateDefaultParser();

            Assert.IsNotNull(p);
            Assert.IsInstanceOfType(p, typeof(Parser));
            var r = p.Read(3);

            Assert.AreEqual("abc", r);
        }