Improve the child unit of work and enum adapter tests - #26129
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new child UoW test should explicitly assert it is operating on a child UoW, and the updated comment should avoid restating upstream ASP.NET Core behavior that the PR aims to decouple from.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR strengthens automated test coverage around ABP’s Unit of Work child-event behavior and makes the MVC enum adapter test less brittle against potential upstream ASP.NET Core changes.
Changes:
- Added a unit test covering the
Disposedeventremoveaccessor behavior for child UoWs. - Simplified the enum adapter test by removing an assertion about the default ASP.NET Core provider returning
null.
File summaries
| File | Description |
|---|---|
| framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWork_Child_Events_Tests.cs | Adds a new test ensuring unsubscribing from Disposed on a child UoW doesn’t leak handlers or trigger callbacks. |
| framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/DataAnnotations/AbpValidationAttributeAdapterProvider_Tests.cs | Removes a brittle assertion about upstream behavior and keeps the focus on ABP providing an adapter. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@copilot Fix the code for all comments in this review thread. When a review comment includes a suggested change, apply the suggestion exactly. Do not make changes beyond what is described in the linked review thread. |
Co-authored-by: maliming <6908465+maliming@users.noreply.github.com>
Addressed both review comments in b875866:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## rel-10.7 #26129 +/- ##
============================================
- Coverage 49.74% 49.70% -0.04%
============================================
Files 3821 3822 +1
Lines 133618 133511 -107
Branches 10114 10103 -11
============================================
- Hits 66472 66368 -104
+ Misses 65130 65125 -5
- Partials 2016 2018 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The
ChildUnitOfWorkeventremoveaccessor had no test coverage. The enum adapter test also asserted that the default ASP.NET Core provider returns no adapter, which would fail if that provider ever gains one, without ABP being broken.