
org.fest.assertions.api.android.widget.AbstractCursorAdapterAssert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fest-android Show documentation
Show all versions of fest-android Show documentation
A set of FEST assertion helpers geared toward testing Android.
The newest version!
// Copyright 2013 Square, Inc.
package org.fest.assertions.api.android.widget;
import android.database.Cursor;
import android.widget.CursorAdapter;
import android.widget.Filter;
import static org.fest.assertions.api.Assertions.assertThat;
public abstract class AbstractCursorAdapterAssert, A extends CursorAdapter>
extends AbstractListAdapterAssert {
protected AbstractCursorAdapterAssert(A actual, Class selfType) {
super(actual, selfType);
}
public S hasCursor(Cursor cursor) {
isNotNull();
Cursor actualCursor = actual.getCursor();
assertThat(actualCursor) //
.overridingErrorMessage("Expected cursor <%s> but was <%s>.", cursor, actualCursor) //
.isSameAs(cursor);
return myself;
}
public S hasFilter(Filter filter) {
isNotNull();
Filter actualFilter = actual.getFilter();
assertThat(actualFilter) //
.overridingErrorMessage("Expected filter <%s> but was <%s>.", filter, actualFilter) //
.isSameAs(filter);
return myself;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy