예제 #1
0
        //-------------------------------------------------------------------------
        public virtual void test_resolve()
        {
            FxSingleTrade         test     = FxSingleTrade.builder().product(PRODUCT).info(TRADE_INFO).build();
            ResolvedFxSingleTrade expected = ResolvedFxSingleTrade.of(TRADE_INFO, PRODUCT.resolve(REF_DATA));

            assertEquals(test.resolve(REF_DATA), expected);
        }
예제 #2
0
        //-------------------------------------------------------------------------
        public virtual void test_summarize()
        {
            FxSingleTrade        trade    = sut();
            PortfolioItemSummary expected = PortfolioItemSummary.builder().id(TRADE_INFO.Id.orElse(null)).portfolioItemType(PortfolioItemType.TRADE).productType(ProductType.FX_SINGLE).currencies(Currency.GBP, Currency.USD).description("Rec GBP 1k @ GBP/USD 1.6 : 30Jun15").build();

            assertEquals(trade.summarize(), expected);
        }
예제 #3
0
        public virtual void test_builder()
        {
            FxSingleTrade test = FxSingleTrade.builder().product(PRODUCT).build();

            assertEquals(test.Info, TradeInfo.empty());
            assertEquals(test.Product, PRODUCT);
        }
예제 #4
0
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            FxSingleTrade test = sut();

            coverImmutableBean(test);
            FxSingleTrade test2 = sut2();

            coverBeanEquals(test, test2);
        }
예제 #5
0
        //-------------------------------------------------------------------------
        public virtual void test_of()
        {
            FxSingleTrade test = FxSingleTrade.of(TRADE_INFO, PRODUCT);

            assertEquals(test.Product, PRODUCT);
            assertEquals(test.Product.CurrencyPair, PRODUCT.CurrencyPair);
            assertEquals(test.Info, TRADE_INFO);
            assertEquals(test.withInfo(TRADE_INFO).Info, TRADE_INFO);
        }
예제 #6
0
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         FxSingleTrade other = (FxSingleTrade)obj;
         return(JodaBeanUtils.equal(info, other.info) && JodaBeanUtils.equal(product, other.product));
     }
     return(false);
 }
예제 #7
0
 internal static FxSingleTrade sut2()
 {
     return(FxSingleTrade.builder().product(PRODUCT2).build());
 }
예제 #8
0
 //-------------------------------------------------------------------------
 internal static FxSingleTrade sut()
 {
     return(FxSingleTrade.builder().info(TradeInfo.of(date(2014, 6, 30))).product(PRODUCT).build());
 }