Example #1
0
        public void TestHotObservable()
        {
            TestScheduler scheduler = new TestScheduler();

            var xs = scheduler.CreateHotObservable (
                scheduler.OnNextAt(100, "a"), // only works in Visual Studio
                scheduler.OnNextAt(200, "b"),
                scheduler.OnCompletedAt<string>(300)
            );

            var observer = scheduler.CreateObserver<string>();
            scheduler.Schedule(TimeSpan.FromTicks(220),
                (sched, state) => xs.Subscribe(observer));

            scheduler.Start();

            observer.Messages.AssertEqual (
                new Recorded<Notification<string>>(250, Notification.CreateOnCompleted<string>())
            );
        }