C H A P T E R 9

Testing With Rx

Rx itself is a powerful framework for testing. In this chapter, we'll see how easy it is to replace async methods with stubs and mocks that return predefined values. We can even make these canned values wait for a proscribed period of time before returning, making it far easier to test asynchronous processes.

We can even make stubs return with an error. This makes it easier for us to get code coverage over the error case.

Later in the chapter, we'll see how we can simulate the passing of time via TestScheduler, meaning that even though our tests appear to take time, they will run instantly and deterministically.

Get Programming Reactive Extensions and LINQ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.