public virtual void test_resolve_twoLegs()
        {
            IborCapFloor         @base = IborCapFloor.of(CAPFLOOR_LEG, PAY_LEG);
            ResolvedIborCapFloor test  = @base.resolve(REF_DATA);

            assertEquals(test.CapFloorLeg, CAPFLOOR_LEG.resolve(REF_DATA));
            assertEquals(test.PayLeg.get(), PAY_LEG.resolve(REF_DATA));
        }
        public virtual void test_resolve_oneLeg()
        {
            IborCapFloor         @base = IborCapFloor.of(CAPFLOOR_LEG);
            ResolvedIborCapFloor test  = @base.resolve(REF_DATA);

            assertEquals(test.CapFloorLeg, CAPFLOOR_LEG.resolve(REF_DATA));
            assertEquals(test.PayLeg.Present, false);
        }
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            IborCapFloor test1 = IborCapFloor.of(CAPFLOOR_LEG);

            coverImmutableBean(test1);
            IborCapFloorLeg capFloor = IborCapFloorLeg.builder().calculation(RATE_CALCULATION).floorSchedule(CAP).notional(NOTIONAL).paymentDateOffset(PAYMENT_OFFSET).paymentSchedule(SCHEDULE).payReceive(RECEIVE).build();
            IborCapFloor    test2    = IborCapFloor.of(capFloor, PAY_LEG);

            coverBeanEquals(test1, test2);
        }
Пример #4
0
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            IborCapFloorTrade test1 = sut();

            coverImmutableBean(test1);
            IborCapFloor      product = IborCapFloor.of(IborCapFloorLeg.builder().calculation(RATE_CALCULATION).floorSchedule(CAP).notional(NOTIONAL).paymentDateOffset(PAYMENT_OFFSET).paymentSchedule(SCHEDULE).payReceive(PAY).build());
            IborCapFloorTrade test2   = IborCapFloorTrade.builder().product(product).build();

            coverBeanEquals(test1, test2);
        }
        public virtual void test_of_twoLegs_xccy()
        {
            IborCapFloor test = IborCapFloor.of(CAPFLOOR_LEG, PAY_LEG_XCCY);

            assertEquals(test.CapFloorLeg, CAPFLOOR_LEG);
            assertEquals(test.PayLeg.get(), PAY_LEG_XCCY);
            assertEquals(test.CrossCurrency, true);
            assertEquals(test.allPaymentCurrencies(), ImmutableSet.of(GBP, EUR));
            assertEquals(test.allCurrencies(), ImmutableSet.of(GBP, EUR));
            assertEquals(test.allIndices(), ImmutableSet.of(GBP_LIBOR_3M, EUR_EURIBOR_3M));
        }
        public virtual void test_of_oneLeg()
        {
            IborCapFloor test = IborCapFloor.of(CAPFLOOR_LEG);

            assertEquals(test.CapFloorLeg, CAPFLOOR_LEG);
            assertEquals(test.PayLeg.Present, false);
            assertEquals(test.CrossCurrency, false);
            assertEquals(test.allPaymentCurrencies(), ImmutableSet.of(EUR));
            assertEquals(test.allCurrencies(), ImmutableSet.of(EUR));
            assertEquals(test.allIndices(), ImmutableSet.of(EUR_EURIBOR_3M));
        }
        public virtual void test_serialization()
        {
            IborCapFloor test = IborCapFloor.of(CAPFLOOR_LEG);

            assertSerialization(test);
        }