org.assertj.android.api.widget.AbstractCursorAdapterAssert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of assertj-android Show documentation
Show all versions of assertj-android Show documentation
A set of AssertJ assertion helpers geared toward testing Android.
The newest version!
// Copyright 2013 Square, Inc.
package org.assertj.android.api.widget;
import android.database.Cursor;
import android.widget.CursorAdapter;
import android.widget.Filter;
import static org.assertj.core.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;
}
}