public void NullEventHandlerValue() { EventValues eventValues = new EventValues(); eventValues.AddAll(null); Assert.AreEqual(0, eventValues.Events.Count); }
public void OneEventValue() { EventValues eventValues = new EventValues(); eventValues.AddHandler(new MyEventHandler()); Assert.AreEqual(1, eventValues.Events.Count); }
public void CopyEventHandlerValues() { EventValues eventValues = new EventValues(); eventValues.AddHandler(new MyEventHandler()); eventValues.AddHandler(new MyEventHandler()); Assert.AreEqual(1, eventValues.Events.Count); EventValues eventValues2 = new EventValues(eventValues); Assert.AreEqual(1, eventValues2.Events.Count); }
/// <summary> /// Copy all given argument values into this object. /// </summary> /// <param name="other"> /// The <see cref="Oragon.Spring.Objects.Factory.Config.EventValues"/> /// to be used to populate this instance. /// </param> public void AddAll(EventValues other) { if (other != null) { foreach (IList handlers in other.EventHandlers.Values) { foreach (IEventHandlerValue handler in handlers) { AddHandler(handler); } } } }
public void EmptyEventValues() { EventValues eventValues = new EventValues(); Assert.AreEqual(0, eventValues.Events.Count); }
/// <summary> /// Creates a new instance of the /// <see cref="Oragon.Spring.Objects.Factory.Config.EventValues"/> class. /// </summary> /// <param name="other"> /// The <see cref="Oragon.Spring.Objects.Factory.Config.EventValues"/> /// to be used to populate this instance. /// </param> public EventValues(EventValues other) { AddAll(other); }