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)); }
private AdjustablePayment parsePremium(XmlElement swaptionEl, FpmlDocument document, TradeInfoBuilder tradeInfoBuilder) { XmlElement premiumEl = swaptionEl.getChild("premium"); PayReceive payReceive = document.parsePayerReceiver(premiumEl, tradeInfoBuilder); XmlElement paymentAmountEl = premiumEl.getChild("paymentAmount"); CurrencyAmount ccyAmount = document.parseCurrencyAmount(paymentAmountEl); ccyAmount = payReceive.Pay ? ccyAmount.negated() : ccyAmount; AdjustableDate paymentDate = premiumEl.findChild("paymentDate").map(el => document.parseAdjustableDate(el)).get(); return(AdjustablePayment.of(ccyAmount, paymentDate)); }
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)); }