How to assert that the Observable is not clicking on any element?

I would like to know how to unit test sequences like Observable.Never

.

How can I be sure that nothing will be carried over into the sequence?

+3


source to share


1 answer


You cannot be sure that nothing is ever pushed towards the observable because this is equivalent to solving the Stopping problem , which is not possible. That is: you want to know if your program will ever terminate (something is pressed) or will run forever (nothing is pushed).

The best you can do is check if no buttons are pressed during a custom timeout of your choice.



However, you don't need to test Observable.Never

anyway. If you have some specific real code with an observable that should never push any items - please show that in the question.

+5


source







All Articles