org.fest.assertions.api.android.widget.SlidingDrawerAssert 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.view.View;
import android.widget.SlidingDrawer;
import org.fest.assertions.api.android.view.AbstractViewGroupAssert;
import static org.fest.assertions.api.Assertions.assertThat;
/** Assertions for {@link SlidingDrawer} instances. */
public class SlidingDrawerAssert
extends AbstractViewGroupAssert {
public SlidingDrawerAssert(SlidingDrawer actual) {
super(actual, SlidingDrawerAssert.class);
}
public SlidingDrawerAssert hasContent(View view) {
isNotNull();
View actualView = actual.getContent();
assertThat(actualView) //
.overridingErrorMessage("Expected content <%s> but was <%s>.", view, actualView) //
.isSameAs(view);
return this;
}
public SlidingDrawerAssert hasHandle(View view) {
isNotNull();
View actualView = actual.getHandle();
assertThat(actualView) //
.overridingErrorMessage("Expected handle <%s> but was <%s>.", view, actualView) //
.isSameAs(view);
return this;
}
public SlidingDrawerAssert isMoving() {
isNotNull();
assertThat(actual.isMoving()) //
.overridingErrorMessage("Expected to be moving but was not.") //
.isTrue();
return this;
}
public SlidingDrawerAssert isNotMoving() {
isNotNull();
assertThat(actual.isMoving()) //
.overridingErrorMessage("Expected to not be moving but was.") //
.isFalse();
return this;
}
public SlidingDrawerAssert isOpened() {
isNotNull();
assertThat(actual.isMoving()) //
.overridingErrorMessage("Expected to be opened but was closed.") //
.isTrue();
return this;
}
public SlidingDrawerAssert isClosed() {
isNotNull();
assertThat(actual.isMoving()) //
.overridingErrorMessage("Expected to be closed but was open.") //
.isFalse();
return this;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy