author | Jaroslav Tulach <jtulach@netbeans.org> |
Sat, 25 Oct 2008 20:53:00 +0200 | |
changeset 84 | 2ae6e4aa7aef |
permissions | -rw-r--r-- |
jtulach@84 | 1 |
package apifest; |
jtulach@84 | 2 |
|
jtulach@84 | 3 |
import junit.framework.TestCase; |
jtulach@84 | 4 |
import org.apidesign.apifest08.currency.Convertor; |
jtulach@84 | 5 |
import org.apidesign.apifest08.currency.CurrencyValue; |
jtulach@84 | 6 |
//import static org.apidesign.apifest08.test.Currencies.CZK; |
jtulach@84 | 7 |
//import static org.apidesign.apifest08.test.Currencies.SKK; |
jtulach@84 | 8 |
//import static org.apidesign.apifest08.test.Currencies.USD; |
jtulach@84 | 9 |
|
jtulach@84 | 10 |
/** Write a test that works with version from task A and fails with version B. |
jtulach@84 | 11 |
*/ |
jtulach@84 | 12 |
public class CurrencyTest extends TestCase { |
jtulach@84 | 13 |
public CurrencyTest(String n) { |
jtulach@84 | 14 |
super(n); |
jtulach@84 | 15 |
} |
jtulach@84 | 16 |
|
jtulach@84 | 17 |
public void testCompatibility() throws Exception { |
jtulach@84 | 18 |
try { |
jtulach@84 | 19 |
Convertor c = Convertor.getConvertorIntegerString( |
jtulach@84 | 20 |
CurrencyValue.getCurrencyValue(1, "CZK"), |
jtulach@84 | 21 |
CurrencyValue.getCurrencyValue(1, "CZK") |
jtulach@84 | 22 |
); |
jtulach@84 | 23 |
c.convert("CZK", CurrencyValue.getCurrencyValue(10, "CZK")); |
jtulach@84 | 24 |
fail("Should throw exception"); |
jtulach@84 | 25 |
} catch (IllegalArgumentException e) { |
jtulach@84 | 26 |
//ok |
jtulach@84 | 27 |
} |
jtulach@84 | 28 |
} |
jtulach@84 | 29 |
} |