Back to project page DisposableIncome-OldJava.
The source code is released under:
MIT License
If you think the Android project DisposableIncome-OldJava listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package uk.co.wilka.disposableincome.test; /*from w w w . j a v a2s . c om*/ import junit.framework.TestCase; import uk.co.wilka.disposableincome.Cash; public class CashTest extends TestCase { public void test_fromPence_GivesCorrectPoundsValue() { Cash c = Cash.fromPence(100); assertEquals(1, c.getPounds()); } public void test_fromPounds_GivesCorrectPenceValue() { Cash c = Cash.fromPounds(10); assertEquals(1000, c.getPence()); } public void test_10pencePlus5pence_Gives15pence() { Cash c1 = Cash.fromPence(10); Cash c2 = Cash.fromPence(5); assertEquals(15, c1.plus(c2).getPence()); } public void test_2poundsPlus5pounds_Gives7pounds() { Cash c1 = Cash.fromPounds(2); Cash c2 = Cash.fromPounds(5); assertEquals(7, c1.plus(c2).getPounds()); } public void test_10poundsMinus3pounds_Gives6pounds() { Cash c1 = Cash.fromPounds(10); Cash c2 = Cash.fromPounds(3); assertEquals(7, c1.minus(c2).getPounds()); } }