当前位置: 首页>>代码示例>>C#>>正文


C# Schedule.ToRunNow方法代码示例

本文整理汇总了C#中FluentScheduler.Model.Schedule.ToRunNow方法的典型用法代码示例。如果您正苦于以下问题:C# Schedule.ToRunNow方法的具体用法?C# Schedule.ToRunNow怎么用?C# Schedule.ToRunNow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FluentScheduler.Model.Schedule的用法示例。


在下文中一共展示了Schedule.ToRunNow方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Should_Not_Alter_Original_Runtime_If_Chained_Task_Exists

 public void Should_Not_Alter_Original_Runtime_If_Chained_Task_Exists()
 {
     var task = new Mock<ITask>();
     var schedule = new Schedule(task.Object);
     schedule.ToRunNow().AndEvery(1).Months();
     Assert.IsNull(schedule.CalculateNextRun);
 }
开发者ID:rooseveltdossantos,项目名称:FluentScheduler,代码行数:7,代码来源:SpecificRunTimeTests.cs

示例2: Should_Add_Chained_Tasks_To_AdditionalSchedules_Property

 public void Should_Add_Chained_Tasks_To_AdditionalSchedules_Property()
 {
     var task = new Mock<ITask>();
     var schedule = new Schedule(task.Object);
     schedule.ToRunNow().AndEvery(1).Months();
     Assert.AreEqual(schedule.AdditionalSchedules.Count, 1);
 }
开发者ID:rooseveltdossantos,项目名称:FluentScheduler,代码行数:7,代码来源:SpecificRunTimeTests.cs

示例3: Should_Be_True_By_Default

        public void Should_Be_True_By_Default()
        {
            var task = new Mock<ITask>();
            var schedule = new Schedule(task.Object);
            schedule.ToRunNow();

            schedule.Reentrant.Should().Be.True();
        }
开发者ID:vinaysingri,项目名称:FluentScheduler,代码行数:8,代码来源:NonReentrantTests.cs

示例4: Should_Set_Chained_Task_Schedule_As_Expected

        public void Should_Set_Chained_Task_Schedule_As_Expected()
        {
            var task = new Mock<ITask>();
            var schedule = new Schedule(task.Object);
            schedule.ToRunNow().AndEvery(2).Months();

            var input = new DateTime(2000, 1, 1);
            var scheduledTime = schedule.AdditionalSchedules.ElementAt(0).CalculateNextRun(input);
            var expectedTime = new DateTime(2000, 3, 1);
            scheduledTime.Should().Equal(expectedTime);
        }
开发者ID:vinaysingri,项目名称:FluentScheduler,代码行数:11,代码来源:SpecificRunTimeTests.cs

示例5: Should_Remove_Named_Task

        public void Should_Remove_Named_Task()
        {
            var task = new Mock<ITask>();
            var name = "ShouldRemoveTask";
            var schedule = new Schedule(task.Object).WithName(name);
            schedule.ToRunNow().AndEvery(1).Seconds();
            TaskManager.RemoveTask(name);

            var taskFromManager = TaskManager.GetSchedule(name);
            Assert.IsNull(taskFromManager);
        }
开发者ID:rooseveltdossantos,项目名称:FluentScheduler,代码行数:11,代码来源:RemoveTests.cs

示例6: Should_Be_True_By_Default

        public void Should_Be_True_By_Default()
        {
            // Arrange
            var task = new Mock<ITask>();

            // Act
            var schedule = new Schedule(task.Object);
            schedule.ToRunNow();

            // Assert
            Assert.IsTrue(schedule.Reentrant);
        }
开发者ID:rsjyh,项目名称:FluentScheduler,代码行数:12,代码来源:NonReentrantTests.cs

示例7: Should_Default_Reentrent_Parameter_For_Child_Schedules

        public void Should_Default_Reentrent_Parameter_For_Child_Schedules()
        {
            var task = new Mock<ITask>();
            var schedule = new Schedule(task.Object);
            schedule.ToRunNow().AndEvery(1).Minutes();

            schedule.Reentrant.Should().Be.True();
            foreach (var child in schedule.AdditionalSchedules)
            {
                child.Reentrant.Should().Be.True();
            }
        }
开发者ID:vinaysingri,项目名称:FluentScheduler,代码行数:12,代码来源:NonReentrantTests.cs

示例8: Should_Remove_Named_Task

        public void Should_Remove_Named_Task()
        {
            // Arrange
            var task = new Mock<ITask>();

            // Act
            var schedule = new Schedule(task.Object).WithName("remove named task");
            schedule.ToRunNow().AndEvery(1).Seconds();
            TaskManager.RemoveTask("remove named task");

            // Assert
            Assert.IsNull(TaskManager.GetSchedule("remove named task"));
        }
开发者ID:rsjyh,项目名称:FluentScheduler,代码行数:13,代码来源:RemoveTests.cs

示例9: Should_Default_Reentrent_Parameter_For_Child_Schedules

        public void Should_Default_Reentrent_Parameter_For_Child_Schedules()
        {
            // Arrange
            var task = new Mock<ITask>();

            // Act
            var schedule = new Schedule(task.Object);
            schedule.ToRunNow().AndEvery(1).Minutes();

            // Assert
            Assert.IsTrue(schedule.Reentrant);
            foreach (var child in schedule.AdditionalSchedules)
                Assert.IsTrue(child.Reentrant);
        }
开发者ID:rsjyh,项目名称:FluentScheduler,代码行数:14,代码来源:NonReentrantTests.cs

示例10: Should_Set_Chained_Task_Schedule_As_Expected

        public void Should_Set_Chained_Task_Schedule_As_Expected()
        {
            // Arrange
            var task = new Mock<ITask>();
            var input = new DateTime(2000, 1, 1);
            var expected = new DateTime(2000, 3, 1);

            // Act
            var schedule = new Schedule(task.Object);
            schedule.ToRunNow().AndEvery(2).Months();
            var actual = schedule.AdditionalSchedules.ElementAt(0).CalculateNextRun(input);

            // Assert
            Assert.AreEqual(expected, actual);
        }
开发者ID:rsjyh,项目名称:FluentScheduler,代码行数:15,代码来源:SpecificRunTimeTests.cs


注:本文中的FluentScheduler.Model.Schedule.ToRunNow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。