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

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

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

import android.view.ViewTreeObserver;
import org.fest.assertions.api.Assertions;
import org.fest.assertions.api.AbstractAssert;

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

  public ViewTreeObserverAssert isAlive() {
    isNotNull();
    Assertions.assertThat(actual.isAlive()) //
        .overridingErrorMessage("Expected to be alive but was not alive.") //
        .isTrue();
    return this;
  }

  public ViewTreeObserverAssert isNotAlive() {
    isNotNull();
    Assertions.assertThat(actual.isAlive()) //
        .overridingErrorMessage("Expected to not be alive but was alive.") //
        .isFalse();
    return this;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy