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

org.assertj.android.api.app.DialogFragmentAssert Maven / Gradle / Ivy

The newest version!
package org.assertj.android.api.app;

import android.annotation.TargetApi;
import android.app.DialogFragment;

import static android.os.Build.VERSION_CODES.HONEYCOMB;
import static org.assertj.core.api.Assertions.assertThat;

/** Assertions for {@link DialogFragment} instances. */
@TargetApi(HONEYCOMB)
public class DialogFragmentAssert
    extends AbstractFragmentAssert {
  public DialogFragmentAssert(DialogFragment actual) {
    super(actual, DialogFragmentAssert.class);
  }

  public DialogFragmentAssert isCancelable() {
    isNotNull();
    assertThat(actual.isCancelable()) //
        .overridingErrorMessage("Expected to be cancelable but was not cancelable.") //
        .isTrue();
    return this;
  }

  public DialogFragmentAssert isNotCancelable() {
    isNotNull();
    assertThat(actual.isCancelable()) //
        .overridingErrorMessage("Expected to be not cancelable but was cancelable.") //
        .isFalse();
    return this;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy