//-------------------------------------------------------------------------
        public virtual void test_resolve()
        {
            FxSingleBarrierOptionTrade         @base    = sut();
            ResolvedFxSingleBarrierOptionTrade expected = ResolvedFxSingleBarrierOptionTrade.builder().info(TRADE_INFO).product(PRODUCT.resolve(REF_DATA)).premium(PREMIUM.resolve(REF_DATA)).build();

            assertEquals(@base.resolve(REF_DATA), expected);
        }
        //-------------------------------------------------------------------------
        public virtual void test_summarize()
        {
            FxSingleBarrierOptionTrade trade    = sut();
            PortfolioItemSummary       expected = PortfolioItemSummary.builder().portfolioItemType(PortfolioItemType.TRADE).productType(ProductType.FX_SINGLE_BARRIER_OPTION).currencies(Currency.USD, Currency.EUR).description("Long Barrier Rec EUR 1mm @ EUR/USD 1.35 Premium EUR 50k : 14Feb15").build();

            assertEquals(trade.summarize(), expected);
        }
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            FxSingleBarrierOptionTrade test1 = sut();
            FxSingleBarrierOptionTrade test2 = FxSingleBarrierOptionTrade.builder().product(FxSingleBarrierOption.of(VANILLA_OPTION, BARRIER)).premium(AdjustablePayment.of(CurrencyAmount.of(EUR, NOTIONAL * 0.01), date(2014, 11, 13))).build();

            coverImmutableBean(test1);
            coverBeanEquals(test1, test2);
        }
        //-------------------------------------------------------------------------
        public virtual void test_builder()
        {
            FxSingleBarrierOptionTrade test = sut();

            assertEquals(test.Product, PRODUCT);
            assertEquals(test.Product.CurrencyPair, PRODUCT.CurrencyPair);
            assertEquals(test.Info, TRADE_INFO);
            assertEquals(test.Premium, PREMIUM);
            assertEquals(test.withInfo(TRADE_INFO).Info, TRADE_INFO);
        }
コード例 #5
0
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         FxSingleBarrierOptionTrade other = (FxSingleBarrierOptionTrade)obj;
         return(JodaBeanUtils.equal(info, other.info) && JodaBeanUtils.equal(product, other.product) && JodaBeanUtils.equal(premium, other.premium));
     }
     return(false);
 }
        public virtual void test_serialization()
        {
            FxSingleBarrierOptionTrade test = sut();

            assertSerialization(test);
        }
 //-------------------------------------------------------------------------
 internal static FxSingleBarrierOptionTrade sut()
 {
     return(FxSingleBarrierOptionTrade.builder().info(TRADE_INFO).product(PRODUCT).premium(PREMIUM).build());
 }