示例#1
0
        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));
        }
示例#2
0
        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));
        }
示例#3
0
 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)));
 }
示例#4
0
        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));
        }
示例#5
0
        public virtual void test_of_wrongBaseCurrency()
        {
            FxSingle nearLeg = FxSingle.of(EUR_P1590, USD_M1600, DATE_2011_11_21);

            assertThrowsIllegalArg(() => FxSwap.of(nearLeg, FAR_LEG));
        }
示例#6
0
 public virtual void test_of_wrongOrder()
 {
     assertThrowsIllegalArg(() => FxSwap.of(FAR_LEG, NEAR_LEG));
 }
示例#7
0
 //-------------------------------------------------------------------------
 internal static FxSwap sut()
 {
     return(FxSwap.of(NEAR_LEG, FAR_LEG));
 }