Skip to content

Instantly share code, notes, and snippets.

@GLitchfield
Created January 23, 2014 16:40
Show Gist options
  • Save GLitchfield/8581956 to your computer and use it in GitHub Desktop.
Save GLitchfield/8581956 to your computer and use it in GitHub Desktop.
public static final ValueFactory vals = new ValueFactoryImpl();
@Test
public void testPriceText() {
Price p1 = vals.newPrice(-5, -1);
Price p2 = vals.newPrice(-5, 0);
Price p3 = vals.newPrice(5, -1);
Price p4 = vals.newPrice(5, 0);
Fraction f = vals.newFraction(10, -1);
assertTrue(priceText(p1, f).equals("-0.5"));
assertTrue(priceText(p2, f).equals("-5.0"));
assertTrue(priceText(p3, f).equals("0.5"));
assertTrue(priceText(p4, f).equals("5.0"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment