Skip to content

Add unit tests for async, context, bulk, interceptors, and mapping #28

@cursor

Description

@cursor

Problem

The test suite has ~221 tests, but several newer subsystems have no dedicated test coverage:

Area Files
Async API AsyncSqlClient, AsyncLinqHelper
EF-like context DbContext, DbSet, ChangeTracker
Bulk operations BulkOperations
Interceptors LoggingInterceptor, AuditInterceptor, SoftDeleteInterceptor
Entity mapping EntityMapping, FluentConfiguration, EntityMappingResolver
Transactions DbTransaction

Proposed solution

Add focused unit tests per subsystem. Prefer tests that do not require a live database where possible (mock ISqlClient / IAsyncSqlClient, test SQL generation, state transitions).

Suggested test files:

  • DBToolsUnitTest/Core/AsyncSqlClientTests.cs
  • DBToolsUnitTest/Context/DbContextTests.cs
  • DBToolsUnitTest/Bulk/BulkOperationsTests.cs
  • DBToolsUnitTest/Interceptors/InterceptorTests.cs
  • DBToolsUnitTest/Mapping/EntityMappingTests.cs
  • DBToolsUnitTest/Core/DbTransactionTests.cs

Acceptance criteria

  • Each listed subsystem has at least basic happy-path and error-path tests
  • Tests run in CI without a live database (or are clearly categorized as integration)
  • No significant regressions in existing test pass rate

Context

ProviderDialectTests is a good model for provider-agnostic unit tests without DB connectivity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions