taskx/jtulach/against-solution14/test/apifest/CurrencyTest.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 25 Oct 2008 20:53:00 +0200
changeset 84 2ae6e4aa7aef
parent 14 d907b216f8a1
permissions -rw-r--r--
Solutions by Petr Smid
     1 package apifest;
     2 
     3 import junit.framework.TestCase;
     4 import org.apidesign.apifest08.currency.CurrencyRate;
     5 import org.apidesign.apifest08.currency.CurrencyRateFactory;
     6 
     7 
     8 /** Write a test that works with version from task A and fails with version B.
     9  */
    10 public class CurrencyTest extends TestCase {
    11     public CurrencyTest(String n) {
    12         super(n);
    13     }
    14     
    15     public void testCompatibility() throws Exception {
    16         CurrencyRate rate = CurrencyRateFactory.getInstance().createCurrencyRate("CZK", "USD", 1, 2);
    17         assertEquals("Implements one interface", 1, rate.getClass().getInterfaces().length);
    18     }
    19 }