@Test(dataProvider = "name") public void test_of_lookup(FxIndex convention, String name) { assertEquals(FxIndex.of(name), convention); }
public void test_inr() { FxIndex test = FxIndex.of("USD/INR-FBIL-INR01"); assertEquals(test.getName(), "USD/INR-FBIL-INR01"); }
public void test_cny() { FxIndex test = FxIndex.of("USD/CNY-SAEC-CNY01"); assertEquals(test.getName(), "USD/CNY-SAEC-CNY01"); }
public void test_of_lookup_notFound() { assertThrowsIllegalArg(() -> FxIndex.of("Rubbish")); }
public void test_of_lookup_null() { assertThrowsIllegalArg(() -> FxIndex.of((String) null)); }
builder.amount(ValueSchedule.of(LoaderUtils.parseDouble(getValueWithFallback(row, leg, NOTIONAL_FIELD)))); Optional<FxIndex> fxIndexOpt = findValue(row, leg, FX_RESET_INDEX_FIELD).map(s -> FxIndex.of(s)); Optional<Currency> notionalCurrencyOpt = findValue(row, leg, NOTIONAL_CURRENCY_FIELD).map(s -> Currency.of(s)); Optional<FxResetFixingRelativeTo> fxFixingRelativeToOpt = findValue(row, leg, FX_RESET_RELATIVE_TO_FIELD)