Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed unit tests
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
  • Loading branch information
WhitWaldo committed Feb 19, 2025
commit 31c93b69b8c52d277f9d63a137c648fd0b7b58a6
2 changes: 1 addition & 1 deletion src/Dapr.Jobs/Extensions/TimeSpanExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static string ToDurationString(this TimeSpan timespan)
/// <returns>True if the string represents a parseable interval duration; false if not.</returns>
public static bool IsDurationString(this string interval)
{
interval = interval.Replace("ms", "q");
interval = interval.Replace("ms", "q").Replace("@every ", string.Empty);
return hourRegex.Match(interval).Success ||
minuteRegex.Match(interval).Success ||
secondRegex.Match(interval).Success ||
Expand Down
4 changes: 2 additions & 2 deletions test/Dapr.Jobs.Test/Models/DaprJobScheduleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public sealed class DaprJobScheduleTests
public void FromDuration_Validate()
{
var schedule = DaprJobSchedule.FromDuration(new TimeSpan(12, 8, 16));
Assert.Equal("12h8m16s", schedule.ExpressionValue);
Assert.Equal("@every 12h8m16s", schedule.ExpressionValue);
}

[Fact]
Expand Down Expand Up @@ -117,7 +117,7 @@ public void IsDurationExpression()
Assert.True(schedule.IsDurationExpression);
Assert.False(schedule.IsPointInTimeExpression);
Assert.False(schedule.IsCronExpression);
Assert.False(schedule.IsPrefixedPeriodExpression);
Assert.True(schedule.IsPrefixedPeriodExpression); //A duration expression _is_ a prefixed period with @every
}

[Fact]
Expand Down