Exemple #1
0
        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();
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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();
        }
Exemple #4
0
        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();
        }
Exemple #5
0
        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);
        }