org.assertj.android.api.preference.EditTextPreferenceAssert 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.
// Copyright 2013 Square, Inc.
package org.assertj.android.api.preference;
import android.preference.EditTextPreference;
import static org.assertj.core.api.Assertions.assertThat;
/** Assertions for {@link EditTextPreference} instances. */
public class EditTextPreferenceAssert
extends AbstractDialogPreferenceAssert {
public EditTextPreferenceAssert(EditTextPreference actual) {
super(actual, EditTextPreferenceAssert.class);
}
public EditTextPreferenceAssert hasText(String text) {
isNotNull();
String actualText = actual.getText();
assertThat(actualText) //
.overridingErrorMessage("Expected text <%s> but was <%s>.", text, actualText) //
.isEqualTo(text);
return this;
}
}