public override Builder set(string propertyName, object newValue) { switch (propertyName.GetHashCode()) { case -885469925: // payReceive this.payReceive_Renamed = (PayReceive)newValue; break; case 304659814: // accrualSchedule this.accrualSchedule_Renamed = (PeriodicSchedule)newValue; break; case -1499086147: // paymentSchedule this.paymentSchedule_Renamed = (PaymentSchedule)newValue; break; case -1413853096: // amount this.amount_Renamed = (ValueSchedule)newValue; break; case 575402001: // currency this.currency_Renamed = (Currency)newValue; break; default: throw new NoSuchElementException("Unknown property: " + propertyName); } return(this); }
public override Builder set(string propertyName, object newValue) { switch (propertyName.GetHashCode()) { case -885469925: // payReceive this.payReceive_Renamed = (PayReceive)newValue; break; case 304659814: // accrualSchedule this.accrualSchedule_Renamed = (PeriodicSchedule)newValue; break; case -1499086147: // paymentSchedule this.paymentSchedule_Renamed = (PaymentSchedule)newValue; break; case 1447860727: // notionalSchedule this.notionalSchedule_Renamed = (NotionalSchedule)newValue; break; case -934682935: // calculation this.calculation_Renamed = (RateCalculation)newValue; break; default: throw new NoSuchElementException("Unknown property: " + propertyName); } return(this); }
//----------------------------------------------------------------------- public virtual void floatingSwapLeg() { // a PeriodicSchedule generates a schedule of accrual periods // - interest is accrued every 6 months from 2014-02-12 to 2014-07-31 // - accrual period dates are adjusted "modified following" using the "GBLO" holiday calendar // - there will be a long initial stub // - the regular accrual period dates will be at the end-of-month PeriodicSchedule accrualSchedule = PeriodicSchedule.builder().startDate(LocalDate.of(2014, 2, 12)).endDate(LocalDate.of(2016, 7, 31)).businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, HolidayCalendarIds.GBLO)).frequency(Frequency.P6M).stubConvention(StubConvention.LONG_INITIAL).rollConvention(RollConventions.EOM).build(); // a PaymentSchedule generates a schedule of payment periods, based on the accrual schedule // - payments are every 6 months // - payments are 2 business days after the end of the period // - no compounding is needed as the payment schedule matches the accrual schedule PaymentSchedule paymentSchedule = PaymentSchedule.builder().paymentFrequency(Frequency.P6M).paymentRelativeTo(PaymentRelativeTo.PERIOD_END).paymentDateOffset(DaysAdjustment.ofBusinessDays(2, HolidayCalendarIds.GBLO)).build(); // a NotionalSchedule generates a schedule of notional amounts, based on the payment schedule // - in this simple case the notional is 1 million GBP and does not change NotionalSchedule notionalSchedule = NotionalSchedule.of(Currency.GBP, 1_000_000); // a RateCalculationSwapLeg can represent a fixed or floating swap leg // - an IborRateCalculation is used to represent a floating Ibor rate // - the "Act/Act ISDA" day count is used // - the index is GBP LIBOR 6M // - fixing is 2 days before the start of the period using the "GBLO" holiday calendar RateCalculationSwapLeg swapLeg = RateCalculationSwapLeg.builder().payReceive(PayReceive.RECEIVE).accrualSchedule(accrualSchedule).paymentSchedule(paymentSchedule).notionalSchedule(notionalSchedule).calculation(IborRateCalculation.builder().dayCount(DayCounts.ACT_ACT_ISDA).index(IborIndices.GBP_LIBOR_6M).fixingRelativeTo(FixingRelativeTo.PERIOD_START).fixingDateOffset(DaysAdjustment.ofBusinessDays(-2, HolidayCalendarIds.GBLO)).build()).build(); // a ResolvedSwapLeg has all the dates of the cash flows // it remains valid so long as the holiday calendar does not change ResolvedSwapLeg resolvedLeg = swapLeg.resolve(ReferenceData.standard()); Console.WriteLine("===== Floating ====="); Console.WriteLine(JodaBeanSer.PRETTY.xmlWriter().write(swapLeg)); Console.WriteLine(); Console.WriteLine("===== Floating resolved ====="); Console.WriteLine(JodaBeanSer.PRETTY.xmlWriter().write(resolvedLeg)); Console.WriteLine(); }
//------------------------------------------------------------------------- // accrual schedule private static PeriodicSchedule parseAccrualSchedule(CsvRow row, string leg) { PeriodicSchedule.Builder builder = PeriodicSchedule.builder(); // basics builder.startDate(LoaderUtils.parseDate(getValueWithFallback(row, leg, START_DATE_FIELD))); builder.endDate(LoaderUtils.parseDate(getValueWithFallback(row, leg, END_DATE_FIELD))); builder.frequency(Frequency.parse(getValue(row, leg, FREQUENCY_FIELD))); // adjustments BusinessDayAdjustment dateAdj = parseBusinessDayAdjustment(row, leg, DATE_ADJ_CNV_FIELD, DATE_ADJ_CAL_FIELD).orElse(BusinessDayAdjustment.NONE); Optional <BusinessDayAdjustment> startDateAdj = parseBusinessDayAdjustment(row, leg, START_DATE_CNV_FIELD, START_DATE_CAL_FIELD); Optional <BusinessDayAdjustment> endDateAdj = parseBusinessDayAdjustment(row, leg, END_DATE_CNV_FIELD, END_DATE_CAL_FIELD); builder.businessDayAdjustment(dateAdj); if (startDateAdj.Present && !startDateAdj.get().Equals(dateAdj)) { builder.startDateBusinessDayAdjustment(startDateAdj.get()); } if (endDateAdj.Present && !endDateAdj.get().Equals(dateAdj)) { builder.endDateBusinessDayAdjustment(endDateAdj.get()); } // optionals builder.stubConvention(findValueWithFallback(row, leg, STUB_CONVENTION_FIELD).map(s => StubConvention.of(s)).orElse(StubConvention.SMART_INITIAL)); findValue(row, leg, ROLL_CONVENTION_FIELD).map(s => LoaderUtils.parseRollConvention(s)).ifPresent(v => builder.rollConvention(v)); findValue(row, leg, FIRST_REGULAR_START_DATE_FIELD).map(s => LoaderUtils.parseDate(s)).ifPresent(v => builder.firstRegularStartDate(v)); findValue(row, leg, LAST_REGULAR_END_DATE_FIELD).map(s => LoaderUtils.parseDate(s)).ifPresent(v => builder.lastRegularEndDate(v)); parseAdjustableDate(row, leg, OVERRIDE_START_DATE_FIELD, OVERRIDE_START_DATE_CNV_FIELD, OVERRIDE_START_DATE_CAL_FIELD).ifPresent(d => builder.overrideStartDate(d)); return(builder.build()); }
public void TestTwoSeconds() { SchedulerTester.WaitForStartOfSecond(true); SchedulerTester schedulerTester = new SchedulerTester(); PeriodicSchedule schedule = new PeriodicSchedule( hour: Hour.Every, minute: Minute.Every, second: Second.EveryTwoSeconds); List <TimeSpan> expectedResults = new List <TimeSpan> { new TimeSpan(0, 0, 2), new TimeSpan(0, 0, 4), new TimeSpan(0, 0, 6), new TimeSpan(0, 0, 8), new TimeSpan(0, 0, 10), new TimeSpan(0, 0, 12), new TimeSpan(0, 0, 14), new TimeSpan(0, 0, 16), new TimeSpan(0, 0, 18) }; schedulerTester.AddTest(schedule, expectedResults); schedulerTester.Run(); }
//----------------------------------------------------------------------- public virtual void fixedSwapLeg() { // a PeriodicSchedule generates a schedule of accrual periods // - interest is accrued every 3 months from 2014-02-12 to 2014-07-31 // - accrual period dates are adjusted "modified following" using the "GBLO" holiday calendar // - there will be a long initial stub // - the regular accrual period dates will be at the end-of-month PeriodicSchedule accrualSchedule = PeriodicSchedule.builder().startDate(LocalDate.of(2014, 2, 12)).endDate(LocalDate.of(2016, 7, 31)).businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, HolidayCalendarIds.GBLO)).frequency(Frequency.P3M).stubConvention(StubConvention.LONG_INITIAL).rollConvention(RollConventions.EOM).build(); // a PaymentSchedule generates a schedule of payment periods, based on the accrual schedule // - payments are every 6 months // - payments are 2 business days after the end of the period // - straight compounding is used (the payments are less frequent than the accrual, so compounding occurs) PaymentSchedule paymentSchedule = PaymentSchedule.builder().paymentFrequency(Frequency.P6M).paymentRelativeTo(PaymentRelativeTo.PERIOD_END).paymentDateOffset(DaysAdjustment.ofBusinessDays(2, HolidayCalendarIds.GBLO)).compoundingMethod(CompoundingMethod.STRAIGHT).build(); // a NotionalSchedule generates a schedule of notional amounts, based on the payment schedule // - in this simple case the notional is 1 million GBP and does not change NotionalSchedule notionalSchedule = NotionalSchedule.of(Currency.GBP, 1_000_000); // a RateCalculationSwapLeg can represent a fixed or floating swap leg // - a FixedRateCalculation is used to represent a fixed rate // - the "Act/Act ISDA" day count is used // - the rate starts at 0.8% and reduces to 0.7% RateCalculationSwapLeg swapLeg = RateCalculationSwapLeg.builder().payReceive(PayReceive.PAY).accrualSchedule(accrualSchedule).paymentSchedule(paymentSchedule).notionalSchedule(notionalSchedule).calculation(FixedRateCalculation.builder().dayCount(DayCounts.ACT_ACT_ISDA).rate(ValueSchedule.of(0.008, ValueStep.of(LocalDate.of(2015, 1, 31), ValueAdjustment.ofReplace(0.007)))).build()).build(); // a ResolvedSwapLeg has all the dates of the cash flows // it remains valid so long as the holiday calendar does not change ResolvedSwapLeg resolvedLeg = swapLeg.resolve(ReferenceData.standard()); Console.WriteLine("===== Fixed ====="); Console.WriteLine(JodaBeanSer.PRETTY.xmlWriter().write(swapLeg)); Console.WriteLine(); Console.WriteLine("===== Fixed resolved ====="); Console.WriteLine(JodaBeanSer.PRETTY.xmlWriter().write(resolvedLeg)); Console.WriteLine(); }
public void TestFunctionPause() { SchedulerTester.WaitForStartOfSecond(); SchedulerTester schedulerTester = new SchedulerTester(); PeriodicSchedule schedule = new PeriodicSchedule(hour: Hour.Every, minute: Minute.Every, second: Second.Every); List <TimeSpan> expectedResults = new List <TimeSpan> { new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 3), new TimeSpan(0, 0, 5), new TimeSpan(0, 0, 7), new TimeSpan(0, 0, 9) }; schedulerTester.AddTest(schedule, expectedResults, delegate { DateTime resultTime = DateTime.UtcNow; Scheduler.DisableAll(); Thread.Sleep(1500); Scheduler.EnableAll(); return(resultTime); }); schedulerTester.Run(); }
public void TestStartEnabled() { SchedulerTester.WaitForStartOfSecond(); SchedulerTester schedulerTester = new SchedulerTester(); PeriodicSchedule schedule = new PeriodicSchedule(hour: Hour.Every, minute: Minute.Every, second: Second.Every); List <TimeSpan> expectedResults = new List <TimeSpan> { new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 2), new TimeSpan(0, 0, 3), new TimeSpan(0, 0, 4), new TimeSpan(0, 0, 5), new TimeSpan(0, 0, 6), new TimeSpan(0, 0, 7), new TimeSpan(0, 0, 8), new TimeSpan(0, 0, 9) }; schedulerTester.SetStartTime(); schedulerTester.AddTest(Scheduler.Add <DateTime>(schedule, SchedulerTester.TestFunction, enabled: true), expectedResults); while (!schedulerTester.Completed()) { Thread.Sleep(10); } schedulerTester.Stop(); schedulerTester.CheckResults(); }
static BondFuturesJpyEnd2EndTest() { for (int i = 0; i < NB_UND_BONDS; ++i) { PeriodicSchedule periodSchedule = PeriodicSchedule.of(START_DATE[i], MATURITY_DATE[i], Frequency.P6M, BUSINESS_ADJUST, StubConvention.SHORT_INITIAL, false); FixedCouponBond product = FixedCouponBond.builder().securityId(SecurityId.of(BOND_SECURITY_ID[i])).dayCount(DAY_COUNT).fixedRate(UND_RATES[i] * ONE_PERCENT).legalEntityId(ISSUER_ID).currency(JPY).notional(NOTIONAL).accrualSchedule(periodSchedule).settlementDateOffset(SETTLEMENT_DAYS).yieldConvention(YIELD_CONVENTION).build(); UND_BOND[i] = product; } UND_BOND_SEP = new FixedCouponBond[NB_UND_BONDS - 2]; Array.Copy(UND_BOND, 2, UND_BOND_SEP, 0, NB_UND_BONDS - 2); UND_BOND_JUN = new FixedCouponBond[NB_UND_BONDS - 1]; Array.Copy(UND_BOND, 1, UND_BOND_JUN, 0, NB_UND_BONDS - 1); double[] timeIssuer = new double[] { 0.25136612021857924, 0.4972677595628415, 1.0139980537465378, 2.013998053746538, 2.857833670184894, 3.857833670184894, 4.860655737704918, 5.857833670184894, 7.104409012650647, 7.857833670184894, 8.857923497267759, 9.863313122239688, 14.857833670184894, 19.857833670184895, 29.857833670184895, 39.11262819073284 }; double[] rateIssuer = new double[] { -0.0013117084834668065, -0.0010851901424876163, -0.0020906775838723216, -0.0022137102045172784, -0.0022695678374162888, -0.0023424568490920798, -0.0021603059162879916, -0.0021667343131861225, -0.0018285921969274823, -0.001355094018965514, -6.763044056712535E-4, 1.9555294306801752E-4, 0.003944125562941363, 0.008054233458390252, 0.012276105941434846, 0.013537766297065804 }; double[] timeRepo = new double[] { 0.00273224043715847, 0.01912568306010929, 0.040983606557377046, 0.05737704918032787, 0.07923497267759563, 0.2459016393442623, 0.4972677595628415, 1.0002994236095515 }; double[] rateRepo = new double[] { 2.599662058772748E-4, -8.403529976927196E-4, -0.0010105103936934236, -0.0011506617573950931, -0.0012708071334455143, -0.00146106683851595, -0.0014710815100096722, -0.001481096281798276 }; CurveMetadata metaIssuer = Curves.zeroRates(ISSUER_CURVE_NAME, ACT_ACT_ISDA); InterpolatedNodalCurve curveIssuer = InterpolatedNodalCurve.of(metaIssuer, DoubleArray.copyOf(timeIssuer), DoubleArray.copyOf(rateIssuer), INTERPOLATOR); DiscountFactors dscIssuer = ZeroRateDiscountFactors.of(JPY, VALUATION, curveIssuer); CurveMetadata metaRepo = Curves.zeroRates(REPO_CURVE_NAME, ACT_ACT_ISDA); InterpolatedNodalCurve curve = InterpolatedNodalCurve.of(metaRepo, DoubleArray.copyOf(timeRepo), DoubleArray.copyOf(rateRepo), INTERPOLATOR); DiscountFactors dscRepo = ZeroRateDiscountFactors.of(JPY, VALUATION, curve); LED_PROVIDER = ImmutableLegalEntityDiscountingProvider.builder().issuerCurves(ImmutableMap.of(Pair.of(GROUP_ISSUER, JPY), dscIssuer)).issuerCurveGroups(ImmutableMap.of(ISSUER_ID, GROUP_ISSUER)).repoCurves(ImmutableMap.of(Pair.of(GROUP_REPO, JPY), dscRepo)).repoCurveGroups(ImmutableMap.of(ISSUER_ID, GROUP_REPO)).build(); }
/// <summary> /// Restricted copy constructor. </summary> /// <param name="beanToCopy"> the bean to copy from, not null </param> internal Builder(KnownAmountSwapLeg beanToCopy) { this.payReceive_Renamed = beanToCopy.PayReceive; this.accrualSchedule_Renamed = beanToCopy.AccrualSchedule; this.paymentSchedule_Renamed = beanToCopy.PaymentSchedule; this.amount_Renamed = beanToCopy.Amount; this.currency_Renamed = beanToCopy.Currency; }
public virtual void test_withDefinition() { PeriodicSchedule defn = PeriodicSchedule.of(date(2014, 6, 30), date(2014, 8, 30), Frequency.P1M, BusinessDayAdjustment.NONE, StubConvention.NONE, false); ScheduleException test = new ScheduleException(defn, "Hello {}", "World"); assertEquals(test.Message, "Hello World"); assertEquals(test.Definition, defn); }
/// <summary> /// Restricted copy constructor. </summary> /// <param name="beanToCopy"> the bean to copy from, not null </param> internal Builder(RateCalculationSwapLeg beanToCopy) { this.payReceive_Renamed = beanToCopy.PayReceive; this.accrualSchedule_Renamed = beanToCopy.AccrualSchedule; this.paymentSchedule_Renamed = beanToCopy.PaymentSchedule; this.notionalSchedule_Renamed = beanToCopy.NotionalSchedule; this.calculation_Renamed = beanToCopy.Calculation; }
// parse a single leg private static RateCalculationSwapLeg parseLeg(CsvRow row, string leg, FloatingRateIndex index, DayCount defaultFixedLegDayCount) { PayReceive payReceive = LoaderUtils.parsePayReceive(getValue(row, leg, DIRECTION_FIELD)); PeriodicSchedule accrualSch = parseAccrualSchedule(row, leg); PaymentSchedule paymentSch = parsePaymentSchedule(row, leg, accrualSch.Frequency); NotionalSchedule notionalSch = parseNotionalSchedule(row, leg); RateCalculation calc = parseRateCalculation(row, leg, index, defaultFixedLegDayCount, accrualSch.BusinessDayAdjustment, notionalSch.Currency); return(RateCalculationSwapLeg.builder().payReceive(payReceive).accrualSchedule(accrualSch).paymentSchedule(paymentSch).notionalSchedule(notionalSch).calculation(calc).build()); }
public void TestTwoSchedulers() { SchedulerTester.WaitForStartOfSecond(); SchedulerTester schedulerTester = new SchedulerTester(); PeriodicSchedule schedule = new PeriodicSchedule(hour: Hour.Every, minute: Minute.Every, second: Second.Every); List <TimeSpan> expectedResults = new List <TimeSpan> { new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 2), new TimeSpan(0, 0, 3), new TimeSpan(0, 0, 4), new TimeSpan(0, 0, 5), new TimeSpan(0, 0, 6), new TimeSpan(0, 0, 7), new TimeSpan(0, 0, 8), new TimeSpan(0, 0, 9) }; schedulerTester.AddTest(schedule, expectedResults); schedule = new PeriodicSchedule(hour: Hour.Every, minute: Minute.Every, second: Second.Every); IScheduledFunction <int> scheduledFunction = Scheduler.Add <int>(schedule, function => function.History.Count() > 0 ? function.History.Last().Result + 1 : 1, enabled: false); Scheduler.Enable(scheduledFunction); schedulerTester.Run(); Scheduler.Disable(scheduledFunction); Queue <ScheduledFunctionResult <int> > results = new Queue <ScheduledFunctionResult <int> >(scheduledFunction.History); int resultCount = 0; while (results.Count > 0) { resultCount++; if (resultCount > 9) { Assert.Fail("ScheduledFunction<int>: Too many results returned"); break; } Assert.AreEqual(resultCount, results.Dequeue().Result); } if (resultCount < 9) { Assert.Fail("ScheduledFunction<int>: Not enough results returned"); } }
public virtual void test_summarize_irs_weird() { PeriodicSchedule accrual = PeriodicSchedule.of(date(2018, 2, 12), date(2020, 2, 12), Frequency.P3M, BusinessDayAdjustment.NONE, SHORT_INITIAL, false); PaymentSchedule payment = PaymentSchedule.builder().paymentFrequency(Frequency.P3M).paymentDateOffset(DaysAdjustment.NONE).build(); NotionalSchedule notional = NotionalSchedule.of(GBP, ValueSchedule.builder().initialValue(1_000_000).stepSequence(ValueStepSequence.of(date(2018, 8, 12), date(2019, 8, 12), Frequency.P6M, ofDeltaAmount(-50_000))).build()); RateCalculationSwapLeg payLeg = RateCalculationSwapLeg.builder().payReceive(PAY).accrualSchedule(accrual).paymentSchedule(payment).notionalSchedule(notional).calculation(FixedRateCalculation.builder().dayCount(ACT_360).rate(ValueSchedule.builder().initialValue(0.0012).stepSequence(ValueStepSequence.of(date(2018, 8, 12), date(2019, 8, 12), Frequency.P6M, ofDeltaAmount(0.0001))).build()).build()).build(); RateCalculationSwapLeg recLeg = RateCalculationSwapLeg.builder().payReceive(RECEIVE).accrualSchedule(accrual).paymentSchedule(payment).notionalSchedule(notional).calculation(IborRateCalculation.builder().index(IborIndices.GBP_LIBOR_3M).gearing(ValueSchedule.of(1.1)).spread(ValueSchedule.of(0.002)).build()).build(); Swap test = Swap.of(payLeg, recLeg); assertEquals(test.summaryDescription(), "2Y GBP 1mm variable Rec GBP-LIBOR-3M * 1.1 + 0.2% / Pay 0.12% variable : 12Feb18-12Feb20"); }
/// <summary> /// Restricted copy constructor. </summary> /// <param name="beanToCopy"> the bean to copy from, not null </param> internal Builder(IborCapFloorLeg beanToCopy) { this.payReceive_Renamed = beanToCopy.PayReceive; this.paymentSchedule_Renamed = beanToCopy.PaymentSchedule; this.paymentDateOffset_Renamed = beanToCopy.PaymentDateOffset; this.currency_Renamed = beanToCopy.Currency; this.notional_Renamed = beanToCopy.Notional; this.calculation_Renamed = beanToCopy.Calculation; this.capSchedule_Renamed = beanToCopy.capSchedule; this.floorSchedule_Renamed = beanToCopy.floorSchedule; }
public void TestFunctionAdd() { SchedulerTester.WaitForStartOfSecond(); SchedulerTester schedulerTester1 = new SchedulerTester(); SchedulerTester schedulerTester2 = null; PeriodicSchedule schedule = new PeriodicSchedule(hour: Hour.Every, minute: Minute.Every, second: Second.Every); List <TimeSpan> expectedResults = new List <TimeSpan> { new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 2) }; schedulerTester1.AddTest(schedule, expectedResults, delegate { DateTime resultTime = DateTime.UtcNow; if (schedulerTester2 == null) { schedulerTester2 = new SchedulerTester(); schedule = new PeriodicSchedule(hour: Hour.Every, minute: Minute.Every, second: Second.Every); expectedResults = new List <TimeSpan> { new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 2), new TimeSpan(0, 0, 3), new TimeSpan(0, 0, 4) }; schedulerTester2.AddTest(schedule, expectedResults); schedulerTester2.Start(); } return(resultTime); }); schedulerTester1.Run(); while (schedulerTester2 == null || !schedulerTester2.Completed()) { Thread.Sleep(10); } schedulerTester2.Stop(); schedulerTester2.CheckResults(); }
private RateCalculationSwapLeg(PayReceive payReceive, PeriodicSchedule accrualSchedule, PaymentSchedule paymentSchedule, NotionalSchedule notionalSchedule, RateCalculation calculation) { JodaBeanUtils.notNull(payReceive, "payReceive"); JodaBeanUtils.notNull(accrualSchedule, "accrualSchedule"); JodaBeanUtils.notNull(paymentSchedule, "paymentSchedule"); JodaBeanUtils.notNull(notionalSchedule, "notionalSchedule"); JodaBeanUtils.notNull(calculation, "calculation"); this.payReceive = payReceive; this.accrualSchedule = accrualSchedule; this.paymentSchedule = paymentSchedule; this.notionalSchedule = notionalSchedule; this.calculation = calculation; }
private KnownAmountSwapLeg(PayReceive payReceive, PeriodicSchedule accrualSchedule, PaymentSchedule paymentSchedule, ValueSchedule amount, Currency currency) { JodaBeanUtils.notNull(payReceive, "payReceive"); JodaBeanUtils.notNull(accrualSchedule, "accrualSchedule"); JodaBeanUtils.notNull(paymentSchedule, "paymentSchedule"); JodaBeanUtils.notNull(amount, "amount"); JodaBeanUtils.notNull(currency, "currency"); this.payReceive = payReceive; this.accrualSchedule = accrualSchedule; this.paymentSchedule = paymentSchedule; this.amount = amount; this.currency = currency; }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @ImmutableConstructor private IborCapFloorLeg(com.opengamma.strata.product.common.PayReceive payReceive, com.opengamma.strata.basics.schedule.PeriodicSchedule paymentSchedule, com.opengamma.strata.basics.date.DaysAdjustment paymentDateOffset, com.opengamma.strata.basics.currency.Currency currency, com.opengamma.strata.basics.value.ValueSchedule notional, com.opengamma.strata.product.swap.IborRateCalculation calculation, com.opengamma.strata.basics.value.ValueSchedule capSchedule, com.opengamma.strata.basics.value.ValueSchedule floorSchedule) private IborCapFloorLeg(PayReceive payReceive, PeriodicSchedule paymentSchedule, DaysAdjustment paymentDateOffset, Currency currency, ValueSchedule notional, IborRateCalculation calculation, ValueSchedule capSchedule, ValueSchedule floorSchedule) { this.payReceive = ArgChecker.notNull(payReceive, "payReceive"); this.paymentSchedule = ArgChecker.notNull(paymentSchedule, "paymentSchedule"); this.paymentDateOffset = ArgChecker.notNull(paymentDateOffset, "paymentDateOffset"); this.currency = currency != null ? currency : calculation.Index.Currency; this.notional = notional; this.calculation = ArgChecker.notNull(calculation, "calculation"); this.capSchedule = capSchedule; this.floorSchedule = floorSchedule; ArgChecker.isTrue(!this.PaymentSchedule.StubConvention.Present || this.PaymentSchedule.StubConvention.get().Equals(StubConvention.NONE), "Stub period is not allowed"); ArgChecker.isFalse(this.CapSchedule.Present == this.FloorSchedule.Present, "One of cap schedule and floor schedule should be empty"); ArgChecker.isTrue(this.Calculation.Index.Tenor.Period.Equals(this.PaymentSchedule.Frequency.Period), "Payment frequency period should be the same as index tenor period"); }
private static Trade createTrade1() { NotionalSchedule notional = NotionalSchedule.of(Currency.USD, 12_000_000); PeriodicSchedule accrual = PeriodicSchedule.builder().startDate(LocalDate.of(2006, 2, 24)).endDate(LocalDate.of(2011, 2, 24)).frequency(Frequency.P3M).businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, HolidayCalendarIds.USNY)).build(); PaymentSchedule payment = PaymentSchedule.builder().paymentFrequency(Frequency.P3M).paymentDateOffset(DaysAdjustment.ofBusinessDays(2, HolidayCalendarIds.USNY)).build(); SwapLeg payLeg = RateCalculationSwapLeg.builder().payReceive(PayReceive.PAY).accrualSchedule(accrual).paymentSchedule(payment).notionalSchedule(notional).calculation(FixedRateCalculation.of(0.05004, DayCounts.ACT_360)).build(); SwapLeg receiveLeg = RateCalculationSwapLeg.builder().payReceive(PayReceive.RECEIVE).accrualSchedule(accrual).paymentSchedule(payment).notionalSchedule(notional).calculation(IborRateCalculation.of(IborIndices.USD_LIBOR_3M)).build(); return(SwapTrade.builder().product(Swap.builder().legs(payLeg, receiveLeg).build()).info(TradeInfo.builder().id(StandardId.of("mn", "14248")).counterparty(StandardId.of("mn", "Dealer A")).settlementDate(LocalDate.of(2006, 2, 24)).build()).build()); }
public void TestDisable() { SchedulerTester.WaitForStartOfSecond(); SchedulerTester schedulerTester = new SchedulerTester(); PeriodicSchedule schedule = new PeriodicSchedule(hour: Hour.Every, minute: Minute.Every, second: Second.Every); List <TimeSpan> expectedResults = new List <TimeSpan> { new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 2), new TimeSpan(0, 0, 3), new TimeSpan(0, 0, 4), new TimeSpan(0, 0, 5), new TimeSpan(0, 0, 6), new TimeSpan(0, 0, 7), new TimeSpan(0, 0, 8), new TimeSpan(0, 0, 9) }; schedulerTester.AddTest(schedule, expectedResults); schedule = new PeriodicSchedule(hour: Hour.Every, minute: Minute.Every, second: Second.Every); expectedResults = new List <TimeSpan> { new TimeSpan(0, 0, 6), new TimeSpan(0, 0, 7), new TimeSpan(0, 0, 8), new TimeSpan(0, 0, 9) }; IScheduledFunction <DateTime> scheduledFunction = schedulerTester.AddTest(schedule, expectedResults); schedulerTester.Start(); Thread.Sleep(200); Scheduler.Disable(scheduledFunction); Thread.Sleep(6000); Scheduler.Enable(scheduledFunction); while (!schedulerTester.Completed()) { Thread.Sleep(10); } schedulerTester.Stop(); schedulerTester.CheckResults(); }
//------------------------------------------------------------------------- public PortfolioItemSummary summarize() { // 2Y Buy USD 1mm INDEX / 1.5% : 21Jan18-21Jan20 PeriodicSchedule paymentSchedule = product.PaymentSchedule; StringBuilder buf = new StringBuilder(96); buf.Append(SummarizerUtils.datePeriod(paymentSchedule.StartDate, paymentSchedule.EndDate)); buf.Append(' '); buf.Append(product.BuySell); buf.Append(' '); buf.Append(SummarizerUtils.amount(product.Currency, product.Notional)); buf.Append(' '); buf.Append(product.CdsIndexId.Value); buf.Append(" / "); buf.Append(SummarizerUtils.percent(product.FixedRate)); buf.Append(" : "); buf.Append(SummarizerUtils.dateRange(paymentSchedule.StartDate, paymentSchedule.EndDate)); return(SummarizerUtils.summary(this, ProductType.CDS_INDEX, buf.ToString(), product.Currency)); }
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_STD.PaymentSchedule, expected); assertEquals(PRODUCT_STD.BuySell, BUY); assertEquals(PRODUCT_STD.Currency, USD); assertEquals(PRODUCT_STD.DayCount, ACT_360); assertEquals(PRODUCT_STD.FixedRate, COUPON); assertEquals(PRODUCT_STD.LegalEntityId, LEGAL_ENTITY); assertEquals(PRODUCT_STD.Notional, NOTIONAL); assertEquals(PRODUCT_STD.PaymentOnDefault, ACCRUED_PREMIUM); assertEquals(PRODUCT_STD.ProtectionStart, BEGINNING); assertEquals(PRODUCT_STD.SettlementDateOffset, SETTLE_DAY_ADJ); assertEquals(PRODUCT_STD.StepinDateOffset, STEPIN_DAY_ADJ); Cds test = Cds.of(BUY, LEGAL_ENTITY, USD, NOTIONAL, START_DATE, END_DATE, P3M, SAT_SUN, COUPON); assertEquals(test, PRODUCT_STD); }
public void TestMinimumGap1() { SchedulerTester.WaitForStartOfSecond(); SchedulerTester schedulerTester = new SchedulerTester(); PeriodicSchedule schedule = new PeriodicSchedule(hour: Hour.Every, minute: Minute.Every, second: Second.Every, minimumGap: TimeSpan.FromSeconds(2)); List <TimeSpan> expectedResults = new List <TimeSpan> { new TimeSpan(0, 0, 3), new TimeSpan(0, 0, 6), new TimeSpan(0, 0, 9), new TimeSpan(0, 0, 12), new TimeSpan(0, 0, 15) }; schedulerTester.AddTest(schedule, expectedResults); schedulerTester.Run(); }
public override Builder set(string propertyName, object newValue) { switch (propertyName.GetHashCode()) { case -885469925: // payReceive this.payReceive_Renamed = (PayReceive)newValue; break; case -1499086147: // paymentSchedule this.paymentSchedule_Renamed = (PeriodicSchedule)newValue; break; case -716438393: // paymentDateOffset this.paymentDateOffset_Renamed = (DaysAdjustment)newValue; break; case 575402001: // currency this.currency_Renamed = (Currency)newValue; break; case 1585636160: // notional this.notional_Renamed = (ValueSchedule)newValue; break; case -934682935: // calculation this.calculation_Renamed = (IborRateCalculation)newValue; break; case -596212599: // capSchedule this.capSchedule_Renamed = (ValueSchedule)newValue; break; case -1562227005: // floorSchedule this.floorSchedule_Renamed = (ValueSchedule)newValue; break; default: throw new NoSuchElementException("Unknown property: " + propertyName); } return(this); }
public void TestExecuteImmediately1() { SchedulerTester.WaitForStartOfSecond(true); SchedulerTester schedulerTester = new SchedulerTester(); PeriodicSchedule schedule = new PeriodicSchedule(hour: Hour.Every, minute: Minute.Every, second: Second.EveryOtherSecond); List <TimeSpan> expectedResults = new List <TimeSpan> { new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 3), new TimeSpan(0, 0, 5), new TimeSpan(0, 0, 7), new TimeSpan(0, 0, 9) }; schedulerTester.AddTest( Scheduler.Add <DateTime>(schedule, SchedulerTester.TestFunction, enabled: false, executeImmediately: false), expectedResults); schedulerTester.Run(); }
// parses the swap internal Swap parseSwap(FpmlDocument document, XmlElement tradeEl, TradeInfoBuilder tradeInfoBuilder) { XmlElement swapEl = tradeEl.getChild("swap"); ImmutableList <XmlElement> legEls = swapEl.getChildren("swapStream"); ImmutableList.Builder <SwapLeg> legsBuilder = ImmutableList.builder(); foreach (XmlElement legEl in legEls) { // calculation XmlElement calcPeriodAmountEl = legEl.getChild("calculationPeriodAmount"); XmlElement calcEl = calcPeriodAmountEl.findChild("calculation").orElse(XmlElement.ofChildren("calculation", ImmutableList.of())); PeriodicSchedule accrualSchedule = parseSwapAccrualSchedule(legEl, document); PaymentSchedule paymentSchedule = parseSwapPaymentSchedule(legEl, calcEl, document); // known amount or rate calculation Optional <XmlElement> knownAmountOptEl = calcPeriodAmountEl.findChild("knownAmountSchedule"); if (knownAmountOptEl.Present) { XmlElement knownAmountEl = knownAmountOptEl.get(); document.validateNotPresent(legEl, "stubCalculationPeriodAmount"); document.validateNotPresent(legEl, "resetDates"); // pay/receive and counterparty PayReceive payReceive = document.parsePayerReceiver(legEl, tradeInfoBuilder); ValueSchedule amountSchedule = parseSchedule(knownAmountEl, document); // build legsBuilder.add(KnownAmountSwapLeg.builder().payReceive(payReceive).accrualSchedule(accrualSchedule).paymentSchedule(paymentSchedule).amount(amountSchedule).currency(document.parseCurrency(knownAmountEl.getChild("currency"))).build()); } else { document.validateNotPresent(calcEl, "fxLinkedNotionalSchedule"); document.validateNotPresent(calcEl, "futureValueNotional"); // pay/receive and counterparty PayReceive payReceive = document.parsePayerReceiver(legEl, tradeInfoBuilder); NotionalSchedule notionalSchedule = parseSwapNotionalSchedule(legEl, calcEl, document); RateCalculation calculation = parseSwapCalculation(legEl, calcEl, accrualSchedule, document); // build legsBuilder.add(RateCalculationSwapLeg.builder().payReceive(payReceive).accrualSchedule(accrualSchedule).paymentSchedule(paymentSchedule).notionalSchedule(notionalSchedule).calculation(calculation).build()); } } return(Swap.of(legsBuilder.build())); }
public virtual void test_builder() { LocalDate startDate = LocalDate.of(2014, 12, 20); LocalDate endDate = LocalDate.of(2020, 10, 20); PeriodicSchedule sch = PeriodicSchedule.of(startDate, endDate, P3M, BusinessDayAdjustment.NONE, SHORT_INITIAL, RollConventions.NONE); Cds test = Cds.builder().paymentSchedule(sch).buySell(SELL).currency(JPY).dayCount(ACT_365F).fixedRate(COUPON).legalEntityId(LEGAL_ENTITY).notional(NOTIONAL).paymentOnDefault(PaymentOnDefault.NONE).protectionStart(ProtectionStartOfDay.NONE).settlementDateOffset(SETTLE_DAY_ADJ).stepinDateOffset(STEPIN_DAY_ADJ).build(); assertEquals(test.PaymentSchedule, sch); assertEquals(test.BuySell, SELL); assertEquals(test.Currency, JPY); assertEquals(test.DayCount, ACT_365F); assertEquals(test.FixedRate, COUPON); assertEquals(test.LegalEntityId, LEGAL_ENTITY); assertEquals(test.Notional, NOTIONAL); assertEquals(test.PaymentOnDefault, PaymentOnDefault.NONE); assertEquals(test.ProtectionStart, ProtectionStartOfDay.NONE); assertEquals(test.SettlementDateOffset, SETTLE_DAY_ADJ); assertEquals(test.StepinDateOffset, STEPIN_DAY_ADJ); assertEquals(test.CrossCurrency, false); assertEquals(test.allPaymentCurrencies(), ImmutableSet.of(JPY)); assertEquals(test.allCurrencies(), ImmutableSet.of(JPY)); }
public void TestMinimumGap2() { SchedulerTester.WaitForStartOfSecond(); SchedulerTester schedulerTester = new SchedulerTester(); PeriodicSchedule schedule = new PeriodicSchedule(hour: Hour.Every, minute: Minute.Every, second: Second.Every, minimumGap: TimeSpan.FromSeconds(2)); List <TimeSpan> expectedResults = new List <TimeSpan> { TimeSpan.MinValue, // Immediate execution new TimeSpan(0, 0, 3), new TimeSpan(0, 0, 6), new TimeSpan(0, 0, 9), new TimeSpan(0, 0, 12), new TimeSpan(0, 0, 15) }; schedulerTester.AddTest( Scheduler.Add <DateTime>(schedule, SchedulerTester.TestFunction, enabled: false, executeImmediately: true), expectedResults); schedulerTester.Run(); }
public void TestMinimumGap1() { SchedulerTester.WaitForStartOfSecond(); SchedulerTester schedulerTester = new SchedulerTester(); PeriodicSchedule schedule = new PeriodicSchedule(hour: Hour.Every, minute: Minute.Every, second: Second.Every, minimumGap: TimeSpan.FromSeconds(2)); List<TimeSpan> expectedResults = new List<TimeSpan> { new TimeSpan(0, 0, 3), new TimeSpan(0, 0, 6), new TimeSpan(0, 0, 9), new TimeSpan(0, 0, 12), new TimeSpan(0, 0, 15) }; schedulerTester.AddTest(schedule, expectedResults); schedulerTester.Run(); }
public void TestSharedSchedule() { SchedulerTester.WaitForStartOfSecond(true); SchedulerTester schedulerTester = new SchedulerTester(); PeriodicSchedule schedule = new PeriodicSchedule( hour: Hour.Every, minute: Minute.Every, second: Second.Every); List<TimeSpan> expectedResults = new List<TimeSpan> { new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 2), new TimeSpan(0, 0, 3), new TimeSpan(0, 0, 4), new TimeSpan(0, 0, 5), new TimeSpan(0, 0, 6), new TimeSpan(0, 0, 7), new TimeSpan(0, 0, 8), new TimeSpan(0, 0, 9) }; schedulerTester.AddTest(schedule, expectedResults); expectedResults = new List<TimeSpan> { new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 2), new TimeSpan(0, 0, 3), new TimeSpan(0, 0, 4), new TimeSpan(0, 0, 5), new TimeSpan(0, 0, 6), new TimeSpan(0, 0, 7), new TimeSpan(0, 0, 8), new TimeSpan(0, 0, 9) }; schedulerTester.AddTest(schedule, expectedResults); schedulerTester.Run(); }
public void TestMinimumGap2() { SchedulerTester.WaitForStartOfSecond(); SchedulerTester schedulerTester = new SchedulerTester(); PeriodicSchedule schedule = new PeriodicSchedule(hour: Hour.Every, minute: Minute.Every, second: Second.Every, minimumGap: TimeSpan.FromSeconds(2)); List<TimeSpan> expectedResults = new List<TimeSpan> { TimeSpan.MinValue, // Immediate execution new TimeSpan(0, 0, 3), new TimeSpan(0, 0, 6), new TimeSpan(0, 0, 9), new TimeSpan(0, 0, 12), new TimeSpan(0, 0, 15) }; schedulerTester.AddTest( Scheduler.Add<DateTime>(schedule, SchedulerTester.TestFunction, enabled: false, executeImmediately: true), expectedResults); schedulerTester.Run(); }
public void TestExecuteImmediately1() { SchedulerTester.WaitForStartOfSecond(true); SchedulerTester schedulerTester = new SchedulerTester(); PeriodicSchedule schedule = new PeriodicSchedule(hour: Hour.Every, minute: Minute.Every, second: Second.EveryOtherSecond); List<TimeSpan> expectedResults = new List<TimeSpan> { new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 3), new TimeSpan(0, 0, 5), new TimeSpan(0, 0, 7), new TimeSpan(0, 0, 9) }; schedulerTester.AddTest( Scheduler.Add<DateTime>(schedule, SchedulerTester.TestFunction, enabled: false, executeImmediately: false), expectedResults); schedulerTester.Run(); }
public void TestTwoSchedulers() { SchedulerTester.WaitForStartOfSecond(); SchedulerTester schedulerTester = new SchedulerTester(); PeriodicSchedule schedule = new PeriodicSchedule(hour: Hour.Every, minute: Minute.Every, second: Second.Every); List<TimeSpan> expectedResults = new List<TimeSpan> { new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 2), new TimeSpan(0, 0, 3), new TimeSpan(0, 0, 4), new TimeSpan(0, 0, 5), new TimeSpan(0, 0, 6), new TimeSpan(0, 0, 7), new TimeSpan(0, 0, 8), new TimeSpan(0, 0, 9) }; schedulerTester.AddTest(schedule, expectedResults); schedule = new PeriodicSchedule(hour: Hour.Every, minute: Minute.Every, second: Second.Every); IScheduledFunction<int> scheduledFunction = Scheduler.Add<int>(schedule, function => function.History.Count() > 0 ? function.History.Last().Result + 1 : 1, enabled: false); Scheduler.Enable(scheduledFunction); schedulerTester.Run(); Scheduler.Disable(scheduledFunction); Queue<ScheduledFunctionResult<int>> results = new Queue<ScheduledFunctionResult<int>>(scheduledFunction.History); int resultCount = 0; while (results.Count > 0) { resultCount++; if (resultCount > 9) { Assert.Fail("ScheduledFunction<int>: Too many results returned"); break; } Assert.AreEqual(resultCount, results.Dequeue().Result); } if (resultCount < 9) { Assert.Fail("ScheduledFunction<int>: Not enough results returned"); } }
public void TestStartEnabled() { SchedulerTester.WaitForStartOfSecond(); SchedulerTester schedulerTester = new SchedulerTester(); PeriodicSchedule schedule = new PeriodicSchedule(hour: Hour.Every, minute: Minute.Every, second: Second.Every); List<TimeSpan> expectedResults = new List<TimeSpan> { new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 2), new TimeSpan(0, 0, 3), new TimeSpan(0, 0, 4), new TimeSpan(0, 0, 5), new TimeSpan(0, 0, 6), new TimeSpan(0, 0, 7), new TimeSpan(0, 0, 8), new TimeSpan(0, 0, 9) }; schedulerTester.SetStartTime(); schedulerTester.AddTest(Scheduler.Add<DateTime>(schedule, SchedulerTester.TestFunction, enabled: true), expectedResults); while (!schedulerTester.Completed()) { Thread.Sleep(10); } schedulerTester.Stop(); schedulerTester.CheckResults(); }
public void TestFunctionPause() { SchedulerTester.WaitForStartOfSecond(); SchedulerTester schedulerTester = new SchedulerTester(); PeriodicSchedule schedule = new PeriodicSchedule(hour: Hour.Every, minute: Minute.Every, second: Second.Every); List<TimeSpan> expectedResults = new List<TimeSpan> { new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 3), new TimeSpan(0, 0, 5), new TimeSpan(0, 0, 7), new TimeSpan(0, 0, 9) }; schedulerTester.AddTest(schedule, expectedResults, delegate { DateTime resultTime = DateTime.UtcNow; Scheduler.DisableAll(); Thread.Sleep(1500); Scheduler.EnableAll(); return resultTime; }); schedulerTester.Run(); }
public void TestFunctionAdd() { SchedulerTester.WaitForStartOfSecond(); SchedulerTester schedulerTester1 = new SchedulerTester(); SchedulerTester schedulerTester2 = null; PeriodicSchedule schedule = new PeriodicSchedule(hour: Hour.Every, minute: Minute.Every, second: Second.Every); List<TimeSpan> expectedResults = new List<TimeSpan> { new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 2) }; schedulerTester1.AddTest(schedule, expectedResults, delegate { DateTime resultTime = DateTime.UtcNow; if (schedulerTester2 == null) { schedulerTester2 = new SchedulerTester(); schedule = new PeriodicSchedule(hour: Hour.Every, minute: Minute.Every, second: Second.Every); expectedResults = new List<TimeSpan> { new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 2), new TimeSpan(0, 0, 3), new TimeSpan(0, 0, 4) }; schedulerTester2.AddTest(schedule, expectedResults); schedulerTester2.Start(); } return resultTime; }); schedulerTester1.Run(); while (schedulerTester2 == null || !schedulerTester2.Completed()) { Thread.Sleep(10); } schedulerTester2.Stop(); schedulerTester2.CheckResults(); }
public void TestRemove() { SchedulerTester.WaitForStartOfSecond(); SchedulerTester schedulerTester = new SchedulerTester(); PeriodicSchedule schedule = new PeriodicSchedule(hour: Hour.Every, minute: Minute.Every, second: Second.Every); List<TimeSpan> expectedResults = new List<TimeSpan> { new TimeSpan(0, 0, 1), new TimeSpan(0, 0, 2), new TimeSpan(0, 0, 3), new TimeSpan(0, 0, 4), new TimeSpan(0, 0, 5), new TimeSpan(0, 0, 6), new TimeSpan(0, 0, 7), new TimeSpan(0, 0, 8), new TimeSpan(0, 0, 9) }; schedulerTester.AddTest(schedule, expectedResults); schedule = new PeriodicSchedule(hour: Hour.Every, minute: Minute.Every, second: Second.Every); expectedResults = new List<TimeSpan> { new TimeSpan(0, 0, 1) }; IScheduledFunction<DateTime> scheduledFunction = schedulerTester.AddTest(schedule, expectedResults); schedulerTester.Start(); Thread.Sleep(1500); Scheduler.Remove(scheduledFunction); while (!schedulerTester.Completed()) { Thread.Sleep(10); } schedulerTester.Stop(); schedulerTester.CheckResults(); }
public void TestStartAfter() { SchedulerTester.WaitForStartOfSecond(); SchedulerTester schedulerTester = new SchedulerTester(); DateTime startAfterTime = DateTime.UtcNow.AddSeconds(4); PeriodicSchedule schedule = new PeriodicSchedule(hour: Hour.Every, minute: Minute.Every, second: Second.Every); List<TimeSpan> expectedResults = new List<TimeSpan> { new TimeSpan(0, 0, 5), new TimeSpan(0, 0, 6), new TimeSpan(0, 0, 7), new TimeSpan(0, 0, 8), new TimeSpan(0, 0, 9) }; schedulerTester.AddTest( Scheduler.Add<DateTime>(schedule, SchedulerTester.TestFunction, enabled: false, startAfter: startAfterTime), expectedResults); schedulerTester.Run(); }