public void Complex_scenario_3(BufferSubject <string> sut, IObserver <string> observer, Generator <string> generator) { sut.OnNext(generator); sut.OnNext(generator); sut.OnNext(generator); var subscription = sut.Subscribe(observer); sut.OnNext(generator); sut.OnNext(generator); sut.OnNext(generator); subscription.Dispose(); sut.OnNext(generator); sut.OnNext(generator); sut.OnNext(generator); sut.Subscribe(observer); sut.OnNext(generator); sut.OnCompleted(); observer.ReceivedItems(10); observer.IsCompleted(); }
public void Late_subscriber_gets_all_items(BufferSubject <string> sut, IObserver <string> observer, Generator <string> generator) { sut.OnNext(generator); sut.OnNext(generator); sut.OnNext(generator); sut.Subscribe(observer); observer.ReceivedItems(3); }
public void Complex_scenario_1(BufferSubject <string> sut, IObserver <string> first, IObserver <string> second, Generator <string> generator) { sut.OnNext(generator); sut.Subscribe(first); sut.OnNext(generator); sut.OnCompleted(); sut.Subscribe(second); first.ReceivedItems(2); first.IsCompleted(); second.ReceivedNoItem(); second.IsCompleted(); }
public void Second_late_subscriber_with_early_first_subscriber_gets_no_item(BufferSubject <string> sut, IObserver <string> first, IObserver <string> second, Generator <string> generator) { sut.Subscribe(first); sut.OnNext(generator); sut.OnNext(generator); sut.OnNext(generator); sut.Subscribe(second); second.ReceivedNoItem(); }
public void Second_early_subscriber_gets_all_items(BufferSubject <string> sut, IObserver <string> first, IObserver <string> second, Generator <string> generator) { sut.Subscribe(first); sut.Subscribe(second); sut.OnNext(generator); sut.OnNext(generator); sut.OnNext(generator); second.ReceivedItems(3); }