Skip to content

Instantly share code, notes, and snippets.

@MikeBild
Created October 24, 2012 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MikeBild/3947466 to your computer and use it in GitHub Desktop.
Save MikeBild/3947466 to your computer and use it in GitHub Desktop.
Simple Rx Testing without Mocks
var expected = new long[] {0, 1, 2, 3, 4};
var actual = new List<long>();
var scheduler = new TestScheduler();
var interval = Observable.Interval(TimeSpan.FromSeconds(1), scheduler).Take(5);
interval.Subscribe(actual.Add);
scheduler.Start();
CollectionAssert.AreEqual(expected, actual);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment