Esempio n. 1
0
        public void GetResult_Context()
        {
            var x = new AsyncSubject <int>();

            var ctx = new MyContext();
            var e   = new ManualResetEvent(false);

            new Thread(() =>
            {
                SynchronizationContext.SetSynchronizationContext(ctx);

                var a = x.GetAwaiter();
                a.OnCompleted(() =>
                {
                    e.Set();
                });
            }).Start();

            x.OnNext(42);
            x.OnCompleted();

            e.WaitOne();

            Assert.IsTrue(ctx.ran);
        }
Esempio n. 2
0
        public void GetResult_Context()
        {
            var x = new AsyncSubject<int>();

            var ctx = new MyContext();
            var e = new ManualResetEvent(false);

            new Thread(() =>
            {
                SynchronizationContext.SetSynchronizationContext(ctx);

                var a = x.GetAwaiter();
                a.OnCompleted(() =>
                {
                    e.Set();
                });
            }).Start();

            x.OnNext(42);
            x.OnCompleted();

            e.WaitOne();

            Assert.IsTrue(ctx.ran);
        }
Esempio n. 3
0
 public void Await_Throw()
 {
     var s = new AsyncSubject<int>();
     GetResult_Blocking_Throw(s.GetAwaiter());
 }
Esempio n. 4
0
        public void Await_Throw()
        {
            var s = new AsyncSubject <int>();

            GetResult_Blocking_Throw(s.GetAwaiter());
        }
Esempio n. 5
0
 public UniRx.Runtime.CompilerServices.AsyncSubjectAwaiter <object> GetAwaiter() => _t.GetAwaiter();