Skip to content

Commit

Permalink
Add another test to make sure that specified run times will run as ex…
Browse files Browse the repository at this point in the history
…pected for day of week schedules.
  • Loading branch information
jgeurts committed Nov 22, 2012
1 parent 0b528d4 commit 1a67df4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions FluentScheduler.Tests/ScheduleTests/WeeksTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,20 @@ public void Should_Pick_The_Next_Week_On_The_Specified_Day_Of_Week_If_0_Weeks_Sp
scheduledTime.Should().Equal(expectedTime);
}

[Test]
public void Should_Pick_The_Same_Day_Of_Week_If_0_Weeks_Specified_And_Before_Specified_Run_Time()
{
var task = new Mock<ITask>();
var schedule = new Schedule(task.Object);
schedule.ToRunEvery(0).Weeks().On(DayOfWeek.Tuesday).At(4, 20);

var input = new DateTime(2000, 1, 4, 3, 15, 0); // Tuesday
var scheduledTime = schedule.CalculateNextRun(input);

var expectedTime = new DateTime(2000, 1, 4, 4, 20, 0);
scheduledTime.Should().Equal(expectedTime);
}

[Test]
public void Should_Schedule_Today_If_Input_Time_Is_Before_Run_Time()
{
Expand Down

0 comments on commit 1a67df4

Please sign in to comment.