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


C# Schedule.ToRunEvery方法代码示例

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


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

示例1: Should_Add_Specified_Days_To_Next_Run_Date

        public void Should_Add_Specified_Days_To_Next_Run_Date()
        {
            var task = new Mock<ITask>();
            var schedule = new Schedule(task.Object);
            schedule.ToRunEvery(1).Days();

            var input = new DateTime(2000, 1, 1, 1, 23, 25);
            var scheduledTime = schedule.CalculateNextRun(input);
            Assert.AreEqual(scheduledTime, input.Date.AddDays(1));
        }
开发者ID:njmube,项目名称:FluentScheduler,代码行数:10,代码来源:DaysTests.cs

示例2: Should_Add_Specified_Years_To_Next_Run_Date_And_Select_Last_Day_In_That_Year

        public void Should_Add_Specified_Years_To_Next_Run_Date_And_Select_Last_Day_In_That_Year()
        {
            var task = new Mock<ITask>();
            var schedule = new Schedule(task.Object);
            schedule.ToRunEvery(2).Years().OnTheLastDay();

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

示例3: Should_Add_Specified_Months_To_Next_Run_Date_And_Select_Last_Day_In_That_Month

        public void Should_Add_Specified_Months_To_Next_Run_Date_And_Select_Last_Day_In_That_Month()
        {
            var task = new Mock<ITask>();
            var schedule = new Schedule(task.Object);
            schedule.ToRunEvery(2).Months().OnTheLastDay();

            var input = new DateTime(2000, 1, 1);
            var scheduledTime = schedule.CalculateNextRun(input);
            var expectedTime = new DateTime(2000, 1, 31);
            Assert.AreEqual(scheduledTime, expectedTime);
        }
开发者ID:njmube,项目名称:FluentScheduler,代码行数:11,代码来源:MonthsOnTheLastDayTests.cs

示例4: Should_Add_Specified_Months_To_Next_Run_Date_And_Select_Specified_Day

        public void Should_Add_Specified_Months_To_Next_Run_Date_And_Select_Specified_Day()
        {
            var task = new Mock<ITask>();
            var schedule = new Schedule(task.Object);
            schedule.ToRunEvery(2).Months().On(5);

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

示例5: Should_Add_Specified_Years_To_Next_Run_Date

        public void Should_Add_Specified_Years_To_Next_Run_Date()
        {
            var task = new Mock<ITask>();
            var schedule = new Schedule(task.Object);
            schedule.ToRunEvery(2).Years();

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

示例6: Should_Add_Specified_Weeks_To_Next_Run_Date

        public void Should_Add_Specified_Weeks_To_Next_Run_Date()
        {
            var task = new Mock<ITask>();
            var schedule = new Schedule(task.Object);
            schedule.ToRunEvery(2).Weeks();

            var input = new DateTime(2000, 1, 1);
            var scheduledTime = schedule.CalculateNextRun(input);
            var expectedTime = new DateTime(2000, 1, 15);
            Assert.AreEqual(scheduledTime, expectedTime);
        }
开发者ID:rooseveltdossantos,项目名称:FluentScheduler,代码行数:11,代码来源:WeeksTests.cs

示例7: Should_Not_Fail_If_Specified_Day_Does_Not_Exist_In_Year

        public void Should_Not_Fail_If_Specified_Day_Does_Not_Exist_In_Year()
        {
            var task = new Mock<ITask>();
            var schedule = new Schedule(task.Object);
            schedule.ToRunEvery(1).Years().On(400);

            var input = new DateTime(2000, 1, 1);
            var scheduledTime = schedule.CalculateNextRun(input);
            var expectedTime = new DateTime(2001, 2, 3);
            Assert.AreEqual(scheduledTime, expectedTime);
        }
开发者ID:njmube,项目名称:FluentScheduler,代码行数:11,代码来源:YearsOnTests.cs

示例8: Should_Handle_Negative_Numbers

        public void Should_Handle_Negative_Numbers()
        {
            var task = new Mock<ITask>();
            var schedule = new Schedule(task.Object);
            schedule.ToRunEvery(2).Years().On(-1);

            var input = new DateTime(2000, 1, 1);
            var scheduledTime = schedule.CalculateNextRun(input);
            var expectedTime = new DateTime(2001, 12, 30);
            Assert.AreEqual(scheduledTime.Date, expectedTime);
        }
开发者ID:njmube,项目名称:FluentScheduler,代码行数:11,代码来源:YearsOnTests.cs

示例9: Should_Handle_Negative_Numbers

        public void Should_Handle_Negative_Numbers()
        {
            var task = new Mock<ITask>();
            var schedule = new Schedule(task.Object);
            schedule.ToRunEvery(2).Months().On(-1);

            var input = new DateTime(2000, 1, 1, 1, 23, 25);
            var scheduledTime = schedule.CalculateNextRun(input);
            var expectedTime = new DateTime(2000, 2, 28);
            expectedTime.Should().Equal(scheduledTime.Date);
        }
开发者ID:vinaysingri,项目名称:FluentScheduler,代码行数:11,代码来源:MonthsOnTests.cs

示例10: Should_Not_Fail_If_Specified_Day_Does_Not_Exist_In_Month

        public void Should_Not_Fail_If_Specified_Day_Does_Not_Exist_In_Month()
        {
            var task = new Mock<ITask>();
            var schedule = new Schedule(task.Object);
            schedule.ToRunEvery(1).Months().On(31);

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

示例11: Should_Add_Specified_Years_To_Next_Run_Date_And_Select_Specified_Day

        public void Should_Add_Specified_Years_To_Next_Run_Date_And_Select_Specified_Day()
        {
            var task = new Mock<ITask>();
            var schedule = new Schedule(task.Object);
            schedule.ToRunEvery(2).Years().On(5);

            var input = new DateTime(2000, 2, 15);
            var scheduledTime = schedule.CalculateNextRun(input);
            var expectedTime = new DateTime(2002, 1, 5);
            Assert.AreEqual(scheduledTime, expectedTime);
        }
开发者ID:njmube,项目名称:FluentScheduler,代码行数:11,代码来源:YearsOnTests.cs

示例12: Should_Select_The_Date_If_The_Next_Runtime_Falls_On_The_Specified_Day

        public void Should_Select_The_Date_If_The_Next_Runtime_Falls_On_The_Specified_Day()
        {
            var task = new Mock<ITask>();
            var schedule = new Schedule(task.Object);
            schedule.ToRunEvery(2).Months().OnTheLast(DayOfWeek.Friday);

            var input = new DateTime(2000, 1, 31);
            var scheduledTime = schedule.CalculateNextRun(input);

            var expectedTime = new DateTime(2000, 3, 31);
            Assert.AreEqual(scheduledTime, expectedTime);
        }
开发者ID:rooseveltdossantos,项目名称:FluentScheduler,代码行数:12,代码来源:MonthsOnTheLastTests.cs

示例13: Should_Pick_The_Next_Week_If_The_Day_Of_Week_Has_Passed

        public void Should_Pick_The_Next_Week_If_The_Day_Of_Week_Has_Passed()
        {
            var task = new Mock<ITask>();
            var schedule = new Schedule(task.Object);
            schedule.ToRunEvery(2).Months().OnTheSecond(DayOfWeek.Tuesday);

            var input = new DateTime(2000, 1, 15);
            var scheduledTime = schedule.CalculateNextRun(input);

            var expectedTime = new DateTime(2000, 3, 14);
            Assert.AreEqual(scheduledTime, expectedTime);
        }
开发者ID:njmube,项目名称:FluentScheduler,代码行数:12,代码来源:MonthsOnTheSecondTests.cs

示例14: Should_Pick_The_Next_Week_If_The_Day_Of_Week_Has_Passed

        public void Should_Pick_The_Next_Week_If_The_Day_Of_Week_Has_Passed()
        {
            var task = new Mock<ITask>();
            var schedule = new Schedule(task.Object);
            schedule.ToRunEvery(2).Months().OnTheFourth(DayOfWeek.Tuesday);

            var input = new DateTime(2000, 1, 31);
            var scheduledTime = schedule.CalculateNextRun(input);

            var expectedTime = new DateTime(2000, 3, 28);
            scheduledTime.Should().Equal(expectedTime);
        }
开发者ID:jsauve,项目名称:FluentScheduler,代码行数:12,代码来源:MonthsOnTheFourthTests.cs

示例15: Should_Ignore_The_Specified_Day

        public void Should_Ignore_The_Specified_Day()
        {
            var task = new Mock<ITask>();
            var schedule = new Schedule(task.Object);
            schedule.ToRunEvery(2).Months().OnTheFourth(DayOfWeek.Wednesday);

            var input = new DateTime(2000, 3, 23);
            var scheduledTime = schedule.CalculateNextRun(input);

            var expectedTime = new DateTime(2000, 5, 24);
            scheduledTime.Should().Equal(expectedTime);
        }
开发者ID:jsauve,项目名称:FluentScheduler,代码行数:12,代码来源:MonthsOnTheFourthTests.cs


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