org.fest.assertions.api.android.gesture.GestureLibraryAssert 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.gesture;
import android.gesture.GestureLibrary;
import org.fest.assertions.api.AbstractAssert;
import static org.fest.assertions.api.Assertions.assertThat;
/** Assertions for {@link GestureLibrary} instances. */
public class GestureLibraryAssert extends AbstractAssert {
public GestureLibraryAssert(GestureLibrary actual) {
super(actual, GestureLibraryAssert.class);
}
public GestureLibraryAssert hasOrientationStyle(int style) {
isNotNull();
int actualStyle = actual.getOrientationStyle();
assertThat(actualStyle) //
.overridingErrorMessage("Expected orientation style <%s> but was <%s>.", style,
actualStyle) //
.isEqualTo(style);
return this;
}
public GestureLibraryAssert hasSequenceType(int type) {
isNotNull();
int actualType = actual.getSequenceType();
assertThat(actualType) //
.overridingErrorMessage("Expected sequence type <%s> but was <%s>.", type, actualType) //
.isEqualTo(type);
return this;
}
public GestureLibraryAssert isReadOnly() {
isNotNull();
assertThat(actual.isReadOnly()) //
.overridingErrorMessage("Expected to be read only but was not.") //
.isTrue();
return this;
}
public GestureLibraryAssert isNotReadOnly() {
isNotNull();
assertThat(actual.isReadOnly()) //
.overridingErrorMessage("Expected to not be read only but was not.") //
.isFalse();
return this;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy