org.fest.assertions.api.android.widget.TabWidgetAssert 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.TabWidget;
import static org.fest.assertions.api.Assertions.assertThat;
/** Assertions for {@link TabWidget} instances. */
public class TabWidgetAssert extends AbstractLinearLayoutAssert {
public TabWidgetAssert(TabWidget actual) {
super(actual, TabWidgetAssert.class);
}
public TabWidgetAssert hasTabCount(int count) {
isNotNull();
int actualCount = actual.getTabCount();
assertThat(actualCount) //
.overridingErrorMessage("Expected tab count <%s> but was <%s>.", count, actualCount) //
.isEqualTo(count);
return this;
}
public TabWidgetAssert isStripEnabled() {
isNotNull();
assertThat(actual.isStripEnabled()) //
.overridingErrorMessage("Expected strip to be enabled but was disabled.") //
.isTrue();
return this;
}
public TabWidgetAssert isStripDisabled() {
isNotNull();
assertThat(actual.isStripEnabled()) //
.overridingErrorMessage("Expected strip to be disabled but was enabled.") //
.isFalse();
return this;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy