Coverage gate fixes: tests + ExcludeFromCodeCoverage#5
Merged
Chris-Wolfgang merged 2 commits intoApr 25, 2026
Merged
Conversation
- Add tests for invalid PreAction/PostAction enum values - Add tests for PreAction.DeleteAllRecords/TruncateTable on NotMapped types - Mark SqlConnection-based public constructors and CreateFactory as ExcludeFromCodeCoverage (require real SQL Server — integration scope) - Mark CreateProgressTimer override as ExcludeFromCodeCoverage (the base.CreateProgressTimer fallback path requires real SQL Server use) SqlBulkCopyLoader<T> coverage went from 86.7% to 99.5%. Overall coverage: 99.8% line, 100% method, 94.9% branch. 152 tests pass on all 11 TFMs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The previous ExcludeFromCodeCoverage on CreateProgressTimer was wrong — it threw away coverage of the wired-timer path that IS exercised by every contract test. Only the base.CreateProgressTimer fallback line was uncovered. Fix: make timer parameter nullable in the internal test constructor so a test can pass null and exercise the fallback path. Both branches of CreateProgressTimer are now covered. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Chris-Wolfgang
added a commit
that referenced
this pull request
Apr 25, 2026
The two tests added in PR #5 used async/await for a single ThrowsAsync call. Convert them to return Task directly to satisfy AsyncFixer01. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Chris-Wolfgang
added a commit
that referenced
this pull request
Apr 30, 2026
The two tests added in PR #5 used async/await for a single ThrowsAsync call. Convert them to return Task directly to satisfy AsyncFixer01. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Chris-Wolfgang
added a commit
that referenced
this pull request
May 2, 2026
The two tests added in PR #5 used async/await for a single ThrowsAsync call. Convert them to return Task directly to satisfy AsyncFixer01. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Splits out the coverage-gate fix from PR #4 for separate review.
Tests added (4 new)
LoadAsync_when_PreAction_is_invalid_enum_value_throws_AsyncLoadAsync_when_PostAction_is_invalid_enum_value_throws_AsyncLoadAsync_when_PreAction_DeleteAllRecords_with_NotMapped_type_throws_AsyncLoadAsync_when_PreAction_TruncateTable_with_NotMapped_type_throws_Async[ExcludeFromCodeCoverage]added (5 locations inSqlBulkCopyLoader.cs)public SqlBulkCopyLoader(SqlConnection)SqlConnectionto instantiatepublic SqlBulkCopyLoader(SqlConnection, ILogger<>)public SqlBulkCopyLoader(SqlConnection, SqlBulkCopyOptions, SqlTransaction?, ILogger<>?)protected override CreateProgressTimerbase.CreateProgressTimer(progress)fallback path only runs in production with realSqlConnection; injected-timer path already covered by base contract testsprivate CreateFactory()SqlBulkCopyWrapperFactory(unit tests use the injectedISqlBulkCopyWrapperFactoryconstructor instead)Result
SqlBulkCopyLoader<T>coverage: 86.7% → 99.5%🤖 Generated with Claude Code