feat: Add missed 16-parameter overloads in ReturnsExtensions#18
feat: Add missed 16-parameter overloads in ReturnsExtensions#18DrBarnabus merged 1 commit intomainfrom
ReturnsExtensions#18Conversation
WalkthroughSupport for methods with sixteen parameters has been added to both the Changes
Sequence Diagram(s)sequenceDiagram
participant Test as Unit Test
participant Mock as Mocked ISubject
participant ReturnsExt as ReturnsExtensions
Test->>Mock: Setup Task/ValueTask method with 16 params
Mock->>ReturnsExt: Use Returns extension with 16-param Func
Test->>Mock: Invoke method with 16 arguments
Mock->>ReturnsExt: Pass arguments to Func
ReturnsExt-->>Mock: Return Task/ValueTask with result
Mock-->>Test: Return result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes Poem
Note 🔌 MCP (Model Context Protocol) integration is now available in Early Access!Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
77cced4 to
da85792
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/Mimic/Extensions/ReturnsExtensions.cs (1)
419-447: Doc consistency: update earlier remark stating “up to 15 parameters” to 16Now that 16-parameter overloads exist (and System.Func supports up to 16 inputs), please update the earlier remarks that still say “up to 15 parameters”.
Suggested diffs:
- /// Additional overloads are available for methods with up to 15 parameters following the same pattern. + /// Additional overloads are available for methods with up to 16 parameters following the same pattern.Apply in both places:
- Task: lines 93–95 (three-argument overload’s remarks)
- ValueTask: lines 539–541 (three-argument overload’s remarks)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/Mimic.UnitTests/Extensions/ReturnsExtensionsTests.cs(4 hunks)src/Mimic/Extensions/ReturnsExtensions.cs(2 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). (2)
- GitHub Check: Prepare (windows-latest)
- GitHub Check: Analyze (csharp)
🔇 Additional comments (8)
src/Mimic/Extensions/ReturnsExtensions.cs (4)
419-451: 16-parameter Task overload added correctlyImplementation matches existing pattern, correctly threads all 16 args into valueFunction and wraps via Task.FromResult.
412-413: Minor doc change looks fineNo functional impact; content remains consistent with the other overloads.
865-897: 16-parameter ValueTask overload added correctlyAll 16 parameters are correctly threaded; result is wrapped via new ValueTask(...). Good parity with Task overload.
858-859: Minor doc change looks fineNo issues; consistent with neighbouring overloads.
src/Mimic.UnitTests/Extensions/ReturnsExtensionsTests.cs (4)
359-387: Task 16-parameter test is correct and thoroughVerifies each argument is passed through and asserts the returned value. Mirrors prior tests; good coverage for new overload.
744-772: ValueTask 16-parameter test is correct and thoroughAsserts all 16 args and the result; consistent with the Task variant.
810-811: ISubject.Task 16-parameter overload addedSignature is consistent with existing series and required for the new test.
844-845: ISubject.ValueTask 16-parameter overload addedSignature is consistent and enables the new test.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #18 +/- ##
=======================================
Coverage 92.38% 92.39%
=======================================
Files 64 64
Lines 2115 2117 +2
Branches 365 365
=======================================
+ Hits 1954 1956 +2
Misses 84 84
Partials 77 77 ☔ View full report in Codecov by Sentry. |
Summary by CodeRabbit
New Features
Tests