Created
May 7, 2018 21:57
-
-
Save rozkminiacz/937c286be6aca8640841c39287a4fa02 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PromotionListViewRobot(presenter: PromotionListContract.Presenter) { | |
private val initSubject = BehaviorSubject.create<Any>() | |
private val renderedViewStates: MutableList<PromotionListContract.ViewState> = mutableListOf() | |
private val view: PromotionListContract.View = object : PromotionListContract.View { | |
override fun listInit(): Observable<Any> = initSubject | |
override fun render(viewState: PromotionListContract.ViewState) { | |
renderedViewStates.add(viewState) | |
} | |
} | |
init { | |
presenter.attachView(view) | |
} | |
fun start() { | |
initSubject.onNext(Any()) | |
} | |
fun checkStatesRendered(function: (List<PromotionListContract.ViewState>) -> Unit) { | |
function(renderedViewStates) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment