Ejemplo n.º 1
0
 public void Changed(object sender, XObjectChangeEventArgs e)
 {
     TestLog.Compare(_pending.Sender, sender, "Mismatch in changed and changing events");
     TestLog.Compare(_pending.EventArgs, e, "Mismatch in changed and changing events");
     _events.Enqueue(_pending);
     _pending = null;
 }
Ejemplo n.º 2
0
        // Different events for different objects
        public void Verify(XObjectChange[] expectedEvents, XObject[] expectedObjects)
        {
            TestLog.Compare(_events.Count, expectedEvents.Length, "Mismatch in expected number of events");
            int i = 0;

            while (_events.Count > 0)
            {
                EventItem item = _events.Dequeue();
                TestLog.Compare(item.EventArgs.ObjectChange, expectedEvents[i], "Event Type Mismatch");
                if (item.Sender is XAttribute)
                {
                    TestLog.Compare(_attributeComparer.Equals((XAttribute)item.Sender, (XAttribute)expectedObjects[i]), "Attribute Mismatch");
                }
                else
                {
                    TestLog.Compare(_nodeComparer.Equals((XNode)item.Sender, expectedObjects[i]), "Node Mismatch");
                }
                i++;
            }
        }
Ejemplo n.º 3
0
 public void Changing(object sender, XObjectChangeEventArgs e)
 {
     if (_pending != null)
         throw new NotImplementedException();
     _pending = new EventItem((XObject)sender, e);
 }