Example #1
0
        public void EventsAwaitedTriggered()
        {
            var evName  = "click";
            var element = document.QuerySelector("img");
            var ev      = document.CreateEvent("event");

            ev.Init(evName, true, true);
            var task = document.AwaitEvent(evName);

            Assert.IsFalse(task.IsCompleted);
            document.Dispatch(ev);
            Assert.IsTrue(task.IsCompleted);
            Assert.IsFalse(task.IsFaulted);
            Assert.AreEqual(evName, task.Result.Type);
        }