CursorMatchers.CursorMatcher

public static class CursorMatchers.CursorMatcher
extends BoundedMatcher<ObjectCursor>

java.lang.Object
   ↳ org.hamcrest.BaseMatcher<java.lang.Object>
     ↳ androidx.test.espresso.matcher.BoundedMatcher<java.lang.Objectandroid.database.Cursor>
       ↳ androidx.test.espresso.matcher.CursorMatchers.CursorMatcher


A Matcher that matches Cursors based on values in their columns.

Summary

Public methods

void describeTo(Description description)
boolean matchesSafely(Cursor cursor)
CursorMatchers.CursorMatcher withStrictColumnChecks(boolean checkColumns)

Allows test authors to override whether the the matcher should throw an IllegalArgumentException if the column name/count is not valid.

Inherited methods

Public methods

describeTo

public void describeTo (Description description)

Parameters
description Description

matchesSafely

public boolean matchesSafely (Cursor cursor)

Parameters
cursor Cursor

Returns
boolean

withStrictColumnChecks

public CursorMatchers.CursorMatcher withStrictColumnChecks (boolean checkColumns)

Allows test authors to override whether the the matcher should throw an IllegalArgumentException if the column name/count is not valid. This is useful in the case where a cursor may iterates over a data set with variable columns. By default, the checks are off.

Parameters
checkColumns boolean

Returns
CursorMatchers.CursorMatcher