Created
August 16, 2017 02:34
-
-
Save thiagoolsilva/a1b58d5b9e8272897e42756030f62324 to your computer and use it in GitHub Desktop.
Creating a custom matcher to be used on espresso
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Matcher<View> withDummyStatus(final LoginButton.DummyStatus expectedStatus) { | |
return new BoundedMatcher<View, LoginButton>(LoginButton.class) { | |
@Override | |
public void describeTo(Description description) { | |
description.appendText("Checking the matcher on received view: "); | |
description.appendText("with expectedStatus=" + expectedStatus.toString()); | |
} | |
@Override | |
protected boolean matchesSafely(LoginButton foundView) { | |
return foundView.getDummyLoginStatus() == expectedStatus; | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment