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

org.assertj.android.api.view.ViewTreeObserverAssert Maven / Gradle / Ivy

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

import android.view.ViewTreeObserver;
import org.assertj.core.api.Assertions;
import org.assertj.core.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