Exemplo n.º 1
0
        public virtual void test_resolve_noPremium()
        {
            IborCapFloorTrade         test     = IborCapFloorTrade.builder().info(TRADE_INFO).product(PRODUCT).build();
            ResolvedIborCapFloorTrade expected = ResolvedIborCapFloorTrade.builder().info(TRADE_INFO).product(PRODUCT.resolve(REF_DATA)).build();

            assertEquals(test.resolve(REF_DATA), expected);
        }
Exemplo n.º 2
0
        public virtual void test_summarize_floor()
        {
            IborCapFloorTrade    trade    = IborCapFloorTrade.builder().info(TRADE_INFO).product(PRODUCT_FLOOR).build();
            PortfolioItemSummary expected = PortfolioItemSummary.builder().id(TRADE_INFO.Id.orElse(null)).portfolioItemType(PortfolioItemType.TRADE).productType(ProductType.IBOR_CAP_FLOOR).currencies(Currency.EUR).description("5Y EUR 1mm Rec EUR-EURIBOR-3M Floor 3.25% : 17Mar11-17Mar16").build();

            assertEquals(trade.summarize(), expected);
        }
Exemplo n.º 3
0
        public virtual void test_builder_min()
        {
            IborCapFloorTrade test = IborCapFloorTrade.builder().product(PRODUCT).build();

            assertEquals(test.Premium.Present, false);
            assertEquals(test.Product, PRODUCT);
            assertEquals(test.Info, TradeInfo.empty());
        }
Exemplo n.º 4
0
        //-------------------------------------------------------------------------
        public virtual void test_builder_full()
        {
            IborCapFloorTrade test = sut();

            assertEquals(test.Premium.get(), PREMIUM);
            assertEquals(test.Product, PRODUCT);
            assertEquals(test.Info, TRADE_INFO);
            assertEquals(test.withInfo(TRADE_INFO).Info, TRADE_INFO);
        }
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);
        }
Exemplo n.º 6
0
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         IborCapFloorTrade other = (IborCapFloorTrade)obj;
         return(JodaBeanUtils.equal(info, other.info) && JodaBeanUtils.equal(product, other.product) && JodaBeanUtils.equal(premium, other.premium));
     }
     return(false);
 }
Exemplo n.º 7
0
 //-------------------------------------------------------------------------
 internal virtual IborCapFloorTrade sut()
 {
     return(IborCapFloorTrade.builder().info(TRADE_INFO).product(PRODUCT).premium(PREMIUM).build());
 }
Exemplo n.º 8
0
        public virtual void test_serialization()
        {
            IborCapFloorTrade test = sut();

            assertSerialization(test);
        }