public void SubscriptionStateVisitor_ArgumentChecking() { Assert.ThrowsException <ArgumentNullException>(() => new SubscriptionStateVisitor(null)); var s = new SingleAssignmentSubscription(); Assert.ThrowsException <ArgumentNullException>(() => new SubscriptionStateVisitor(s).LoadState(null)); Assert.ThrowsException <ArgumentNullException>(() => new SubscriptionStateVisitor(s).SaveState(null)); }
protected override IEnumerable <ISubscription> OnSubscribe() { var sub = base.OnSubscribe(); // return a dummy subscription here, don't subscribe to the observable yet // we're not ready at the moment, we'll subscribe when we receive the OnStart notification subscription = new SingleAssignmentSubscription(); return(OnSubscribeCore(sub)); // NB: We don't want OnSubscribe itself to be a lazy iterator. }
protected override IEnumerable <ISubscription> OnSubscribe() { _firstSubscription = new SingleAssignmentSubscription(); var otherSubscription = new SingleAssignmentSubscription(); var firstObserver = new FirstObserver(this, _firstSubscription); _otherObserver = new OtherObserver(this, firstObserver, otherSubscription); _firstSubscription.Subscription = Params._source.Subscribe(firstObserver); otherSubscription.Subscription = Params._other.Take(1).Subscribe(_otherObserver); return(new[] { _firstSubscription, otherSubscription }); }
protected override ISubscription OnSubscribe() { _subscription = new SingleAssignmentSubscription(); return(_subscription); }