org.fest.assertions.api.android.widget.CheckedTextViewAssert 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.
// Copyright 2013 Square, Inc.
package org.fest.assertions.api.android.widget;
import android.graphics.drawable.Drawable;
import android.widget.CheckedTextView;
import org.fest.assertions.api.Assertions;
import static org.fest.assertions.api.Assertions.assertThat;
public class CheckedTextViewAssert
extends AbstractTextViewAssert {
public CheckedTextViewAssert(CheckedTextView actual) {
super(actual, CheckedTextViewAssert.class);
}
public CheckedTextViewAssert hasCheckMarkDrawable(Drawable drawable) {
isNotNull();
Drawable actualDrawable = actual.getCheckMarkDrawable();
Assertions.assertThat(actualDrawable) //
.overridingErrorMessage("Expected check mark drawable <%s> but was <%s>.", drawable,
actualDrawable) //
.isSameAs(drawable);
return this;
}
public CheckedTextViewAssert isChecked() {
isNotNull();
assertThat(actual.isChecked()) //
.overridingErrorMessage("Expected checked but was not checked.") //
.isTrue();
return this;
}
public CheckedTextViewAssert isNotChecked() {
isNotNull();
assertThat(actual.isChecked()) //
.overridingErrorMessage("Expected not checked but was checked.") //
.isFalse();
return this;
}
}