org.fest.assertions.api.android.content.AbstractLoaderAssert 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.
package org.fest.assertions.api.android.content;
import android.content.Loader;
import org.fest.assertions.api.AbstractAssert;
import static org.fest.assertions.api.Assertions.assertThat;
public abstract class AbstractLoaderAssert, A extends Loader>
extends AbstractAssert {
protected AbstractLoaderAssert(A actual, Class selfType) {
super(actual, selfType);
}
public S hasId(int id) {
isNotNull();
int actualId = actual.getId();
assertThat(actualId) //
.overridingErrorMessage("Expected ID <%s> but was <%s>.", id, actualId) //
.isEqualTo(id);
return myself;
}
public S isAbandoned() {
isNotNull();
assertThat(actual.isAbandoned()) //
.overridingErrorMessage("Expected to be abandoned but was not abandoned.") //
.isTrue();
return myself;
}
public S isNotAbandoned() {
isNotNull();
assertThat(actual.isAbandoned()) //
.overridingErrorMessage("Expected to not be abandoned but was abandoned.") //
.isFalse();
return myself;
}
public S isReset() {
isNotNull();
assertThat(actual.isReset()) //
.overridingErrorMessage("Expected to be reset but was not reset.") //
.isTrue();
return myself;
}
public S isNotReset() {
isNotNull();
assertThat(actual.isReset()) //
.overridingErrorMessage("Expected to not be reset but was reset.") //
.isFalse();
return myself;
}
public S isStarted() {
isNotNull();
assertThat(actual.isStarted()) //
.overridingErrorMessage("Expected to be started but was not started.") //
.isTrue();
return myself;
}
public S isNotStarted() {
isNotNull();
assertThat(actual.isStarted()) //
.overridingErrorMessage("Expected to not be started but was started.") //
.isFalse();
return myself;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy