org.fest.assertions.api.android.widget.SimpleCursorAdapterAssert 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.
// Copyright 2013 Square, Inc.
package org.fest.assertions.api.android.widget;
import android.widget.SimpleCursorAdapter;
import static android.widget.SimpleCursorAdapter.CursorToStringConverter;
import static android.widget.SimpleCursorAdapter.ViewBinder;
import static org.fest.assertions.api.Assertions.assertThat;
/** Assertions for {@link SimpleCursorAdapter} instances. */
public class SimpleCursorAdapterAssert
extends AbstractCursorAdapterAssert {
public SimpleCursorAdapterAssert(SimpleCursorAdapter actual) {
super(actual, SimpleCursorAdapterAssert.class);
}
public SimpleCursorAdapterAssert hasCursorToStringConverter(CursorToStringConverter converter) {
isNotNull();
CursorToStringConverter actualConverter = actual.getCursorToStringConverter();
assertThat(actualConverter) //
.overridingErrorMessage("Expected cursor 'toString' converter <%s> but was <%s>.",
converter, actualConverter) //
.isSameAs(converter);
return this;
}
public SimpleCursorAdapterAssert hasStringConversionColumn(int column) {
isNotNull();
int actualColumn = actual.getStringConversionColumn();
assertThat(actualColumn) //
.overridingErrorMessage("Expected string conversion column <%s> but was <%s>.", column,
actualColumn) //
.isEqualTo(column);
return this;
}
public SimpleCursorAdapterAssert hasViewBinder(ViewBinder binder) {
isNotNull();
ViewBinder actualBinder = actual.getViewBinder();
assertThat(actualBinder) //
.overridingErrorMessage("Expected view binder <%s> but was <%s>.", binder, actualBinder) //
.isSameAs(binder);
return this;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy