//-------------------------------------------------------------------------
        public virtual void test_resolve()
        {
            FxVanillaOptionTrade         test     = sut();
            ResolvedFxVanillaOptionTrade expected = ResolvedFxVanillaOptionTrade.builder().info(TRADE_INFO).product(PRODUCT.resolve(REF_DATA)).premium(PREMIUM.resolve(REF_DATA)).build();

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

            assertEquals(trade.summarize(), expected);
        }
        //-------------------------------------------------------------------------
        public virtual void test_builder()
        {
            FxVanillaOptionTrade 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);
        }
Beispiel #4
0
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         FxVanillaOptionTrade other = (FxVanillaOptionTrade)obj;
         return(JodaBeanUtils.equal(info, other.info) && JodaBeanUtils.equal(product, other.product) && JodaBeanUtils.equal(premium, other.premium));
     }
     return(false);
 }
        internal static FxVanillaOptionTrade sut2()
        {
            AdjustablePayment premium = AdjustablePayment.of(CurrencyAmount.of(EUR, NOTIONAL * 0.01), date(2014, 11, 13));

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