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));
        }
Exemplo n.º 2
0
 private IborCapFloorTrade(TradeInfo info, IborCapFloor product, AdjustablePayment premium)
 {
     JodaBeanUtils.notNull(info, "info");
     JodaBeanUtils.notNull(product, "product");
     this.info    = info;
     this.product = product;
     this.premium = premium;
 }
        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);
        }
Exemplo n.º 5
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 override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         IborCapFloor other = (IborCapFloor)obj;
         return(JodaBeanUtils.equal(capFloorLeg, other.capFloorLeg) && JodaBeanUtils.equal(payLeg, other.payLeg));
     }
     return(false);
 }
Exemplo n.º 9
0
            public override Builder set(string propertyName, object newValue)
            {
                switch (propertyName.GetHashCode())
                {
                case 3237038:         // info
                    this.info_Renamed = (TradeInfo)newValue;
                    break;

                case -309474065:         // product
                    this.product_Renamed = (IborCapFloor)newValue;
                    break;

                case -318452137:         // premium
                    this.premium_Renamed = (AdjustablePayment)newValue;
                    break;

                default:
                    throw new NoSuchElementException("Unknown property: " + propertyName);
                }
                return(this);
            }
        public virtual void test_serialization()
        {
            IborCapFloor test = IborCapFloor.of(CAPFLOOR_LEG);

            assertSerialization(test);
        }
Exemplo n.º 11
0
 /// <summary>
 /// Sets the cap/floor product that was agreed when the trade occurred.
 /// <para>
 /// The product captures the contracted financial details of the trade.
 /// </para>
 /// </summary>
 /// <param name="product">  the new value, not null </param>
 /// <returns> this, for chaining, not null </returns>
 public Builder product(IborCapFloor product)
 {
     JodaBeanUtils.notNull(product, "product");
     this.product_Renamed = product;
     return(this);
 }
Exemplo n.º 12
0
 /// <summary>
 /// Restricted copy constructor. </summary>
 /// <param name="beanToCopy">  the bean to copy from, not null </param>
 internal Builder(IborCapFloorTrade beanToCopy)
 {
     this.info_Renamed    = beanToCopy.Info;
     this.product_Renamed = beanToCopy.Product;
     this.premium_Renamed = beanToCopy.premium;
 }