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

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

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

import android.widget.CompoundButton;

import static org.fest.assertions.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;
  }
}