test: improve coverage for PR #294 gap files#295
Merged
Conversation
Adds 65 new unit tests targeting the lowest-coverage files in the codecov report for PR #294: - DynamicPredicateBuilderEdgeCaseTests (29 cases): IsValidPropertyName null/empty/oversized/dangerous-char branches, ValidateExpression null/whitespace + all dangerous patterns, ValidateArrayValue null/string/non-enumerable/empty branches. - DynamicPredicateExpressionOverloadTests (12 cases): Expression<Func<T,bool>> DynamicAnd/DynamicOr property-name and raw-expression overloads, plus the ExpressionStarter raw-expression overloads (none of these were exercised by existing tests). - LocalBlobServiceEdgeCaseTests (7 cases): Null RootFolder fallback, path-traversal UnauthorizedAccessException on CheckExists/Delete, leading-slash normalization, cancellation- token early-exit for file and folder deletion, nested-path SaveAsync. - DataSeedingEdgeCaseTests (3 cases): Empty seed data early-return, all-rows-already-exist early-return (using a value-equality ColorRow + ColorDbContext), and the default Order/EntityType/SeedAsync properties. All new tests pass; existing tests still green. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
📊 Code Coverage Report |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #295 +/- ##
==========================================
+ Coverage 83.62% 84.83% +1.21%
==========================================
Files 159 159
Lines 3706 3706
Branches 575 575
==========================================
+ Hits 3099 3144 +45
+ Misses 444 412 -32
+ Partials 163 150 -13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds 65 unit tests targeting the lowest-coverage files in the codecov report for PR #294. Closes the patch-coverage gap by exercising security validation branches, expression overloads, blob-service defensive paths, and data-seeding early-returns.
Coverage targets
DynamicPredicateExtensions.csDynamicPredicateBuilderExtensions.csIsValidPropertyNamenull/empty/oversized/bad-char branches,ValidateExpressionnull + every dangerous pattern,ValidateArrayValuenon-enumerable rejectionLocalBlobService.csRootFolderfallback, path-traversalUnauthorizedAccessException, leading-slash normalization, cancellation-token early-exit (file + folder), nested-path SaveAsyncIDataSeedingConfiguration.csOrder/EntityTypepropertiesNot addressed:
TaskSetups.cs(10% reported) — the file uses C# 14extensionmembers which the coverage instrumentation does not appear to track. The methods are already exercised byBackgroundJobTests.IdempotencySqlServerStore.IsExpiredbranch — structurally unreachable because the EF query already filtersExpiresAt > DateTime.UtcNow; this is defensive code.New test files
DynamicPredicateBuilderEdgeCaseTests.cs(29 cases)DynamicPredicateExpressionOverloadTests.cs(12 cases)LocalBlobServiceEdgeCaseTests.cs(7 cases)DataSeedingEdgeCaseTests.cs(3 cases)All new tests pass; full
EfCore.Specifications.Tests(301),EfCore.Extensions.Tests(85), andSvc.BlobStorage.TestsLocal-fixture suite (17) remain green.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com