Using Kotlin For Tests in Android
Sergii Zhuk
828

Using kotlin make the tests more readable using functions and https://github.com/paslavsky/mockito-kt like:

Kotlin:

verify(mockedView) {
times(0).startLoginView()
times(0).close()
times(1).initViews(user)
times(1).showItem(initialItem)
times(1).updateTitleWithItem(initialItem)
}

Java:

verify(mockedView).startLoginView()
verify(mockedView, times(0).close()
verify(mockedView).initViews(user)
verify(mockedView).showItem(initialItem)
verify(mockedView).updateTitleWithItem(initialItem)