Add no-DB unit tests using pengdows.crud.fakeDb, reaching 86% line coverage#2199
Open
alaricd wants to merge 3 commits intoDapperLib:mainfrom
Open
Add no-DB unit tests using pengdows.crud.fakeDb, reaching 86% line coverage#2199alaricd wants to merge 3 commits intoDapperLib:mainfrom
alaricd wants to merge 3 commits intoDapperLib:mainfrom
Conversation
….dll coverage
Introduces 775 pure unit tests that run without a live database connection,
using pengdows.crud.fakeDb v2.0.1 as a fake ADO.NET provider. Tests target
Coverage achieved:
- Dapper.dll overall: 86.1% (up from ~0% no-DB coverage)
- SqlMapper.cs: 82.3% (exceeds 80% goal)
- CommandDefinition.cs, UdtTypeHandler.cs, SqlDataRecordHandler.cs,
SqlDataRecordListTVPParameter.cs: 100%
Key areas covered by new FakeDbTests.*.cs files:
- All Query/Execute/QueryMultiple sync and async overloads
- MultiMap (2–7 types), dynamic multimap, GridReader
- DynamicParameters, TypeHandlers, TypeMapping, DefaultTypeMap
- PassByPosition (?x? syntax), TryStringSplit (InListStringSplitCount),
PadListExpansions, empty IN-list handling
- Format() all TypeCode branches, ReplaceLiterals, ReadChar/ReadNullableChar
- SanitizeParameterValue for all enum underlying types
- CommandDefinition.GetInit() IL generation (BindByName, FetchSize, etc.)
- StructuredHelper.ConfigureTVP/ConfigureUDT IL generation and cache
- WrappedReader, WrappedBasicReader, DisposedReader, DbString, ValueTuples
- Struct params, ctor-sort params, pipelined Execute, error paths
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AppVeyor's VS 2022 image only ships up to SDK 9.0.306; the 10.0.102 requirement in global.json prevented dotnet from running at all. Dapper.csproj had no NET10_0_OR_GREATER guards, so the net10.0 target was identical to net8.0 and safe to remove. rollForward: latestMajor remains, so machines with SDK 10+ continue using the latest available SDK. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
|
@mgravell — build is now green. 775 pure unit tests, no live database required, using pengdows.crud.fakeDb as a fake ADO.NET provider. Test-only dependency, zero production code changes. Happy to address any feedback. |
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.
….dll coverage
Introduces 775 pure unit tests that run without a live database connection,
using pengdows.crud.fakeDb v2.0.1 as a fake ADO.NET provider. Tests target
Coverage achieved:
Key areas covered by new FakeDbTests.*.cs files: