From dddbc34a6b198be50f3e0e06413471e1001794a4 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Fri, 13 Sep 2024 22:14:32 -0500 Subject: [PATCH] Refactored file locations, simplified API to use the DaprJobSchedule type with factory methods for creating it and properties for discerning its type. Signed-off-by: Whit Waldo --- src/Dapr.Jobs/DaprJobsGrpcClient.cs | 11 +- .../ByteArrayDeserializationExtensions.cs | 2 +- ...ions.cs => DaprSerializationExtensions.cs} | 2 +- src/Dapr.Jobs/Models/CronExpressionBuilder.cs | 573 +++++++++--------- src/Dapr.Jobs/Models/DaprJobSchedule.cs | 34 +- src/Dapr.Jobs/Models/Responses/JobDetails.cs | 51 +- .../ByteArrayDeserializationExtensionsTest.cs | 2 +- test/Dapr.Jobs.Test/JobDetailsTests.cs | 4 +- 8 files changed, 331 insertions(+), 348 deletions(-) rename src/Dapr.Jobs/Extensions/{Helpers/Deserialization => }/ByteArrayDeserializationExtensions.cs (96%) rename src/Dapr.Jobs/Extensions/{Helpers/Serialization/DaprOneTimeJobsSerializationExtensions.cs => DaprSerializationExtensions.cs} (98%) diff --git a/src/Dapr.Jobs/DaprJobsGrpcClient.cs b/src/Dapr.Jobs/DaprJobsGrpcClient.cs index 1555e25d..69fbcd73 100644 --- a/src/Dapr.Jobs/DaprJobsGrpcClient.cs +++ b/src/Dapr.Jobs/DaprJobsGrpcClient.cs @@ -59,14 +59,15 @@ internal DaprJobsGrpcClient( /// /// The name of the job being scheduled. /// The schedule defining when the job will be triggered. + /// The main payload of the job. /// The optional point-in-time from which the job schedule should start. /// The optional number of times the job should be triggered. /// Represents when the job should expire. If both this and DueTime are set, TTL needs to represent a later point in time. - /// The main payload of the job. /// Cancellation token. [Obsolete("The API is currently not stable as it is in the Alpha stage. This attribute will be removed once it is stable.")] - public override async Task ScheduleJobAsync(string jobName, DaprJobSchedule schedule, DateTimeOffset? startingFrom, - int? repeats = null, DateTimeOffset? ttl = null, ReadOnlyMemory? payload = null, + public override async Task ScheduleJobAsync(string jobName, DaprJobSchedule schedule, + ReadOnlyMemory? payload = null, DateTimeOffset? startingFrom = null, int? repeats = null, + DateTimeOffset? ttl = null, CancellationToken cancellationToken = default) { ArgumentVerifier.ThrowIfNullOrEmpty(jobName, nameof(jobName)); @@ -139,8 +140,8 @@ public override async Task GetJobAsync(string jobName, CancellationT throw new DaprException( "Get job operation failed: the Dapr endpoint indicated a failure. See InnerException for details.", ex); } - - return new JobDetails + + return new JobDetails(new DaprJobSchedule(response.Job.Schedule)) { DueTime = response.Job.DueTime is not null ? DateTime.Parse(response.Job.DueTime) : null, Ttl = response.Job.Ttl is not null ? DateTime.Parse(response.Job.Ttl) : null, diff --git a/src/Dapr.Jobs/Extensions/Helpers/Deserialization/ByteArrayDeserializationExtensions.cs b/src/Dapr.Jobs/Extensions/ByteArrayDeserializationExtensions.cs similarity index 96% rename from src/Dapr.Jobs/Extensions/Helpers/Deserialization/ByteArrayDeserializationExtensions.cs rename to src/Dapr.Jobs/Extensions/ByteArrayDeserializationExtensions.cs index 66d910f8..d5d5e0cd 100644 --- a/src/Dapr.Jobs/Extensions/Helpers/Deserialization/ByteArrayDeserializationExtensions.cs +++ b/src/Dapr.Jobs/Extensions/ByteArrayDeserializationExtensions.cs @@ -1,7 +1,7 @@ using System.Text; using System.Text.Json; -namespace Dapr.Jobs.Extensions.Helpers.Deserialization; +namespace Dapr.Jobs.Extensions; /// /// Provides utility extensions for deserializing an array of UTF-8 encoded bytes. diff --git a/src/Dapr.Jobs/Extensions/Helpers/Serialization/DaprOneTimeJobsSerializationExtensions.cs b/src/Dapr.Jobs/Extensions/DaprSerializationExtensions.cs similarity index 98% rename from src/Dapr.Jobs/Extensions/Helpers/Serialization/DaprOneTimeJobsSerializationExtensions.cs rename to src/Dapr.Jobs/Extensions/DaprSerializationExtensions.cs index 625f877c..5e2256dd 100644 --- a/src/Dapr.Jobs/Extensions/Helpers/Serialization/DaprOneTimeJobsSerializationExtensions.cs +++ b/src/Dapr.Jobs/Extensions/DaprSerializationExtensions.cs @@ -1,7 +1,7 @@ using System.Text; using System.Text.Json; -namespace Dapr.Jobs.Extensions.Helpers.Serialization; +namespace Dapr.Jobs.Extensions; /// /// Provides helper extensions for performing serialization operations when scheduling one-time Cron jobs for the developer. diff --git a/src/Dapr.Jobs/Models/CronExpressionBuilder.cs b/src/Dapr.Jobs/Models/CronExpressionBuilder.cs index e9371da4..f169ab34 100644 --- a/src/Dapr.Jobs/Models/CronExpressionBuilder.cs +++ b/src/Dapr.Jobs/Models/CronExpressionBuilder.cs @@ -2,328 +2,325 @@ using Dapr.Common; using ArgumentOutOfRangeException = System.ArgumentOutOfRangeException; -namespace Dapr.Jobs.Models -{ +namespace Dapr.Jobs.Models; +/// +/// A fluent API used to build a valid Cron expression. +/// +public sealed class CronExpressionBuilder +{ + private string seconds = "*"; + private string minutes = "*"; + private string hours = "*"; + private string dayOfMonth = "*"; + private string month = "*"; + private string dayOfWeek = "*"; /// - /// + /// Reflects an expression in which the developer specifies a series of numeric values and the period they're associated + /// with indicating when the trigger should occur. /// - public sealed class CronExpressionBuilder + /// The period of time within which the values should be associated. + /// The numerical values of the time period on which the schedule should trigger. + /// + public CronExpressionBuilder On(OnCronPeriod period, params int[] values) { - private string _seconds = "*"; - private string _minutes = "*"; - private string _hours = "*"; - private string _dayOfMonth = "*"; - private string _month = "*"; - private string _dayOfWeek = "*"; - - /// - /// Reflects an expression in which the developer specifies a series of numeric values and the period they're associated - /// with indicating when the trigger should occur. - /// - /// The period of time within which the values should be associated. - /// The numerical values of the time period on which the schedule should trigger. - /// - public CronExpressionBuilder On(OnCronPeriod period, params int[] values) + switch (period) { - switch (period) - { - //Validate by period - case OnCronPeriod.Second or OnCronPeriod.Minute or OnCronPeriod.Hour when values.Any(a => a is < 0 or > 59): - throw new ArgumentOutOfRangeException(nameof(values), "All values must be within 0 and 59, inclusively."); - case OnCronPeriod.DayOfMonth when values.Any(a => a is < 0 or > 31): - throw new ArgumentOutOfRangeException(nameof(values), "All values must be within 1 and 31, inclusively."); } - - var strValue = string.Join(',', values.Distinct().OrderBy(a => a)); + //Validate by period + case OnCronPeriod.Second or OnCronPeriod.Minute or OnCronPeriod.Hour when values.Any(a => a is < 0 or > 59): + throw new ArgumentOutOfRangeException(nameof(values), "All values must be within 0 and 59, inclusively."); + case OnCronPeriod.DayOfMonth when values.Any(a => a is < 0 or > 31): + throw new ArgumentOutOfRangeException(nameof(values), "All values must be within 1 and 31, inclusively."); } - switch (period) - { - case OnCronPeriod.Second: - _seconds = strValue; - break; - case OnCronPeriod.Minute: - _minutes = strValue; - break; - case OnCronPeriod.Hour: - _hours = strValue; - break; - case OnCronPeriod.DayOfMonth: - _dayOfMonth = strValue; - break; - default: - throw new ArgumentOutOfRangeException(nameof(period), period, null); - } + var strValue = string.Join(',', values.Distinct().OrderBy(a => a)); - return this; - } - - /// - /// Reflects an expression in which the developer specifies a series of months in the year on which the trigger should occur. - /// - /// The months of the year to invoke the trigger on. - public CronExpressionBuilder On(params MonthOfYear[] months) + switch (period) { - _month = string.Join(',', months.Distinct().OrderBy(a => a)); - return this; + case OnCronPeriod.Second: + seconds = strValue; + break; + case OnCronPeriod.Minute: + minutes = strValue; + break; + case OnCronPeriod.Hour: + hours = strValue; + break; + case OnCronPeriod.DayOfMonth: + dayOfMonth = strValue; + break; + default: + throw new ArgumentOutOfRangeException(nameof(period), period, null); } - /// - /// Reflects an expression in which the developer specifies a series of days of the week on which the trigger should occur. - /// - /// The days of the week to invoke the trigger on. - public CronExpressionBuilder On(params DayOfWeek[] days) - { - _dayOfWeek = string.Join(',', days.Distinct().OrderBy(a => a).Select(a => a.GetValueFromEnumMember())); - return this; - } + return this; + } - /// - /// Reflects an expression in which the trigger should happen each time the value of the specified period changes. - /// - /// The period of time that should be evaluated. - /// - public CronExpressionBuilder Each(CronPeriod period) - { - switch (period) - { - case CronPeriod.Second: - _seconds = "*"; - break; - case CronPeriod.Minute: - _minutes = "*"; - break; - case CronPeriod.Hour: - _hours = "*"; - break; - case CronPeriod.DayOfMonth: - _dayOfMonth = "*"; - break; - case CronPeriod.Month: - _month = "*"; - break; - case CronPeriod.DayOfWeek: - _dayOfWeek = "*"; - break; - default: - throw new ArgumentOutOfRangeException(nameof(period), period, null); - } + /// + /// Reflects an expression in which the developer specifies a series of months in the year on which the trigger should occur. + /// + /// The months of the year to invoke the trigger on. + public CronExpressionBuilder On(params MonthOfYear[] months) + { + month = string.Join(',', months.Distinct().OrderBy(a => a)); + return this; + } - return this; - } + /// + /// Reflects an expression in which the developer specifies a series of days of the week on which the trigger should occur. + /// + /// The days of the week to invoke the trigger on. + public CronExpressionBuilder On(params DayOfWeek[] days) + { + dayOfWeek = string.Join(',', days.Distinct().OrderBy(a => a).Select(a => a.GetValueFromEnumMember())); + return this; + } - /// - /// Reflects an expression in which the trigger should happen at a regular interval of the specified period type. - /// - /// The length of time represented in a unit interval. - /// The number of period units that should elapse between each trigger. - /// - public CronExpressionBuilder Every(EveryCronPeriod period, int interval) + /// + /// Reflects an expression in which the trigger should happen each time the value of the specified period changes. + /// + /// The period of time that should be evaluated. + /// + public CronExpressionBuilder Each(CronPeriod period) + { + switch (period) { - if (interval < 0) - throw new ArgumentOutOfRangeException(nameof(interval)); + case CronPeriod.Second: + seconds = "*"; + break; + case CronPeriod.Minute: + minutes = "*"; + break; + case CronPeriod.Hour: + hours = "*"; + break; + case CronPeriod.DayOfMonth: + dayOfMonth = "*"; + break; + case CronPeriod.Month: + month = "*"; + break; + case CronPeriod.DayOfWeek: + dayOfWeek = "*"; + break; + default: + throw new ArgumentOutOfRangeException(nameof(period), period, null); + } + + return this; + } - var value = $"*/{interval}"; + /// + /// Reflects an expression in which the trigger should happen at a regular interval of the specified period type. + /// + /// The length of time represented in a unit interval. + /// The number of period units that should elapse between each trigger. + /// + public CronExpressionBuilder Every(EveryCronPeriod period, int interval) + { + if (interval < 0) + throw new ArgumentOutOfRangeException(nameof(interval)); - switch (period) - { - case EveryCronPeriod.Second: - _seconds = value; - break; - case EveryCronPeriod.Minute: - _minutes = value; - break; - case EveryCronPeriod.Hour: - _hours = value; - break; - case EveryCronPeriod.Month: - _month = value; - break; - default: - throw new ArgumentOutOfRangeException(nameof(period), period, null); - } + var value = $"*/{interval}"; - return this; + switch (period) + { + case EveryCronPeriod.Second: + seconds = value; + break; + case EveryCronPeriod.Minute: + minutes = value; + break; + case EveryCronPeriod.Hour: + hours = value; + break; + case EveryCronPeriod.Month: + month = value; + break; + default: + throw new ArgumentOutOfRangeException(nameof(period), period, null); } - /// - /// Builds the Cron expression. - /// - /// - public override string ToString() => $"{_seconds} {_minutes} {_hours} {_dayOfMonth} {_month} {_dayOfWeek}"; + return this; } /// - /// Identifies the valid Cron periods in an "On" expression. + /// Builds the Cron expression. /// - public enum OnCronPeriod - { - /// - /// Identifies the second value for an "On" expression. - /// - Second, - /// - /// Identifies the minute value for an "On" expression. - /// - Minute, - /// - /// Identifies the hour value for an "On" expression. - /// - Hour, - /// - /// Identifies the day in the month for an "On" expression. - /// - DayOfMonth - } + /// + public override string ToString() => $"{seconds} {minutes} {hours} {dayOfMonth} {month} {dayOfWeek}"; +} +/// +/// Identifies the valid Cron periods in an "On" expression. +/// +public enum OnCronPeriod +{ /// - /// Identifies the valid Cron periods in an "Every" expression. + /// Identifies the second value for an "On" expression. /// - public enum EveryCronPeriod - { - /// - /// Identifies the second value in an "Every" expression. - /// - Second, - /// - /// Identifies the minute value in an "Every" expression. - /// - Minute, - /// - /// Identifies the hour value in an "Every" expression. - /// - Hour, - /// - /// Identifies the month value in an "Every" expression. - /// - Month - } + Second, + /// + /// Identifies the minute value for an "On" expression. + /// + Minute, + /// + /// Identifies the hour value for an "On" expression. + /// + Hour, + /// + /// Identifies the day in the month for an "On" expression. + /// + DayOfMonth +} +/// +/// Identifies the valid Cron periods in an "Every" expression. +/// +public enum EveryCronPeriod +{ /// - /// Identifies the various Cron periods. + /// Identifies the second value in an "Every" expression. /// - public enum CronPeriod - { - /// - /// Identifies the second value in the Cron expression. - /// - Second, - /// - /// Identifies the minute value in the Cron expression. - /// - Minute, - /// - /// Identifies the hour value in the Cron expression. - /// - Hour, - /// - /// Identifies the day of month value in the Cron expression. - /// - DayOfMonth, - /// - /// Identifies the month value in the Cron expression. - /// - Month, - /// - /// Identifies the day of week value in the Cron expression. - /// - DayOfWeek - } + Second, + /// + /// Identifies the minute value in an "Every" expression. + /// + Minute, + /// + /// Identifies the hour value in an "Every" expression. + /// + Hour, + /// + /// Identifies the month value in an "Every" expression. + /// + Month +} +/// +/// Identifies the various Cron periods. +/// +public enum CronPeriod +{ /// - /// Identifies the days in the week. + /// Identifies the second value in the Cron expression. /// - public enum DayOfWeek - { - /// - /// Sunday. - /// - [EnumMember(Value="SUN")] - Sunday = 0, - /// - /// Monday. - /// - [EnumMember(Value="MON")] - Monday = 1, - /// - /// Tuesday. - /// - [EnumMember(Value="TUE")] - Tuesday = 2, - /// - /// Wednesday. - /// - [EnumMember(Value="WED")] - Wednesday = 3, - /// - /// Thursday. - /// - [EnumMember(Value="THU")] - Thursday = 4, - /// - /// Friday. - /// - [EnumMember(Value="FRI")] - Friday = 5, - /// - /// Saturday. - /// - [EnumMember(Value="SAT")] - Saturday = 6 - } + Second, + /// + /// Identifies the minute value in the Cron expression. + /// + Minute, + /// + /// Identifies the hour value in the Cron expression. + /// + Hour, + /// + /// Identifies the day of month value in the Cron expression. + /// + DayOfMonth, + /// + /// Identifies the month value in the Cron expression. + /// + Month, + /// + /// Identifies the day of week value in the Cron expression. + /// + DayOfWeek +} +/// +/// Identifies the days in the week. +/// +public enum DayOfWeek +{ /// - /// Identifies the months in the year. + /// Sunday. /// - public enum MonthOfYear - { - /// - /// Month of January. - /// - January = 1, - /// - /// Month of February. - /// - February = 2, - /// - /// Month of March. - /// - March = 3, - /// - /// Month of April. - /// - April = 4, - /// - /// Month of May. - /// - May = 5, - /// - /// Month of June. - /// - June = 6, - /// - /// Month of July. - /// - July = 7, - /// - /// Month of August. - /// - August = 8, - /// - /// Month of September. - /// - September = 9, - /// - /// Month of October. - /// - October = 10, - /// - /// Month of November. - /// - November = 11, - /// - /// Month of December. - /// - December = 12 - } + [EnumMember(Value="SUN")] + Sunday = 0, + /// + /// Monday. + /// + [EnumMember(Value="MON")] + Monday = 1, + /// + /// Tuesday. + /// + [EnumMember(Value="TUE")] + Tuesday = 2, + /// + /// Wednesday. + /// + [EnumMember(Value="WED")] + Wednesday = 3, + /// + /// Thursday. + /// + [EnumMember(Value="THU")] + Thursday = 4, + /// + /// Friday. + /// + [EnumMember(Value="FRI")] + Friday = 5, + /// + /// Saturday. + /// + [EnumMember(Value="SAT")] + Saturday = 6 +} + +/// +/// Identifies the months in the year. +/// +public enum MonthOfYear +{ + /// + /// Month of January. + /// + January = 1, + /// + /// Month of February. + /// + February = 2, + /// + /// Month of March. + /// + March = 3, + /// + /// Month of April. + /// + April = 4, + /// + /// Month of May. + /// + May = 5, + /// + /// Month of June. + /// + June = 6, + /// + /// Month of July. + /// + July = 7, + /// + /// Month of August. + /// + August = 8, + /// + /// Month of September. + /// + September = 9, + /// + /// Month of October. + /// + October = 10, + /// + /// Month of November. + /// + November = 11, + /// + /// Month of December. + /// + December = 12 } diff --git a/src/Dapr.Jobs/Models/DaprJobSchedule.cs b/src/Dapr.Jobs/Models/DaprJobSchedule.cs index 7f40b987..00b429bd 100644 --- a/src/Dapr.Jobs/Models/DaprJobSchedule.cs +++ b/src/Dapr.Jobs/Models/DaprJobSchedule.cs @@ -1,4 +1,6 @@ -using Dapr.Jobs.Models; +using System.Text.RegularExpressions; +using Dapr.Jobs.Extensions; +using Dapr.Jobs.Models; namespace Dapr.Jobs; @@ -7,6 +9,13 @@ namespace Dapr.Jobs; /// public sealed class DaprJobSchedule { + /// + /// A regular expression used to evaluate whether a given string embodies a Cron expression or not. + /// + private readonly Regex isCronExpression = + new Regex( + @"^(\*|([0-5]?\d)) (\*|([0-5]?\d)) (\*|([01]?\d|2[0-3])) (\*|([01]?\d|2[0-9]|3[01])) (\*|(1[0-2]|0?[1-9])) (\*|([0-6]|(MON|TUE|WED|THU|FRI|SAT|SUN)(,(MON|TUE|WED|THU|FRI|SAT|SUN))*))$", RegexOptions.Compiled); + /// /// The value of the expression represented by the schedule. /// @@ -91,4 +100,27 @@ public static DaprJobSchedule FromDuration(TimeSpan duration) /// Specifies a schedule in which the job is triggered at the top of every hour. /// public static DaprJobSchedule Hourly => new DaprJobSchedule("@hourly"); + + /// + /// Reflects that the schedule represents a prefixed period expression. + /// + public bool IsPrefixedPeriodExpression => + ExpressionValue.StartsWith('@') && + ((ExpressionValue.StartsWith("@every") && ExpressionValue.Length > "@every".Length) || + ExpressionValue.EndsWithAny(new[] { "yearly", "monthly", "weekly", "daily", "midnight", "hourly" })); + + /// + /// Reflects that the schedule represents a fixed point in time. + /// + public bool IsPointInTimeExpression => DateTimeOffset.TryParse(ExpressionValue, out _); + + /// + /// Reflects that the schedule represents a Golang duration expression. + /// + public bool IsIntervalExpression => ExpressionValue.IsDurationString(); + + /// + /// Reflects that the schedule represents a Cron expression. + /// + public bool IsCronExpression => isCronExpression.IsMatch(ExpressionValue); } diff --git a/src/Dapr.Jobs/Models/Responses/JobDetails.cs b/src/Dapr.Jobs/Models/Responses/JobDetails.cs index bfc9bf44..d5a32789 100644 --- a/src/Dapr.Jobs/Models/Responses/JobDetails.cs +++ b/src/Dapr.Jobs/Models/Responses/JobDetails.cs @@ -11,68 +11,23 @@ // limitations under the License. // ------------------------------------------------------------------------ -using System.Text.Json.Serialization; -using Dapr.Jobs.Extensions; - namespace Dapr.Jobs.Models.Responses; /// /// Represents the details of a retrieved job. /// -public sealed record JobDetails +/// Represents the schedule that triggers the job. +public sealed record JobDetails(DaprJobSchedule Schedule) { - /// - /// If the schedule is recurring due to either a Cron-like or prefixed period value, its representation can be retrieved from - /// this property. - /// - public DaprJobSchedule? ScheduleExpression => IsPrefixedPeriodExpression || IsScheduleExpression ? new DaprJobSchedule(Schedule!) : null; - - /// - /// The interval expression that defines when a job should be triggered. - /// - public TimeSpan? Interval => IsIntervalExpression ? Schedule?.FromDurationString() : null; - - /// - /// Represents whether the job is scheduled using a Cron expression. - /// - public bool IsScheduleExpression => Schedule is not null && !IsPrefixedPeriodExpression && !IsIntervalExpression; - - /// - /// Indicates that the expression is a prefixed period. - /// - public bool IsPrefixedPeriodExpression - { - get => - Schedule is not null && Schedule.StartsWith('@') && ((Schedule.StartsWith("@every") && Schedule.Length > "@every".Length) || - Schedule.EndsWithAny(new[] - { - "yearly", "monthly", "weekly", "daily", - "midnight", "hourly" - })); - } - - /// - /// Represents whether the job is scheduled using an interval expression. - /// - public bool IsIntervalExpression => Schedule is not null && Schedule.IsDurationString(); - - /// - /// The string-based schedule value returned by the job details payload. - /// - [JsonPropertyName("schedule")] - public string? Schedule { get; init; } = null; - /// /// Allows for jobs with fixed repeat counts. /// - [JsonPropertyName("repeats")] public int? RepeatCount { get; init; } = null; /// /// Identifies a point-in-time representing when the job schedule should start from, /// or as a "one-shot" time if other scheduling fields are not provided. /// - [JsonPropertyName("dueTime")] public DateTimeOffset? DueTime { get; init; } = null; /// @@ -81,12 +36,10 @@ public bool IsPrefixedPeriodExpression /// /// This must be greater than if both are set. /// - [JsonPropertyName("ttl")] public DateTimeOffset? Ttl { get; init; } = null; /// /// Stores the main payload of the job which is passed to the trigger function. /// - [JsonPropertyName("data")] public ReadOnlyMemory? Payload { get; init; } = null; } diff --git a/test/Dapr.Jobs.Test/ByteArrayDeserializationExtensionsTest.cs b/test/Dapr.Jobs.Test/ByteArrayDeserializationExtensionsTest.cs index bbed7028..2cbff140 100644 --- a/test/Dapr.Jobs.Test/ByteArrayDeserializationExtensionsTest.cs +++ b/test/Dapr.Jobs.Test/ByteArrayDeserializationExtensionsTest.cs @@ -1,7 +1,7 @@ using System.Text; using System.Text.Json; using System.Text.Json.Serialization; -using Dapr.Jobs.Extensions.Helpers.Deserialization; +using Dapr.Jobs.Extensions; using Xunit; #nullable enable diff --git a/test/Dapr.Jobs.Test/JobDetailsTests.cs b/test/Dapr.Jobs.Test/JobDetailsTests.cs index 9aa81db8..1e1957c3 100644 --- a/test/Dapr.Jobs.Test/JobDetailsTests.cs +++ b/test/Dapr.Jobs.Test/JobDetailsTests.cs @@ -14,10 +14,10 @@ public void JobDetails_CronExpressionShouldPopulateFromSchedule() var jobDetails = new JobDetails { Schedule = cronSchedule }; Assert.False(jobDetails.IsIntervalExpression); - Assert.True(jobDetails.IsCronExpression); + Assert.True(jobDetails.IsScheduleExpression); Assert.Null(jobDetails.Interval); Assert.Equal(cronSchedule, jobDetails.Schedule); - Assert.Equal(cronSchedule, jobDetails.CronExpression); + Assert.Equal(cronSchedule, jobDetails.); } [Fact]