org.fest.assertions.api.android.view.AbstractViewGroupMarginLayoutParamsAssert 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.
package org.fest.assertions.api.android.view;
import android.view.ViewGroup;
import static org.fest.assertions.api.Assertions.assertThat;
public abstract class AbstractViewGroupMarginLayoutParamsAssert, A extends ViewGroup.MarginLayoutParams>
extends AbstractViewGroupLayoutParamsAssert {
protected AbstractViewGroupMarginLayoutParamsAssert(A actual, Class selfType) {
super(actual, selfType);
}
public S hasBottomMargin(int margin) {
isNotNull();
int actualMargin = actual.bottomMargin;
assertThat(actualMargin) //
.overridingErrorMessage("Expected bottom margin <%s> but was <%s>", margin, actualMargin) //
.isEqualTo(margin);
return myself;
}
public S hasLeftMargin(int margin) {
isNotNull();
int actualMargin = actual.leftMargin;
assertThat(actualMargin) //
.overridingErrorMessage("Expected left margin <%s> but was <%s>", margin, actualMargin) //
.isEqualTo(margin);
return myself;
}
public S hasRightMargin(int margin) {
isNotNull();
int actualMargin = actual.rightMargin;
assertThat(actualMargin) //
.overridingErrorMessage("Expected right margin <%s> but was <%s>", margin, actualMargin) //
.isEqualTo(margin);
return myself;
}
public S hasTopMargin(int margin) {
isNotNull();
int actualMargin = actual.topMargin;
assertThat(actualMargin) //
.overridingErrorMessage("Expected top margin <%s> but was <%s>", margin, actualMargin) //
.isEqualTo(margin);
return myself;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy