Ahhhhhh, I get what you are asking now. Asserting on data and asserting on views require slightly different APIs. In order to assert on data, you use the plain old assertEquals()
or assertTrue()
or any of the other basic JUnit assertions. In order to assert on view, you use the Espresso APIs.
So in this situation, inside the scenario.onFragment {...}
lambda expression, you would make an assertion on fragment.crime.solvedStatus
, while outside the lambda expression you would make an assertion on onView(withId(R.id.crime_solved_checkbox))
.
I hope this helps out.