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

org.assertj.android.api.widget.AbstractCompoundButtonAssert Maven / Gradle / Ivy

There is a newer version: 1.2.0
Show newest version
// Copyright 2012 Square, Inc.
package org.assertj.android.api.widget;

import android.widget.CompoundButton;

import static org.assertj.core.api.Assertions.assertThat;

public abstract class AbstractCompoundButtonAssert, A extends CompoundButton>
    extends AbstractTextViewAssert {
  public AbstractCompoundButtonAssert(A actual, Class selfType) {
    super(actual, selfType);
  }

  public S isChecked() {
    isNotNull();
    assertThat(actual.isChecked()) //
        .overridingErrorMessage("Expected checked but was not checked.") //
        .isTrue();
    return myself;
  }

  public S isNotChecked() {
    isNotNull();
    assertThat(actual.isChecked()) //
        .overridingErrorMessage("Expected not checked but was checked.") //
        .isFalse();
    return myself;
  }
}