org.assertj.android.api.view.ViewTreeObserverAssert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of assertj-android Show documentation
Show all versions of assertj-android Show documentation
A set of AssertJ assertion helpers geared toward testing Android.
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;
}
}