public virtual void test_withPrice()
        {
            CapitalIndexedBondTrade @base = sut();
            double price = 0.95;
            CapitalIndexedBondTrade computed = @base.withPrice(price);
            CapitalIndexedBondTrade expected = CapitalIndexedBondTrade.builder().info(TRADE_INFO).product(PRODUCT).quantity(QUANTITY).price(price).build();

            assertEquals(computed, expected);
        }
        //-------------------------------------------------------------------------
        public virtual void test_withQuantity()
        {
            CapitalIndexedBondTrade @base = sut();
            double quantity = 3456d;
            CapitalIndexedBondTrade computed = @base.withQuantity(quantity);
            CapitalIndexedBondTrade expected = CapitalIndexedBondTrade.builder().info(TRADE_INFO).product(PRODUCT).quantity(quantity).price(PRICE).build();

            assertEquals(computed, expected);
        }
        //-------------------------------------------------------------------------
        public virtual void test_createProduct()
        {
            CapitalIndexedBondSecurity test = sut();

            assertEquals(test.createProduct(ReferenceData.empty()), PRODUCT);
            TradeInfo tradeInfo = TradeInfo.builder().tradeDate(date(2016, 6, 30)).settlementDate(date(2016, 7, 1)).build();
            CapitalIndexedBondTrade expectedTrade = CapitalIndexedBondTrade.builder().info(tradeInfo).product(PRODUCT).quantity(100).price(123.50).build();

            assertEquals(test.createTrade(tradeInfo, 100, 123.50, ReferenceData.empty()), expectedTrade);
        }
 internal static CapitalIndexedBondTrade sut2()
 {
     return(CapitalIndexedBondTrade.builder().info(TradeInfo.builder().tradeDate(START.plusDays(7)).build()).product(PRODUCT2).quantity(QUANTITY2).price(PRICE2).build());
 }
 internal static CapitalIndexedBondTrade sut1()
 {
     return(CapitalIndexedBondTrade.builder().info(TRADE_INFO).product(PRODUCT1).quantity(QUANTITY).price(PRICE).build());
 }
        public virtual void test_resolve_noTradeOrSettlementDate()
        {
            CapitalIndexedBondTrade test = CapitalIndexedBondTrade.builder().info(TradeInfo.empty()).product(PRODUCT).quantity(QUANTITY).price(PRICE).build();

            assertThrows(() => test.resolve(REF_DATA), typeof(System.InvalidOperationException));
        }