android10 / Android-CleanArchitecture

This is a sample app that is part of a series of blog posts I have written about how to architect an android application using Uncle Bob's clean architecture approach.
Apache License 2.0
15.51k stars 3.32k forks source link

How to test presenter method? #289

Closed pro100svitlo closed 5 years ago

pro100svitlo commented 5 years ago

https://github.com/android10/Android-CleanArchitecture/blob/master/presentation/src/androidTest/java/com/fernandocejas/android10/sample/test/presenter/UserDetailsPresenterTest.java

Here, in your example above, you just show how we can test method before execute called. But how we can check whats happen after? How can we check if there was correct method called when use case return onError(for example)?

rajondj commented 5 years ago

Dutch bangla bank joypurhat bangladesh..MD.ASHIKUR RAHMAN KHAN

epetrenko commented 5 years ago

@pro100svitlo I think your question is related with another issue - #223.

Please, check this comment. I've shared a common solution which I usually use for testing observer methods within presenter.

pro100svitlo commented 5 years ago

@epetrenko awesome! thanks!

devendroid commented 4 years ago

@epetrenko Have you any idea about this issue #297 ? Please help...!