org.fest.assertions.api.android.preference.AbstractPreferenceGroupAssert 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.preference;
import android.preference.PreferenceGroup;
import static org.fest.assertions.api.Assertions.assertThat;
public abstract class AbstractPreferenceGroupAssert, A extends PreferenceGroup>
extends AbstractPreferenceAssert {
protected AbstractPreferenceGroupAssert(A actual, Class selfType) {
super(actual, selfType);
}
public S hasPreferenceCount(int count) {
isNotNull();
int actualCount = actual.getPreferenceCount();
assertThat(actualCount) //
.overridingErrorMessage("Expected preference count <%s> but was <%s>.", count,
actualCount) //
.isEqualTo(count);
return myself;
}
public S isOrderingAsAdded() {
isNotNull();
assertThat(actual.isOrderingAsAdded()) //
.overridingErrorMessage("Expected to be ordering as added but was not.") //
.isTrue();
return myself;
}
public S isNotOrderingAsAdded() {
isNotNull();
assertThat(actual.isOrderingAsAdded()) //
.overridingErrorMessage("Expected to not be ordering as added but was.") //
.isFalse();
return myself;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy