//-------------------------------------------------------------------------
        public virtual void test_resolve()
        {
            FxSwapTrade         test     = sut();
            ResolvedFxSwapTrade expected = ResolvedFxSwapTrade.of(TRADE_INFO, PRODUCT.resolve(REF_DATA));

            assertEquals(test.resolve(REF_DATA), expected);
        }
        //-------------------------------------------------------------------------
        public virtual void test_summarize()
        {
            FxSwapTrade          trade    = sut();
            PortfolioItemSummary expected = PortfolioItemSummary.builder().portfolioItemType(PortfolioItemType.TRADE).productType(ProductType.FX_SWAP).currencies(Currency.GBP, Currency.USD).description("Rec GBP 1k @ GBP/USD 1.6 / Pay GBP 1k @ GBP/USD 1.55 : 21Nov11-21Dec11").build();

            assertEquals(trade.summarize(), expected);
        }
        public virtual void test_builder()
        {
            FxSwapTrade test = sut();

            assertEquals(test.Info, TRADE_INFO);
            assertEquals(test.Product, PRODUCT);
        }
        //-------------------------------------------------------------------------
        public virtual void test_of()
        {
            FxSwapTrade test = FxSwapTrade.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);
        }
Beispiel #5
0
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         FxSwapTrade other = (FxSwapTrade)obj;
         return(JodaBeanUtils.equal(info, other.info) && JodaBeanUtils.equal(product, other.product));
     }
     return(false);
 }
 internal static FxSwapTrade sut2()
 {
     return(FxSwapTrade.builder().product(PRODUCT2).build());
 }
 //-------------------------------------------------------------------------
 internal static FxSwapTrade sut()
 {
     return(FxSwapTrade.builder().product(PRODUCT).info(TRADE_INFO).build());
 }