Esempio n. 1
0
        public virtual void test_summarize_singleLeg()
        {
            CmsTrade             trade    = CmsTrade.builder().product(Cms.of(CmsLegTest.sutCap())).build();
            PortfolioItemSummary expected = PortfolioItemSummary.builder().id(TRADE_INFO.Id.orElse(null)).portfolioItemType(PortfolioItemType.TRADE).productType(ProductType.CMS).currencies(Currency.EUR).description("2Y EUR 1mm Rec EUR-EURIBOR-1100-10Y Cap 1.25% : 21Oct15-21Oct17").build();

            assertEquals(trade.summarize(), expected);
        }
Esempio n. 2
0
        public virtual void test_resolve_twoLegs()
        {
            Cms         @base = sutCap();
            ResolvedCms test  = @base.resolve(REF_DATA);

            assertEquals(test.CmsLeg, CMS_LEG.resolve(REF_DATA));
            assertEquals(test.PayLeg.get(), PAY_LEG.resolve(REF_DATA));
        }
Esempio n. 3
0
        public virtual void test_resolve_oneLeg()
        {
            Cms         @base = Cms.of(CMS_LEG);
            ResolvedCms test  = @base.resolve(REF_DATA);

            assertEquals(test.CmsLeg, CMS_LEG.resolve(REF_DATA));
            assertFalse(test.PayLeg.Present);
        }
 private CmsTrade(TradeInfo info, Cms product, AdjustablePayment premium)
 {
     JodaBeanUtils.notNull(info, "info");
     JodaBeanUtils.notNull(product, "product");
     this.info    = info;
     this.product = product;
     this.premium = premium;
 }
Esempio n. 5
0
        public virtual void test_of_oneLeg()
        {
            Cms test = Cms.of(CMS_LEG);

            assertEquals(test.CmsLeg, CMS_LEG);
            assertFalse(test.PayLeg.Present);
            assertEquals(test.CrossCurrency, false);
            assertEquals(test.allPaymentCurrencies(), ImmutableSet.of(CMS_LEG.Currency));
            assertEquals(test.allCurrencies(), ImmutableSet.of(CMS_LEG.Currency));
        }
Esempio n. 6
0
        //-------------------------------------------------------------------------
        public virtual void test_of_twoLegs()
        {
            Cms test = sutCap();

            assertEquals(test.CmsLeg, CMS_LEG);
            assertEquals(test.PayLeg.get(), PAY_LEG);
            assertEquals(test.CrossCurrency, false);
            assertEquals(test.allPaymentCurrencies(), ImmutableSet.of(CMS_LEG.Currency));
            assertEquals(test.allCurrencies(), ImmutableSet.of(CMS_LEG.Currency));
            assertEquals(test.allRateIndices(), ImmutableSet.of(CMS_LEG.UnderlyingIndex));
        }
Esempio n. 7
0
 //-----------------------------------------------------------------------
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         Cms other = (Cms)obj;
         return(JodaBeanUtils.equal(cmsLeg, other.cmsLeg) && JodaBeanUtils.equal(payLeg, other.payLeg));
     }
     return(false);
 }
            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 = (Cms)newValue;
                    break;

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

                default:
                    throw new NoSuchElementException("Unknown property: " + propertyName);
                }
                return(this);
            }
Esempio n. 9
0
 internal static Cms sutFloor()
 {
     return(Cms.of(CmsLeg.builder().floorSchedule(STRIKE).index(INDEX).notional(NOTIONAL).payReceive(RECEIVE).paymentSchedule(SCHEDULE_EUR).build()));
 }
Esempio n. 10
0
 //-------------------------------------------------------------------------
 internal static Cms sutCap()
 {
     return(Cms.of(CMS_LEG, PAY_LEG));
 }
Esempio n. 11
0
 /// <summary>
 /// Sets the CMS 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(Cms product)
 {
     JodaBeanUtils.notNull(product, "product");
     this.product_Renamed = product;
     return(this);
 }
Esempio n. 12
0
 /// <summary>
 /// Restricted copy constructor. </summary>
 /// <param name="beanToCopy">  the bean to copy from, not null </param>
 internal Builder(CmsTrade beanToCopy)
 {
     this.info_Renamed    = beanToCopy.Info;
     this.product_Renamed = beanToCopy.Product;
     this.premium_Renamed = beanToCopy.premium;
 }