-
-
Notifications
You must be signed in to change notification settings - Fork 0
test: Extended ThrowIfNullOrEmpty tests
#393
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
WalkthroughAdded two new unit tests to verify ThrowIfNullOrEmpty behavior for IEnumerable inputs and introduced a using directive for async Task support. No production code changes. Changes
Sequence Diagram(s)Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Knowledge base: Disabled due to 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Comment |
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/NetEvolve.Arguments.Tests.Unit/ArgumentTests_ThrowIfNullOrEmpty.cs (1)
61-70: Consider adding test coverage for non-empty IEnumerable (success case).The test suite now covers null IEnumerable (line 49) and empty IEnumerable (line 61), but lacks coverage for non-empty IEnumerable that should succeed without throwing. The string tests include this success case (lines 36-46). According to the summary,
ThrowIfNullOrEmptyEnumerableWithDatawas removed, which appears to have provided this coverage.Consider adding a parameterized test for the success case to maintain symmetry with the string tests:
[Test] [MethodDataSource(nameof(ThrowIfNullOrEmptyEnumerableWithData))] public async Task ThrowIfNullOrEmpty_WhenIEnumerableNotEmpty_ReturnsArgument(IEnumerable<string> argument) { // Act var result = Argument.ThrowIfNullOrEmpty(argument); // Assert _ = await Assert.That(result).IsNotNull(); } public static IEnumerable<IEnumerable<string>> ThrowIfNullOrEmptyEnumerableWithData => [new[] { "argument" }, new List<string> { "argument" }, new HashSet<string> { "argument" }];
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
📒 Files selected for processing (1)
tests/NetEvolve.Arguments.Tests.Unit/ArgumentTests_ThrowIfNullOrEmpty.cs(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build & Tests / Run Tests / Testing .NET solution
tests/NetEvolve.Arguments.Tests.Unit/ArgumentTests_ThrowIfNullOrEmpty.cs
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #393 +/- ##
===========================================
+ Coverage 77.77% 96.29% +18.51%
===========================================
Files 11 11
Lines 27 27
Branches 2 2
===========================================
+ Hits 21 26 +5
+ Misses 5 1 -4
+ Partials 1 0 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.