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

org.fest.assertions.api.android.view.ActionProviderAssert Maven / Gradle / Ivy

There is a newer version: 1.0.8
Show newest version
package org.fest.assertions.api.android.view;

import android.view.ActionProvider;
import org.fest.assertions.api.AbstractAssert;

import static org.fest.assertions.api.Assertions.assertThat;

/** Assertions for {@link ActionProvider} instances. */
public class ActionProviderAssert extends AbstractAssert {
  public ActionProviderAssert(ActionProvider actual) {
    super(actual, ActionProviderAssert.class);
  }

  public ActionProviderAssert hasSubMenu() {
    isNotNull();
    assertThat(actual.hasSubMenu()) //
        .overridingErrorMessage("Expected sub-menu but was not present") //
        .isTrue();
    return this;
  }

  public ActionProviderAssert hasNoSubMenu() {
    isNotNull();
    assertThat(actual.hasSubMenu()) //
        .overridingErrorMessage("Expected no sub-menu but was not present") //
        .isFalse();
    return this;
  }

  public ActionProviderAssert isVisible() {
    isNotNull();
    assertThat(actual.isVisible()) //
        .overridingErrorMessage("Expected visible but was not visible") //
        .isTrue();
    return this;
  }

  public ActionProviderAssert isNotVisible() {
    isNotNull();
    assertThat(actual.isVisible()) //
        .overridingErrorMessage("Expected not visible but was visible") //
        .isFalse();
    return this;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy