Exemplo n.º 1
0
        public void TestUnexpectedException()
        {
            var service = new NaiveAsyncService();
            var task    = service.DoLongRunningTask().Promise().Then(() => { throw new NotImplementedException(); });

            Assert(!task.Check());

            service.Resolve();
            Assert(task.Check());
        }
Exemplo n.º 2
0
        public void TestHandleNaiveTask()
        {
            var resolved = false;
            var service  = new NaiveAsyncService();
            var task     = service.DoLongRunningTask().Promise().Then(() => { resolved = true; });

            Assert(!task.Check());

            service.Resolve();
            Assert(task.Check());
            Assert(resolved);
        }