1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/task4/solution02/test/org/apidesign/apifest08/test/MoneyTest.java Sat Oct 11 23:38:46 2008 +0200
1.3 @@ -0,0 +1,24 @@
1.4 +package org.apidesign.apifest08.test;
1.5 +
1.6 +import static junit.framework.Assert.assertEquals;
1.7 +import static org.apidesign.apifest08.test.Task1Test.CZK;
1.8 +
1.9 +import java.math.BigDecimal;
1.10 +
1.11 +import org.apidesign.apifest08.currency.MoneyImpl;
1.12 +import org.junit.Test;
1.13 +
1.14 +public class MoneyTest {
1.15 + @Test(expected=NullPointerException.class)
1.16 + public void testNullAmount(){
1.17 + new MoneyImpl(null,CZK);
1.18 + }
1.19 + @Test(expected=NullPointerException.class)
1.20 + public void testNullCurrency(){
1.21 + new MoneyImpl(1,null);
1.22 + }
1.23 + @Test
1.24 + public void testOk(){
1.25 + assertEquals(0,new MoneyImpl(123,CZK).getAmount().compareTo(new BigDecimal("123")));
1.26 + }
1.27 +}