Example #1
0
 public override void EndElement(XElement element)
 {
     Debug.WriteLine($"</{element.Value}>");
     conv.EndElement(xpath, element);
     xpath.Pop();
     conventionStack.Pop();
     moduleStack.Pop();
     conv = moduleStack.Current;
 }
Example #2
0
        public void TestPop()
        {
            CMLModuleStack stack  = new CMLModuleStack();
            ICMLModule     first  = new CMLCoreModule((IChemFile)null);
            ICMLModule     second = new CMLCoreModule((IChemFile)null);
            ICMLModule     third  = new CMLCoreModule((IChemFile)null);

            stack.Push(first);
            stack.Push(second);
            stack.Push(third);
            Assert.AreEqual(third, stack.Pop());
            Assert.AreEqual(second, stack.Pop());
            Assert.AreEqual(first, stack.Pop());
            try
            {
                Assert.AreEqual("doesNotExist", stack.Pop());
                Assert.Fail("Should have received an ArrayIndexOutOfBoundsException");
            }
            catch (Exception)
            {
                // OK, should happen
            }
        }