//------------------------------------------------------------------------- public virtual void coverage() { FixedRateSwapLegConvention test = FixedRateSwapLegConvention.of(GBP, ACT_365F, P3M, BDA_MOD_FOLLOW); coverImmutableBean(test); FixedRateSwapLegConvention test2 = FixedRateSwapLegConvention.builder().currency(USD).dayCount(ACT_360).accrualFrequency(P6M).accrualBusinessDayAdjustment(BDA_FOLLOW).startDateBusinessDayAdjustment(BDA_FOLLOW).endDateBusinessDayAdjustment(BDA_FOLLOW).stubConvention(LONG_INITIAL).rollConvention(RollConventions.EOM).paymentFrequency(P6M).paymentDateOffset(PLUS_TWO_DAYS).build(); coverBeanEquals(test, test2); }
//------------------------------------------------------------------------- public virtual void test_toLeg() { FixedRateSwapLegConvention @base = FixedRateSwapLegConvention.of(GBP, ACT_365F, P3M, BDA_MOD_FOLLOW); LocalDate startDate = LocalDate.of(2015, 5, 5); LocalDate endDate = LocalDate.of(2020, 5, 5); RateCalculationSwapLeg test = @base.toLeg(startDate, endDate, PAY, NOTIONAL_2M, 0.25d); RateCalculationSwapLeg expected = RateCalculationSwapLeg.builder().payReceive(PAY).accrualSchedule(PeriodicSchedule.builder().frequency(P3M).startDate(startDate).endDate(endDate).businessDayAdjustment(BDA_MOD_FOLLOW).stubConvention(StubConvention.SMART_INITIAL).build()).paymentSchedule(PaymentSchedule.builder().paymentFrequency(P3M).paymentDateOffset(DaysAdjustment.NONE).build()).notionalSchedule(NotionalSchedule.of(GBP, NOTIONAL_2M)).calculation(FixedRateCalculation.of(0.25d, ACT_365F)).build(); assertEquals(test, expected); }
//------------------------------------------------------------------------- public virtual void test_of() { FixedRateSwapLegConvention test = FixedRateSwapLegConvention.of(GBP, ACT_365F, P3M, BDA_MOD_FOLLOW); assertEquals(test.Currency, GBP); assertEquals(test.DayCount, ACT_365F); assertEquals(test.AccrualFrequency, P3M); assertEquals(test.AccrualBusinessDayAdjustment, BDA_MOD_FOLLOW); assertEquals(test.StartDateBusinessDayAdjustment, BDA_MOD_FOLLOW); assertEquals(test.EndDateBusinessDayAdjustment, BDA_MOD_FOLLOW); assertEquals(test.StubConvention, StubConvention.SMART_INITIAL); assertEquals(test.RollConvention, RollConventions.EOM); assertEquals(test.PaymentFrequency, P3M); assertEquals(test.PaymentDateOffset, DaysAdjustment.NONE); assertEquals(test.CompoundingMethod, CompoundingMethod.NONE); }
public virtual void test_serialization() { FixedRateSwapLegConvention test = FixedRateSwapLegConvention.of(GBP, ACT_365F, P3M, BDA_MOD_FOLLOW); assertSerialization(test); }