How to test View in MVP implemented by Moxy?
I want to slip her Presenter'a mock instead, but I can not figure out how to do it? In View, my Presenter is created using @InjectPresenter .
How to test View in MVP implemented by Moxy?
I want to slip her Presenter'a mock instead, but I can not figure out how to do it? In View, my Presenter is created using @InjectPresenter .
I must say that I am not an expert in Moxy. This answer is based on the source code of the library.
You can place a mock in the PresenterStore instead of the original object and then your mock will be inserted during the injection. You can get PresenterStore like this
PresenterStore presenterStore = MvpFacade.getInstance().getPresenterStore(); And then using the add method add your mock .
Source: https://ru.stackoverflow.com/questions/614480/
All Articles