public virtual void test_trade_noMarketData()
        {
            CdsIsdaCreditCurveNode node       = CdsIsdaCreditCurveNode.ofParSpread(TEMPLATE, QUOTE_ID, LEGAL_ENTITY);
            MarketData             marketData = MarketData.empty(VAL_DATE);

            assertThrows(() => node.trade(1d, marketData, REF_DATA), typeof(MarketDataNotFoundException));
        }
        //-------------------------------------------------------------------------
        public virtual void test_trade()
        {
            CdsIsdaCreditCurveNode node    = CdsIsdaCreditCurveNode.ofQuotedSpread(TEMPLATE, QUOTE_ID, LEGAL_ENTITY, 0.01);
            double              rate       = 0.0125;
            double              quantity   = -1234.56;
            MarketData          marketData = ImmutableMarketData.builder(VAL_DATE).addValue(QUOTE_ID, rate).build();
            CdsCalibrationTrade trade      = node.trade(quantity, marketData, REF_DATA);
            CdsTrade            expected   = TEMPLATE.createTrade(LEGAL_ENTITY, VAL_DATE, SELL, -quantity, 0.01, REF_DATA);

            assertEquals(trade.UnderlyingTrade, expected);
            assertEquals(trade.Quote, CdsQuote.of(CdsQuoteConvention.QUOTED_SPREAD, rate));

            CdsIsdaCreditCurveNode node1  = CdsIsdaCreditCurveNode.ofParSpread(TEMPLATE, QUOTE_ID, LEGAL_ENTITY);
            CdsTrade            expected1 = TEMPLATE.createTrade(LEGAL_ENTITY, VAL_DATE, SELL, -quantity, rate, REF_DATA);
            CdsCalibrationTrade trade1    = node1.trade(quantity, marketData, REF_DATA);

            assertEquals(trade1.UnderlyingTrade, expected1);
            assertEquals(trade1.Quote, CdsQuote.of(CdsQuoteConvention.PAR_SPREAD, rate));
        }