All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.assertj.android.design.api.widget.TextInputLayoutAssert Maven / Gradle / Ivy

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;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy