//-------------------------------------------------------------------------
        public virtual void coverage()
        {
            CdsIndexTrade test1 = sut();

            coverImmutableBean(test1);
            CdsIndex      product = CdsIndex.of(BUY, INDEX_ID, LEGAL_ENTITIES, USD, 1.e9, START_DATE, END_DATE, P6M, SAT_SUN, 0.067);
            CdsIndexTrade test2   = CdsIndexTrade.builder().product(product).info(TradeInfo.empty()).build();

            coverBeanEquals(test1, test2);
        }
Beispiel #2
0
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            ResolvedCdsIndexTrade test1 = ResolvedCdsIndexTrade.builder().product(PRODUCT).upfrontFee(UPFRONT).info(TRADE_INFO).build();

            coverImmutableBean(test1);
            ResolvedCdsIndex      product = CdsIndex.of(BUY, INDEX_ID, LEGAL_ENTITIES, USD, 1.e9, START_DATE, END_DATE, P6M, SAT_SUN, 0.067).resolve(REF_DATA);
            ResolvedCdsIndexTrade test2   = ResolvedCdsIndexTrade.builder().product(product).info(TradeInfo.empty()).build();

            coverBeanEquals(test1, test2);
        }
        public virtual void test_of()
        {
            BusinessDayAdjustment bussAdj  = BusinessDayAdjustment.of(FOLLOWING, SAT_SUN);
            PeriodicSchedule      expected = PeriodicSchedule.builder().startDate(START_DATE).endDate(END_DATE).businessDayAdjustment(bussAdj).startDateBusinessDayAdjustment(BusinessDayAdjustment.NONE).endDateBusinessDayAdjustment(BusinessDayAdjustment.NONE).frequency(P3M).rollConvention(RollConventions.NONE).stubConvention(SMART_INITIAL).build();

            assertEquals(PRODUCT.PaymentSchedule, expected);
            assertEquals(PRODUCT.BuySell, BUY);
            assertEquals(PRODUCT.Currency, USD);
            assertEquals(PRODUCT.DayCount, ACT_360);
            assertEquals(PRODUCT.FixedRate, COUPON);
            assertEquals(PRODUCT.CdsIndexId, INDEX_ID);
            assertEquals(PRODUCT.LegalEntityIds, LEGAL_ENTITIES);
            assertEquals(PRODUCT.Notional, NOTIONAL);
            assertEquals(PRODUCT.PaymentOnDefault, ACCRUED_PREMIUM);
            assertEquals(PRODUCT.ProtectionStart, BEGINNING);
            assertEquals(PRODUCT.SettlementDateOffset, SETTLE_DAY_ADJ);
            assertEquals(PRODUCT.StepinDateOffset, STEPIN_DAY_ADJ);
            CdsIndex test = CdsIndex.of(BUY, INDEX_ID, LEGAL_ENTITIES, USD, NOTIONAL, START_DATE, END_DATE, P3M, SAT_SUN, COUPON);

            assertEquals(test, PRODUCT);
        }