org.assertj.android.design.api.widget.TextInputLayoutAssert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of assertj-android-design Show documentation
Show all versions of assertj-android-design Show documentation
A set of AssertJ assertion helpers geared toward testing Android.
The newest version!
package org.assertj.android.design.api.widget;
import android.support.design.widget.TextInputLayout;
import org.assertj.android.api.widget.AbstractLinearLayoutAssert;
import static org.assertj.core.api.Assertions.assertThat;
/** Assertions for {@link TextInputLayout} instances. */
public class TextInputLayoutAssert extends AbstractLinearLayoutAssert {
public TextInputLayoutAssert(TextInputLayout actual) {
super(actual, TextInputLayoutAssert.class);
}
public TextInputLayoutAssert hasError(CharSequence error) {
isNotNull();
CharSequence actualError = actual.getError();
assertThat(actualError) //
.overridingErrorMessage("Expected error '<%s>' but was '<%s>'.", error, actualError) //
.isEqualTo(error);
return this;
}
}