Esempio n. 1
0
        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());
        }
Esempio n. 2
0
        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());
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 bool IEventTarget.DispatchEvent(IEvent eventObject)
 {
     return(_eventTarget.DispatchEvent(eventObject));
 }
Esempio n. 5
0
 bool IEventTarget.DispatchEvent(
     IEvent @event)
 {
     return(eventTarget.DispatchEvent(@event));
 }
Esempio n. 6
0
 bool IEventTarget.DispatchEvent(IEvent eventArgs)
 {
     return(_eventTarget.DispatchEvent(eventArgs));
 }
Esempio n. 7
0
 bool IEventTarget.DispatchEvent(IEvent evt)
 {
     return(eventTarget.DispatchEvent(evt));
 }