本文整理汇总了C#中Schedule.ToRunNow方法的典型用法代码示例。如果您正苦于以下问题:C# Schedule.ToRunNow方法的具体用法?C# Schedule.ToRunNow怎么用?C# Schedule.ToRunNow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Schedule
的用法示例。
在下文中一共展示了Schedule.ToRunNow方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Should_Be_True_By_Default
public void Should_Be_True_By_Default()
{
// Act
var schedule = new Schedule(() => { });
schedule.ToRunNow();
// Assert
Assert.IsTrue(schedule.Reentrant);
}
示例2: Should_Not_Alter_Original_Runtime_If_Chained_Job_Exists
public void Should_Not_Alter_Original_Runtime_If_Chained_Job_Exists()
{
// Act
var schedule = new Schedule(() => { });
schedule.ToRunNow().AndEvery(1).Months();
// Assert
Assert.IsNull(schedule.CalculateNextRun);
}
示例3: Should_Add_Chained_Jobs_To_AdditionalSchedules_Property
public void Should_Add_Chained_Jobs_To_AdditionalSchedules_Property()
{
// Act
var schedule = new Schedule(() => { });
schedule.ToRunNow().AndEvery(1).Months();
// Assert
Assert.AreEqual(1, schedule.AdditionalSchedules.Count);
}
示例4: Should_Remove_Named_Job
public void Should_Remove_Named_Job()
{
// Act
var schedule = new Schedule(() => { }).WithName("remove named job");
schedule.ToRunNow().AndEvery(1).Seconds();
JobManager.RemoveJob("remove named job");
// Assert
Assert.IsNull(JobManager.GetSchedule("remove named job"));
}
示例5: Should_Default_Reentrent_Parameter_For_Child_Schedules
public void Should_Default_Reentrent_Parameter_For_Child_Schedules()
{
// Act
var schedule = new Schedule(() => { });
schedule.ToRunNow().AndEvery(1).Minutes();
// Assert
Assert.IsTrue(schedule.Reentrant);
foreach (var child in schedule.AdditionalSchedules)
Assert.IsTrue(child.Reentrant);
}
示例6: Should_Set_Chained_Job_Schedule_As_Expected
public void Should_Set_Chained_Job_Schedule_As_Expected()
{
// Arrange
var input = new DateTime(2000, 1, 1);
var expected = new DateTime(2000, 3, 1);
// Act
var schedule = new Schedule(() => { });
schedule.ToRunNow().AndEvery(2).Months();
var actual = schedule.AdditionalSchedules.ElementAt(0).CalculateNextRun(input);
// Assert
Assert.AreEqual(expected, actual);
}