Something went wrong. Try again.
A fork of Simple Time Tracker with WearOS support. (Now integrated upstream)
Something went wrong. Try again.
SimpleTimeTracker-WearOS app src androidTest java com example util simpletimetracker utils Assertions.kt
123456789101112131415package com.example.util.simpletimetracker.utils
import androidx.recyclerview.widget.RecyclerViewimport androidx.test.espresso.ViewAssertionimport androidx.test.espresso.matcher.ViewMatchers.assertThatimport org.hamcrest.CoreMatchers.`is`
fun recyclerItemCount(expectedCount: Int) = ViewAssertion { view, noViewFoundException -> if (noViewFoundException != null) { throw noViewFoundException } val itemCount = (view as RecyclerView).adapter!!.itemCount assertThat(itemCount, `is`(expectedCount)) }