示例#1
0
        public virtual void AddFirst()
        {
            TokenQueue tq = new TokenQueue("One Two");

            tq.ConsumeWord();
            tq.AddFirst("Three");
            NUnit.Framework.Assert.AreEqual("Three Two", tq.Remainder());
        }
示例#2
0
        public virtual void ChompBalanced()
        {
            TokenQueue tq        = new TokenQueue(":contains(one (two) three) four");
            String     pre       = tq.ConsumeTo("(");
            String     guts      = tq.ChompBalanced('(', ')');
            String     remainder = tq.Remainder();

            NUnit.Framework.Assert.AreEqual(":contains", pre);
            NUnit.Framework.Assert.AreEqual("one (two) three", guts);
            NUnit.Framework.Assert.AreEqual(" four", remainder);
        }