Skip to content

🧪 [testing improvement] add tests for CalendarVersionFormat constructor and format method#35

Merged
tetri merged 3 commits into
mainfrom
fix-constructor-test-calendar-version-format-2374914600003663477
May 15, 2026
Merged

🧪 [testing improvement] add tests for CalendarVersionFormat constructor and format method#35
tetri merged 3 commits into
mainfrom
fix-constructor-test-calendar-version-format-2374914600003663477

Conversation

@tetri
Copy link
Copy Markdown
Owner

@tetri tetri commented May 15, 2026

🎯 What: The testing gap addressed
This PR addresses the missing unit tests for the CalendarVersionFormat class, specifically its constructor and the Format method.

📊 Coverage: What scenarios are now tested

  • Constructor correctly assigns the pattern string to the Pattern property.
  • Format method correctly formats CalendarVersion objects for patterns like "YYYY.MM", "YY.MM.DD", "YYYY.MM.DD.Minor", and even custom separators like "YYYY-MM-DD".
  • Format method correctly throws InvalidOperationException when the pattern requires a Day or Minor version component that is not provided in the CalendarVersion object.

Result: The improvement in test coverage
The addition of CalendarVersionFormatTests.cs ensures that custom formatting logic is reliable and handles edge cases appropriately, improving the overall stability of the CalendarVersioning library.


PR created automatically by Jules for task 2374914600003663477 started by @tetri

…or and format method

Add unit tests for CalendarVersionFormat to ensure the constructor correctly sets the Pattern property and the Format method correctly represents CalendarVersion objects based on custom patterns.

- Implement Constructor_WithPattern_SetsPatternProperty
- Implement Format_WithValidPatterns_ReturnsExpectedStrings (Theory)
- Implement Format_MissingDay_ThrowsInvalidOperationException
- Implement Format_MissingMinor_ThrowsInvalidOperationException
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

tetri and others added 2 commits May 15, 2026 11:57
…ompilation error

Add unit tests for CalendarVersionFormat to ensure the constructor correctly sets the Pattern property and the Format method correctly represents CalendarVersion objects based on custom patterns.
Also fix a compilation error (CS0136) in CalendarVersion.cs where a variable 'parts' was being redeclared in a nested scope.

- Implement CalendarVersionFormatTests
- Fix variable shadowing in CalendarVersion.Parse
@tetri tetri merged commit 32e5127 into main May 15, 2026
4 of 8 checks passed
@tetri tetri deleted the fix-constructor-test-calendar-version-format-2374914600003663477 branch May 15, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant