https://kotlinlang.org logo
#android
Title
# android
j

Joan Colmenero

07/04/2019, 1:44 PM
Let me know if someone that is used to unit testing can help me out I wrote it down on #mockk, but couldn't get an answer, it's about how to test an MVP app using usecase repository and presenter, or at least which methods do I have to test, thanks 😄
u

540grunkspin

07/11/2019, 2:54 PM
Do you have an example of a presenter. Maybe we can go thought it and see which ones you should/shouldn’t test
When it comes to android testing in general I think that the most important think you can do for your testing is to not use anything android related in your presenters. Everything that might need a Context should be abstracted behind an interface that is injected in to the presenter
Also private methods should not be tested directly but rather covered by the test that runs for the public methods.
j

Joan Colmenero

07/11/2019, 4:48 PM
Yes, @540grunkspin. You're right, I'm not using anything related with Android on my presenter though.
u

540grunkspin

07/11/2019, 5:14 PM
In that case pretty much all public methods on your presenters should be unit tested. An preferably all your repos should be integration tested imo
j

Joan Colmenero

07/11/2019, 6:03 PM
Yes.
l

Lou Morda

08/13/2019, 4:58 PM
android blueprint v2?