Created
December 6, 2010 23:24
-
-
Save dbriones/731195 to your computer and use it in GitHub Desktop.
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
private Matcher<? super FavoritesTab> hasCount(final int i) { | |
final int[] result = new int[1]; | |
return new TypeSafeMatcher<FavoritesTab>() { | |
protected boolean matchesSafely(FavoritesTab favoritesTab) { | |
result[0] = favoritesTab.getCountDisplayedOnTab(); | |
return result[0] == i; | |
} | |
protected void describeMismatchSafely(FavoritesTab item, Description mismatchDescription) { | |
mismatchDescription.appendText("it contained " + i + " card(s)"); | |
} | |
public void describeTo(Description description) { | |
description.appendText("favorites tab to contain " + result[0] + " cards"); | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment