Example #1
0
        public virtual void test_summarize_floor()
        {
            CmsTrade             trade    = CmsTrade.builder().info(TRADE_INFO).product(PRODUCT_FLOOR).premium(PREMIUM).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 Floor 1.25% / Pay Premium : 21Oct15-21Oct17").build();

            assertEquals(trade.summarize(), expected);
        }
Example #2
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);
        }
Example #3
0
        public virtual void test_builder_noPrem()
        {
            CmsTrade test = CmsTrade.builder().info(TRADE_INFO).product(PRODUCT_CAP2).build();

            assertFalse(test.Premium.Present);
            assertEquals(test.Product, PRODUCT_CAP2);
            assertEquals(test.Info, TRADE_INFO);
        }
Example #4
0
        //-------------------------------------------------------------------------
        public virtual void test_builder()
        {
            CmsTrade test = sut();

            assertEquals(test.Premium.get(), PREMIUM);
            assertEquals(test.Product, PRODUCT_CAP);
            assertEquals(test.Info, TRADE_INFO);
            assertEquals(test.withInfo(TRADE_INFO).Info, TRADE_INFO);
        }
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         CmsTrade other = (CmsTrade)obj;
         return(JodaBeanUtils.equal(info, other.info) && JodaBeanUtils.equal(product, other.product) && JodaBeanUtils.equal(premium, other.premium));
     }
     return(false);
 }
Example #6
0
 internal static CmsTrade sut2()
 {
     return(CmsTrade.builder().product(PRODUCT_CAP2).build());
 }
Example #7
0
 //-------------------------------------------------------------------------
 internal static CmsTrade sut()
 {
     return(CmsTrade.builder().info(TRADE_INFO).product(PRODUCT_CAP).premium(PREMIUM).build());
 }