DefaultCurrencyPairsFn implements CurrencyPairsFn { @Override public Result<CurrencyPair> getCurrencyPair(Currency currency1, Currency currency2) { return getCurrencyPair(UnorderedCurrencyPair.of(currency1, currency2)); } DefaultCurrencyPairsFn(CurrencyPairSet currencyPairs); @Override Result<CurrencyPair> getCurrencyPair(Currency currency1, Currency currency2); @Override Result<CurrencyPair> getCurrencyPair(UnorderedCurrencyPair pair);  }
@Test public void testRetrieval() { Result<CurrencyPair> result = _pairsFunction.getCurrencyPair(EUR, USD); assertThat(result.getStatus(), is((ResultStatus) SUCCESS)); assertThat(result.getValue(), is(CurrencyPair.of(EUR, USD))); }
@Test public void testInverseRetrieval() { Result<CurrencyPair> result = _pairsFunction.getCurrencyPair(USD, GBP); assertThat(result.getStatus(), is((ResultStatus) SUCCESS)); assertThat(result.getValue(), is(CurrencyPair.of(GBP, USD))); }
@Test public void testUnknownPair() { Result<CurrencyPair> result = _pairsFunction.getCurrencyPair(AUD, GBP); assertThat(result.getStatus(), is((ResultStatus) MISSING_DATA)); }