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); }
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); }
public void Await_Throw() { var s = new AsyncSubject<int>(); GetResult_Blocking_Throw(s.GetAwaiter()); }
public void Await_Throw() { var s = new AsyncSubject <int>(); GetResult_Blocking_Throw(s.GetAwaiter()); }
public UniRx.Runtime.CompilerServices.AsyncSubjectAwaiter <object> GetAwaiter() => _t.GetAwaiter();