O'Reilly logo

Programming Reactive Extensions and LINQ by Paul Betts, Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required