public void RootEvent() { var doc = new HtmlDocument(); var evt = doc.CreateEvent("Event"); evt.InitEvent("click", true, true); _root.DispatchEvent(evt); _handlers.Verify(x => x.OnRootBubble(evt), Times.Once()); _handlers.Verify(x => x.OnRootCapture(evt), Times.Once()); }
public void UnbubblableEvent() { var doc = new HtmlDocument(); var evt = doc.CreateEvent("Event"); evt.InitEvent("click", false, false); _child.DispatchEvent(evt); _handlers.Verify(x => x.OnChildBubble(evt), Times.Once()); _handlers.Verify(x => x.OnParentBubble(evt), Times.Never()); _handlers.Verify(x => x.OnRootBubble(evt), Times.Never()); }
public void CreateEventTest() { var @event = new Event <IBuildEvent>(); var assertEvent = default(Event <IBuildEvent>); var count = 0; EventTarget.AddEventListener <IBuildEvent>(e => { assertEvent = e; count++; }); EventTarget.AddEventListener <IBuildEvent>(e => { assertEvent = e; count++; }); EventTarget.DispatchEvent(@event); assertEvent.Should().NotBeNull(); assertEvent.Type.Should().Be <IBuildEvent>(); count.Should().BeGreaterOrEqualTo(2); }
bool IEventTarget.DispatchEvent(IEvent eventObject) { return(_eventTarget.DispatchEvent(eventObject)); }
bool IEventTarget.DispatchEvent( IEvent @event) { return(eventTarget.DispatchEvent(@event)); }
bool IEventTarget.DispatchEvent(IEvent eventArgs) { return(_eventTarget.DispatchEvent(eventArgs)); }
bool IEventTarget.DispatchEvent(IEvent evt) { return(eventTarget.DispatchEvent(evt)); }