//-------------------------------------------------------------------------
        public virtual void test_summarize()
        {
            SwaptionTrade        trade    = sut();
            PortfolioItemSummary expected = PortfolioItemSummary.builder().id(TRADE_INFO.Id.orElse(null)).portfolioItemType(PortfolioItemType.TRADE).productType(ProductType.SWAPTION).currencies(Currency.USD).description("Long 10Y USD 100mm Rec USD-LIBOR-3M / Pay 1.5% : 14Jun14").build();

            assertEquals(trade.summarize(), expected);
        }
        //-------------------------------------------------------------------------
        public virtual void test_resolve()
        {
            SwaptionTrade test = SwaptionTrade.of(TRADE_INFO, SWAPTION, PREMIUM);

            assertEquals(test.resolve(REF_DATA).Premium, PREMIUM.resolve(REF_DATA));
            assertEquals(test.resolve(REF_DATA).Product, SWAPTION.resolve(REF_DATA));
            assertEquals(test.resolve(REF_DATA).Info, TRADE_INFO);
        }
        public virtual void test_builder()
        {
            SwaptionTrade test = sut();

            assertEquals(test.Premium, PREMIUM);
            assertEquals(test.Product, SWAPTION);
            assertEquals(test.Info, TRADE_INFO);
        }
        //-------------------------------------------------------------------------
        public virtual void test_of()
        {
            SwaptionTrade test = SwaptionTrade.of(TRADE_INFO, SWAPTION, PREMIUM);

            assertEquals(test.Premium, PREMIUM);
            assertEquals(test.Product, SWAPTION);
            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())
     {
         SwaptionTrade other = (SwaptionTrade)obj;
         return(JodaBeanUtils.equal(info, other.info) && JodaBeanUtils.equal(product, other.product) && JodaBeanUtils.equal(premium, other.premium));
     }
     return(false);
 }
 internal static SwaptionTrade sut2()
 {
     return(SwaptionTrade.builder().premium(AdjustablePayment.of(CurrencyAmount.of(Currency.USD, -3050000d), LocalDate.of(2014, 3, 17))).product(SwaptionTest.sut2()).build());
 }
 //-------------------------------------------------------------------------
 internal static SwaptionTrade sut()
 {
     return(SwaptionTrade.builder().premium(PREMIUM).product(SWAPTION).info(TRADE_INFO).build());
 }