示例#1
0
        //-------------------------------------------------------------------------
        public virtual void test_getters()
        {
            ResolvedBondFutureOptionTrade test  = sut();
            BondFutureOptionTrade         @base = BondFutureOptionTradeTest.sut();

            assertEquals(test.TradedPrice.get(), TradedPrice.of(@base.Info.TradeDate.get(), @base.Price));
        }
示例#2
0
        //-------------------------------------------------------------------------
        public virtual void test_builder()
        {
            ResolvedIborFutureTrade test = sut();

            assertEquals(test.Info, TRADE_INFO);
            assertEquals(test.Product, PRODUCT);
            assertEquals(test.Quantity, QUANTITY);
            assertEquals(test.TradedPrice, TradedPrice.of(TRADE_DATE, PRICE));
        }
示例#3
0
        //-------------------------------------------------------------------------
        public virtual void test_builder()
        {
            ResolvedOvernightFutureTrade test = ResolvedOvernightFutureTrade.builder().info(TRADE_INFO).product(PRODUCT).quantity(QUANTITY).tradedPrice(TradedPrice.of(TRADE_DATE, PRICE)).build();

            assertEquals(test.Info, TRADE_INFO);
            assertEquals(test.Product, PRODUCT);
            assertEquals(test.Quantity, QUANTITY);
            assertEquals(test.TradedPrice, TradedPrice.of(TRADE_DATE, PRICE));
        }
示例#4
0
        //-------------------------------------------------------------------------
        public virtual void test_resolve()
        {
            IborFutureTrade         test     = sut();
            ResolvedIborFutureTrade resolved = test.resolve(REF_DATA);

            assertEquals(resolved.Info, TRADE_INFO);
            assertEquals(resolved.Product, PRODUCT.resolve(REF_DATA));
            assertEquals(resolved.Quantity, QUANTITY);
            assertEquals(resolved.TradedPrice, TradedPrice.of(TRADE_DATE, PRICE));
        }
        //-------------------------------------------------------------------------
        public virtual void test_resolve()
        {
            OvernightFutureTrade         test     = OvernightFutureTrade.builder().info(TRADE_INFO).product(PRODUCT).quantity(QUANTITY).price(PRICE).build();
            ResolvedOvernightFutureTrade resolved = test.resolve(REF_DATA);

            assertEquals(resolved.Info, TRADE_INFO);
            assertEquals(resolved.Product, PRODUCT.resolve(REF_DATA));
            assertEquals(resolved.Quantity, QUANTITY);
            assertEquals(resolved.TradedPrice, TradedPrice.of(TRADE_DATE, PRICE));
        }
        public ResolvedOvernightFutureTrade resolve(ReferenceData refData)
        {
            if (!info.TradeDate.Present)
            {
                throw new System.ArgumentException("Trade date on TradeInfo must be present");
            }
            ResolvedOvernightFuture resolved    = Product.resolve(refData);
            TradedPrice             tradedPrice = TradedPrice.of(info.TradeDate.get(), price);

            return(new ResolvedOvernightFutureTrade(info, resolved, quantity, tradedPrice));
        }
示例#7
0
 internal static ResolvedIborFutureTrade sut2()
 {
     return(ResolvedIborFutureTrade.builder().info(TRADE_INFO2).product(PRODUCT2).quantity(QUANTITY2).tradedPrice(TradedPrice.of(TRADE_DATE, PRICE2)).build());
 }
 //-------------------------------------------------------------------------
 internal static ResolvedDsfTrade sut()
 {
     return(ResolvedDsfTrade.builder().info(TRADE_INFO).product(PRODUCT).quantity(QUANTITY).tradedPrice(TradedPrice.of(TRADE_DATE, PRICE)).build());
 }
示例#9
0
        //-------------------------------------------------------------------------
        public virtual void test_resolve()
        {
            ResolvedBondFutureOptionTrade expected = ResolvedBondFutureOptionTrade.builder().info(TRADE_INFO).product(OPTION_PRODUCT.resolve(REF_DATA)).quantity(QUANTITY).tradedPrice(TradedPrice.of(TRADE_INFO.TradeDate.get(), PRICE.Value)).build();

            assertEquals(sut().resolve(REF_DATA), expected);
        }
        //-------------------------------------------------------------------------
        public virtual void test_resolve()
        {
            DsfTrade         test     = sut();
            ResolvedDsfTrade expected = ResolvedDsfTrade.builder().info(TRADE_INFO).product(PRODUCT.resolve(REF_DATA)).quantity(QUANTITY).tradedPrice(TradedPrice.of(TRADE_DATE, PRICE)).build();

            assertEquals(test.resolve(REF_DATA), expected);
        }
示例#11
0
        public virtual void test_serialization()
        {
            ResolvedOvernightFutureTrade test = ResolvedOvernightFutureTrade.builder().info(TRADE_INFO).product(PRODUCT).quantity(QUANTITY).tradedPrice(TradedPrice.of(TRADE_DATE, PRICE)).build();

            assertSerialization(test);
        }
示例#12
0
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            ResolvedOvernightFutureTrade test1 = ResolvedOvernightFutureTrade.builder().info(TRADE_INFO).product(PRODUCT).quantity(QUANTITY).tradedPrice(TradedPrice.of(TRADE_DATE, PRICE)).build();

            coverImmutableBean(test1);
            ResolvedOvernightFutureTrade test2 = ResolvedOvernightFutureTrade.builder().info(TradeInfo.empty()).product(PRODUCT2).quantity(QUANTITY2).tradedPrice(TradedPrice.of(TRADE_DATE, PRICE2)).build();

            coverBeanEquals(test1, test2);
        }