Created
January 26, 2018 13:17
-
-
Save maiatoday/cfdcf730b78cb3a7ccff38a0018cab63 to your computer and use it in GitHub Desktop.
starcountCustomMatcher
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
fun hasStarCount(i: Int): Matcher<ContrivedParams> { | |
return object : TypeSafeMatcher<ContrivedParams>() { | |
override fun describeTo(description: Description) { | |
description.appendText("starCount should return ").appendValue(i) | |
} | |
override fun describeMismatchSafely(item: ContrivedParams, mismatchDescription: Description) { | |
mismatchDescription.appendText(" was ").appendValue(item.starCount) | |
} | |
override fun matchesSafely(item: ContrivedParams): Boolean { | |
return i == item.starCount | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment