jtulach@84: package apifest; jtulach@84: jtulach@84: import junit.framework.TestCase; jtulach@84: import org.apidesign.apifest08.currency.Convertor; jtulach@84: import org.apidesign.apifest08.currency.CurrencyValue; jtulach@84: //import static org.apidesign.apifest08.test.Currencies.CZK; jtulach@84: //import static org.apidesign.apifest08.test.Currencies.SKK; jtulach@84: //import static org.apidesign.apifest08.test.Currencies.USD; jtulach@84: jtulach@84: /** Write a test that works with version from task A and fails with version B. jtulach@84: */ jtulach@84: public class CurrencyTest extends TestCase { jtulach@84: public CurrencyTest(String n) { jtulach@84: super(n); jtulach@84: } jtulach@84: jtulach@84: public void testCompatibility() throws Exception { jtulach@84: try { jtulach@84: Convertor c = Convertor.getConvertorIntegerString( jtulach@84: CurrencyValue.getCurrencyValue(1, "CZK"), jtulach@84: CurrencyValue.getCurrencyValue(1, "CZK") jtulach@84: ); jtulach@84: c.convert("CZK", CurrencyValue.getCurrencyValue(10, "CZK")); jtulach@84: fail("Should throw exception"); jtulach@84: } catch (IllegalArgumentException e) { jtulach@84: //ok jtulach@84: } jtulach@84: } jtulach@84: }