org.fest.assertions.api.android.os.PowerManagerAssert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fest-android Show documentation
Show all versions of fest-android Show documentation
A set of FEST assertion helpers geared toward testing Android.
// Copyright 2013 Square, Inc.
package org.fest.assertions.api.android.os;
import android.os.PowerManager;
import org.fest.assertions.api.Assertions;
import org.fest.assertions.api.AbstractAssert;
/** Assertions for {@link PowerManager} instances. */
public class PowerManagerAssert extends AbstractAssert {
public PowerManagerAssert(PowerManager actual) {
super(actual, PowerManagerAssert.class);
}
public PowerManagerAssert isScreenOn() {
isNotNull();
Assertions.assertThat(actual.isScreenOn()) //
.overridingErrorMessage("Expected screen to be on but was off.") //
.isTrue();
return this;
}
public PowerManagerAssert isScreenOff() {
isNotNull();
Assertions.assertThat(actual.isScreenOn()) //
.overridingErrorMessage("Expected screen to be off but was on.") //
.isFalse();
return this;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy