Example #1
0
        public void AddAndRemoveEventListenersXElementAddRemoveEventListeners()
        {
            XDocument    xDoc      = new XDocument(InputSpace.GetElement(10, 10));
            EventsHelper docHelper = new EventsHelper(xDoc);
            EventsHelper eHelper   = new EventsHelper(xDoc.Root);

            xDoc.Root.Add(new XElement("Add", "Me"));
            docHelper.Verify(XObjectChange.Add);
            eHelper.Verify(XObjectChange.Add);
            eHelper.RemoveListeners();
            xDoc.Root.Add(new XComment("Comment"));
            eHelper.Verify(0);
            docHelper.Verify(XObjectChange.Add);
        }