P
P
Piotr2017-11-20 22:54:51
Unit testing
Piotr, 2017-11-20 22:54:51

How to write a test that checks the order of calling methods for such code (JUNIT+MOCKITO)?

Single.just(listOf(A(), A(), A()))
                            .subscribe({           
                                if (it.isEmpty()) {
                                    v.empty()
                                } else {
                                    v.display(it)
                                }
                            }, {
                                v.error()
                            })

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2017-11-21
@red-barbarian

? what to test. Calling methods v?
v = mock
inOrder = inOrder(v)
inOrder.verify(v).display(any)
inOrder.verify(v).display(any)
inOrder.verify(v).empty()
something like this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question