public void AsyncCommandSmokeTest() { var sched = new TestScheduler(); IObservable<int> async_data; ReactiveAsyncCommand fixture; using (TestUtils.WithTestScheduler(sched)) { fixture = new ReactiveAsyncCommand(null, 1); async_data = fixture .Delay(TimeSpan.FromSeconds(5), RxApp.TaskpoolScheduler) .Select(_ => 5) .Do(_ => fixture.AsyncCompletedNotification.OnNext(new Unit())); } var inflight_results = new List<int>(); fixture.ItemsInflight.Subscribe(inflight_results.Add); var output = new List<int>(); async_data.Subscribe(output.Add); Assert.IsTrue(fixture.CanExecute(null)); fixture.Execute(null); sched.RunToMilliseconds(1005); Assert.IsFalse(fixture.CanExecute(null)); sched.RunToMilliseconds(5005); Assert.IsTrue(fixture.CanExecute(null)); new[] {0,1,0}.AssertAreEqual(inflight_results); new[] {5}.AssertAreEqual(output); }