Skip to content

Instantly share code, notes, and snippets.

@tonypiazza
Last active September 27, 2015 10:28
Show Gist options
  • Save tonypiazza/1255666 to your computer and use it in GitHub Desktop.
Save tonypiazza/1255666 to your computer and use it in GitHub Desktop.
Example usage of the org.junit.Ignore annotation
@Ignore @Test
public void canCreateIntegerPropertyAndValidate() {
Property prop =
new IntegerProperty("productRating", "Rating", false, 1, 10);
/***************************************************************
* The following assertions will fail if executed. Remove this *
* comment and the @Ignore annotation once refactoring of the *
* PropertyFactory is complete. *
***************************************************************/
assertFalse("Property value should be invalid", prop.isValid(0));
assertFalse("Property value should be invalid", prop.isValid(11));
assertTrue("Property value should be valid",
prop.isValid(1 + new Random().nextInt(10)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment