val repository = UserRepository(dao, client)
fun testSearchUsers() { val expected = Array(10) { MockUser.newInstance(it) }.toList() client.fetchUsers().invoked.thenReturn(expected.toObservable()) val subscriber = TestSubscriver<User>() repository.searchUsers().subscribe(subscriber) with(subscriber){ assertNoErrors() onNextEvents.size.should be 1 assertCompleted() } }