public void NoSpecifiedDelegates() { var testObservable = new OnDemandObservable <int>(); var observer = new DelegateObserver <int>(); testObservable.Subscribe(observer); testObservable.OnNext(1); testObservable.OnError(new ArgumentException()); testObservable.OnCompleted(); }
public void SpecifyFull() { int t = 0; bool completed = false; Exception ee = null; var testObservable = new OnDemandObservable <int>(); var observer = new DelegateObserver <int>(i => t = i, exception => ee = exception, () => completed = true); testObservable.Subscribe(observer); testObservable.OnNext(1); t.Is(1); testObservable.OnError(new Exception()); ee.IsNotNull(); testObservable.OnCompleted(); completed.IsTrue(); }