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

org.fest.assertions.api.android.preference.PreferenceActivityAssert Maven / Gradle / Ivy

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

import android.preference.PreferenceActivity;
import org.fest.assertions.api.android.app.AbstractListActivityAssert;

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

/** Assertions for {@link PreferenceActivity} instances. */
public class PreferenceActivityAssert
    extends AbstractListActivityAssert {
  public PreferenceActivityAssert(PreferenceActivity actual) {
    super(actual, PreferenceActivityAssert.class);
  }

  public PreferenceActivityAssert hasHeaders() {
    isNotNull();
    assertThat(actual.hasHeaders()) //
        .overridingErrorMessage("Expected to have headers but did not.") //
        .isTrue();
    return this;
  }

  public PreferenceActivityAssert hasNoHeaders() {
    isNotNull();
    assertThat(actual.hasHeaders()) //
        .overridingErrorMessage("Expected to not have headers but did.") //
        .isFalse();
    return this;
  }

  public PreferenceActivityAssert isMultiPane() {
    isNotNull();
    assertThat(actual.isMultiPane()) //
        .overridingErrorMessage("Expected to be multi-pane but was not.") //
        .isTrue();
    return this;
  }

  public PreferenceActivityAssert isNotMultiPane() {
    isNotNull();
    assertThat(actual.isMultiPane()) //
        .overridingErrorMessage("Expected to not be multi-pane but was.") //
        .isFalse();
    return this;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy