Created
September 7, 2012 15:31
-
-
Save tfnico/3667190 to your computer and use it in GitHub Desktop.
Some guava tests
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
@Test | |
public void validName() { | |
String name = "Thomas"; | |
assertTrue(findInvalidChars(name, WhitelistCharacters.VALID_NAME_CHAR_SET).isEmpty()); | |
} | |
@Test | |
public void invalidName() { | |
assertThat(findInvalidChars("<Thomas>", VALID_NAME_CHAR_SET), hasItems('<', '>')); | |
} | |
@Test | |
public void prettyListOfInvalidChars() { | |
String name = "<Th0mas>"; | |
assertEquals("<, 0, >", WhitelistCharacters.printChars(findInvalidChars(name, VALID_NAME_CHAR_SET))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment