From 665e366540a6b88eaa5a05194653128825d75a2a Mon Sep 17 00:00:00 2001 From: Brady Holt Date: Tue, 27 Mar 2012 15:32:20 -0500 Subject: [PATCH] fixing issue #5 --- CronExpressionDescriptor.Test/TestFormats.cs | 3 +++ CronExpressionDescriptor/ExpressionParser.cs | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CronExpressionDescriptor.Test/TestFormats.cs b/CronExpressionDescriptor.Test/TestFormats.cs index 5dc2f685..029b4458 100644 --- a/CronExpressionDescriptor.Test/TestFormats.cs +++ b/CronExpressionDescriptor.Test/TestFormats.cs @@ -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] diff --git a/CronExpressionDescriptor/ExpressionParser.cs b/CronExpressionDescriptor/ExpressionParser.cs index 69610e55..9cfc76d7 100644 --- a/CronExpressionDescriptor/ExpressionParser.cs +++ b/CronExpressionDescriptor/ExpressionParser.cs @@ -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