org.fest.assertions.api.android.view.accessibility.AccessibilityManagerAssert 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.view.accessibility;
import android.view.accessibility.AccessibilityManager;
import org.fest.assertions.api.AbstractAssert;
import static org.fest.assertions.api.Assertions.assertThat;
/** Assertions for {@link AccessibilityManager} instances. */
public class AccessibilityManagerAssert
extends AbstractAssert {
public AccessibilityManagerAssert(AccessibilityManager actual) {
super(actual, AccessibilityManagerAssert.class);
}
public AccessibilityManagerAssert isEnabled() {
isNotNull();
assertThat(actual.isEnabled()) //
.overridingErrorMessage("Expected to be enabled but was disabled.") //
.isTrue();
return this;
}
public AccessibilityManagerAssert isDisabled() {
isNotNull();
assertThat(actual.isEnabled()) //
.overridingErrorMessage("Expected to be disabled but was enabled.") //
.isFalse();
return this;
}
public AccessibilityManagerAssert isTouchExplorationEnabled() {
isNotNull();
assertThat(actual.isTouchExplorationEnabled()) //
.overridingErrorMessage("Expected touch exploration to be enabled but was disabled.") //
.isTrue();
return this;
}
public AccessibilityManagerAssert isTouchExplorationDisabled() {
isNotNull();
assertThat(actual.isTouchExplorationEnabled()) //
.overridingErrorMessage("Expected touch exploration to be disabled but was enabled.") //
.isFalse();
return this;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy