public virtual void test_of_wrongCounterCurrency() { FxSingle nearLeg = FxSingle.of(USD_P1550, EUR_P1590.negated(), DATE_2011_11_21); FxSingle farLeg = FxSingle.of(GBP_M1000, EUR_P1590, DATE_2011_12_21); assertThrowsIllegalArg(() => FxSwap.of(nearLeg, farLeg)); }
internal static FxSwap sut2() { FxSingle nearLeg = FxSingle.of(CurrencyAmount.of(GBP, 1_100), CurrencyAmount.of(USD, -1_650), DATE_2011_11_21); FxSingle farLeg = FxSingle.of(CurrencyAmount.of(GBP, -1_100), CurrencyAmount.of(USD, 1_750), DATE_2011_12_21); return(FxSwap.of(nearLeg, farLeg)); }
public virtual void test_of_ratesCurrencyAmountMismatch() { assertThrowsIllegalArg(() => FxSwap.of(GBP_P1000, FxRate.of(EUR, USD, 1.1), date(2018, 6, 1), FxRate.of(EUR, USD, 1.15), date(2018, 7, 1))); }
public virtual void test_of_sameSign() { FxSingle farLeg = FxSingle.of(GBP_M1000.negated(), USD_P1550.negated(), DATE_2011_12_21); assertThrowsIllegalArg(() => FxSwap.of(NEAR_LEG, farLeg)); }
public virtual void test_of_wrongBaseCurrency() { FxSingle nearLeg = FxSingle.of(EUR_P1590, USD_M1600, DATE_2011_11_21); assertThrowsIllegalArg(() => FxSwap.of(nearLeg, FAR_LEG)); }
public virtual void test_of_wrongOrder() { assertThrowsIllegalArg(() => FxSwap.of(FAR_LEG, NEAR_LEG)); }
//------------------------------------------------------------------------- internal static FxSwap sut() { return(FxSwap.of(NEAR_LEG, FAR_LEG)); }