//------------------------------------------------------------------------- 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); }
//------------------------------------------------------------------------- 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); }
public virtual void test_builder() { FxSingleTrade test = FxSingleTrade.builder().product(PRODUCT).build(); assertEquals(test.Info, TradeInfo.empty()); assertEquals(test.Product, PRODUCT); }
//------------------------------------------------------------------------- public virtual void coverage() { FxSingleTrade test = sut(); coverImmutableBean(test); FxSingleTrade test2 = sut2(); coverBeanEquals(test, test2); }
//------------------------------------------------------------------------- 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); }
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); }
internal static FxSingleTrade sut2() { return(FxSingleTrade.builder().product(PRODUCT2).build()); }
//------------------------------------------------------------------------- internal static FxSingleTrade sut() { return(FxSingleTrade.builder().info(TradeInfo.of(date(2014, 6, 30))).product(PRODUCT).build()); }