//-------------------------------------------------------------------------
        public virtual void test_resolve()
        {
            SwapTrade test = SwapTrade.of(TRADE_INFO, SWAP1);

            assertEquals(test.resolve(REF_DATA).Info, TRADE_INFO);
            assertEquals(test.resolve(REF_DATA).Product, SWAP1.resolve(REF_DATA));
        }
        //-------------------------------------------------------------------------
        public virtual void test_summarize()
        {
            SwapTrade            trade    = SwapTrade.of(TRADE_INFO, SWAP1);
            PortfolioItemSummary expected = PortfolioItemSummary.builder().id(TRADE_INFO.Id.orElse(null)).portfolioItemType(PortfolioItemType.TRADE).productType(ProductType.SWAP).currencies(Currency.GBP, Currency.EUR, Currency.USD).description("7M Pay [GBP-LIBOR-3M, EUR/GBP-ECB, EUR-EONIA] / Rec [GBP-LIBOR-3M, EUR/GBP-ECB, EUR-EONIA] : 15Jan12-15Aug12").build();

            assertEquals(trade.summarize(), expected);
        }
        public virtual void test_builder()
        {
            SwapTrade test = SwapTrade.builder().product(SWAP1).build();

            assertEquals(test.Info, TradeInfo.empty());
            assertEquals(test.Product, SWAP1);
        }
        //-------------------------------------------------------------------------
        public virtual void test_of()
        {
            SwapTrade test = SwapTrade.of(TRADE_INFO, SWAP1);

            assertEquals(test.Info, TRADE_INFO);
            assertEquals(test.Product, SWAP1);
            assertEquals(test.withInfo(TRADE_INFO).Info, TRADE_INFO);
        }
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            SwapTrade test = SwapTrade.builder().info(TRADE_INFO).product(SWAP1).build();

            coverImmutableBean(test);
            SwapTrade test2 = SwapTrade.builder().product(SWAP2).build();

            coverBeanEquals(test, test2);
        }
Exemple #6
0
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         SwapTrade other = (SwapTrade)obj;
         return(JodaBeanUtils.equal(info, other.info) && JodaBeanUtils.equal(product, other.product));
     }
     return(false);
 }
        public virtual void test_serialization()
        {
            SwapTrade test = SwapTrade.builder().info(TRADE_INFO).product(SWAP1).build();

            assertSerialization(test);
        }