diff -r 000000000000 -r 2ae6e4aa7aef taskx/psmid/against-solution11/test/apifest/CurrencyTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/taskx/psmid/against-solution11/test/apifest/CurrencyTest.java Sat Oct 25 20:53:00 2008 +0200 @@ -0,0 +1,29 @@ +package apifest; + +import junit.framework.TestCase; +import org.apidesign.apifest08.currency.Convertor; +import org.apidesign.apifest08.currency.CurrencyValue; +//import static org.apidesign.apifest08.test.Currencies.CZK; +//import static org.apidesign.apifest08.test.Currencies.SKK; +//import static org.apidesign.apifest08.test.Currencies.USD; + +/** Write a test that works with version from task A and fails with version B. + */ +public class CurrencyTest extends TestCase { + public CurrencyTest(String n) { + super(n); + } + + public void testCompatibility() throws Exception { + try { + Convertor c = Convertor.getConvertorIntegerString( + CurrencyValue.getCurrencyValue(1, "CZK"), + CurrencyValue.getCurrencyValue(1, "CZK") + ); + c.convert("CZK", CurrencyValue.getCurrencyValue(10, "CZK")); + fail("Should throw exception"); + } catch (IllegalArgumentException e) { + //ok + } + } +}