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

org.fest.assertions.api.android.widget.CheckedTextViewAssert Maven / Gradle / Ivy

There is a newer version: 1.0.8
Show newest version
// 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;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy