//------------------------------------------------------------------------- public virtual void test_cross_CurrencyPair() { CurrencyPair gbpGbp = CurrencyPair.of(GBP, GBP); CurrencyPair gbpUsd = CurrencyPair.of(GBP, USD); CurrencyPair usdGbp = CurrencyPair.of(USD, GBP); CurrencyPair eurGbp = CurrencyPair.of(EUR, GBP); CurrencyPair eurUsd = CurrencyPair.of(EUR, USD); CurrencyPair usdEur = CurrencyPair.of(USD, EUR); assertEquals(gbpUsd.cross(gbpUsd), null); assertEquals(gbpUsd.cross(usdGbp), null); assertEquals(gbpGbp.cross(gbpUsd), null); assertEquals(gbpUsd.cross(gbpGbp), null); assertEquals(gbpUsd.cross(usdEur), eurGbp); assertEquals(gbpUsd.cross(eurUsd), eurGbp); assertEquals(usdGbp.cross(usdEur), eurGbp); assertEquals(usdGbp.cross(eurUsd), eurGbp); assertEquals(usdEur.cross(gbpUsd), eurGbp); assertEquals(usdEur.cross(usdGbp), eurGbp); assertEquals(eurUsd.cross(gbpUsd), eurGbp); assertEquals(eurUsd.cross(usdGbp), eurGbp); }
public virtual void test_cross_CurrencyPair_null() { CurrencyPair test = CurrencyPair.of(GBP, USD); assertThrowsIllegalArg(() => test.cross(null)); }