org.assertj.android.api.widget.AbstractRelativeLayoutAssert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of assertj-android Show documentation
Show all versions of assertj-android Show documentation
A set of AssertJ assertion helpers geared toward testing Android.
package org.assertj.android.api.widget;
import android.annotation.TargetApi;
import android.widget.RelativeLayout;
import org.assertj.android.api.view.AbstractViewGroupAssert;
import static android.os.Build.VERSION_CODES.JELLY_BEAN;
import static org.assertj.core.api.Assertions.assertThat;
public abstract class AbstractRelativeLayoutAssert, A extends RelativeLayout>
extends AbstractViewGroupAssert {
protected AbstractRelativeLayoutAssert(A actual, Class selfType) {
super(actual, selfType);
}
@TargetApi(JELLY_BEAN)
public S hasGravity(int gravity) {
isNotNull();
int actualGravity = actual.getGravity();
assertThat(actualGravity) //
.overridingErrorMessage("Expected gravity <%s> but was <%s>.", gravity, actualGravity) //
.isEqualTo(gravity);
return myself;
}
}