Пример #1
0
            public void Should_create_a_hot_observable()
            {
                var expected  = new Queue <char>(new[] { 'A', 'B' });
                var scheduler = new MarbleTestScheduler();
                var source    = scheduler.CreateHotObservable <char>("--a---b--|", new { a = 'A', b = 'B' });

                source.Subscribe(x => { Assert.That(x, Is.EqualTo(expected.Dequeue())); });
                scheduler.Flush();
                Assert.That(expected.Count, Is.Zero);
            }
Пример #2
0
            public void Should_accept_an_unsubscription_marble_diagram()
            {
                var source      = _scheduler.CreateHotObservable <char>("---^-a-b-|");
                var unsubscribe = "---!";
                var expected    = "--a";

                _scheduler.ExpectObservable(source, unsubscribe).ToBe(expected);
            }