Skip to content

Commit

Permalink
fixing issue #5
Browse files Browse the repository at this point in the history
  • Loading branch information
bradymholt committed Mar 27, 2012
1 parent 124bf2a commit 665e366
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CronExpressionDescriptor.Test/TestFormats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ public void TestEvery5Minutes()
{
ExpressionDescriptor ceh = new ExpressionDescriptor("*/5 * * * *");
Assert.AreEqual("Every 05 minutes", ceh.GetDescription(DescriptionTypeEnum.FULL));

ceh = new ExpressionDescriptor("0 0/10 * * * ?");
Assert.AreEqual("Every 10 minutes", ceh.GetDescription(DescriptionTypeEnum.FULL));
}

[TestMethod]
Expand Down
5 changes: 4 additions & 1 deletion CronExpressionDescriptor/ExpressionParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ private void NormalizeExpression(string[] expressionParts)
//convert */1 to *
for (int i = 0; i <= 5; i++)
{
expressionParts[i] = expressionParts[i].Replace("*/1", "*");
if (expressionParts[i] == "*/1")
{
expressionParts[i] = "*";
}
}

//convert SUN-SAT format to 0-6 format
Expand Down

0 comments on commit 665e366

Please sign in to comment.