task1/solution02/test/org/apidesign/apifest08/test/MoneyTest.java
author japod@localhost
Sun, 28 Sep 2008 14:12:38 +0200
changeset 6 97662396c0fd
child 16 2864c6d744c0
permissions -rw-r--r--
Adding solutions received for task1
     1 package org.apidesign.apifest08.test;
     2 
     3 import static junit.framework.Assert.assertEquals;
     4 
     5 import java.math.BigDecimal;
     6 
     7 import org.apidesign.apifest08.currency.MoneyImpl;
     8 import org.junit.Test;
     9 import static org.apidesign.apifest08.test.Task1Test.*;
    10 
    11 public class MoneyTest {
    12 	@Test(expected=NullPointerException.class)
    13 	public void testNullAmount(){
    14 		new MoneyImpl(null,CZK);
    15 	}
    16 	@Test(expected=NullPointerException.class)
    17 	public void testNullCurrency(){
    18 		new MoneyImpl(1,null);
    19 	}
    20 	@Test
    21 	public void testOk(){
    22 		assertEquals(new BigDecimal("123.00"),new MoneyImpl(123,CZK).getAmount());
    23 	}
    24 }