-
Notifications
You must be signed in to change notification settings - Fork 247
Refactor handling of FREQ in recurrence pattern #789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ ❌ Your project status has failed because the head coverage (67%) is below the target coverage (80%). You can increase the head coverage or adjust the target coverage. @@ Coverage Diff @@
## main #789 +/- ##
===================================
Coverage 67% 67%
===================================
Files 106 106
Lines 4445 4450 +5
Branches 1071 1072 +1
===================================
+ Hits 2960 2965 +5
Misses 1046 1046
Partials 439 439
🚀 New features to boost your workflow:
|
| /// - 1 = every | ||
| /// - 2 = every second | ||
| /// - 3 = every third | ||
| /// Specifies the interval between occurrences of the recurrence. The default value is 1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not fully precise, as due to the other rule parts, more or less occurrences could happen per interval. This is what the RFC says, maybe just copy?
The INTERVAL rule part contains a positive integer representing at
which intervals the recurrence rule repeats. The default value is
"1", meaning every second for a SECONDLY rule, every minute for a
MINUTELY rule, every hour for an HOURLY rule, every day for a
DAILY rule, every week for a WEEKLY rule, every month for a
MONTHLY rule, and every year for a YEARLY rule. For example,
within a DAILY rule, a value of "8" means every eight days.
| default: | ||
| throw new Exception("FrequencyType.NONE cannot be evaluated. Please specify a FrequencyType before evaluating the recurrence."); | ||
| // Frequency should always be valid at this stage. | ||
| System.Diagnostics.Debug.Fail($"'{pattern.Frequency}' as RecurrencePattern.Frequency is not implemented."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure we should fail here. Users could easily set any int as frequency type, which would not be an internal error. I think throwing was not wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... kike with (FrequencyType) 123 - yes, you're right. Wouldn't checking for valid values in the setter of RecurrencePattern.Frequency be better?
22081fc to
84cfd4d
Compare
|



Resolves #788