Skip to content

0.10: Add application testing builders, fixtures, and unit-of-work fakes #110

Description

@bazer

Objective

Provide first-class database-free application testing support that preserves DataLinq metadata, key, relation, Memory, and unit-of-work contracts instead of encouraging invalid runtime mocks or pretending in-memory execution proves SQL-provider behavior.

Required scope

W6A: builders, relations, and Memory fixtures

  • Metadata-aware immutable builders with valid row, table, primary-key, equality, GetValues(), and Mutate() behavior.
  • Collection and reference relation doubles implementing their full supported interfaces.
  • Relation graph builders driven by DataLinq relation metadata.
  • Deterministic fixture construction, seeding, reset, IDs, clocks, and defaults where owned by this testing surface.
  • Registration over the real DataLinq.Memory capability set, preserving unsupported-query failures.

W6B: fake unit of work and DI replacement

  • Fake unit-of-work behavior derived from the production H10 contract, including write recording, commit/rollback/disposal, failure injection, and terminal states.
  • DI replacement helpers with unambiguous names for Memory-backed tests, fake writes, and SQLite-in-memory provider tests.
  • Documentation that states exactly which guarantees each testing layer provides.

Acceptance criteria

  • Application code can construct immutable scalar models and relation graphs without a live database while preserving metadata and key invariants.
  • One-to-many, many-to-one, nullable foreign-key, composite-key, missing-key, duplicate-key, empty/single/multiple relation, and direction errors have focused behavior/diagnostics.
  • Memory fixtures seed and reset deterministically and reject behavior outside Memory's documented capabilities.
  • Fake units of work record writes and mirror the public begin/commit/rollback/failure/cancellation/disposal lifecycle without simulating provider semantics.
  • SQLite/server-backed tests remain the documented authority for SQL translation, physical types, defaults, transactions, and provider behavior.
  • Consumer-shaped DI replacement examples compile and clearly identify their fidelity level.
  • Focused T10 evidence is recorded in 0.10: Produce release evidence and frozen-candidate closeout #106 before this issue closes.

Dependency and order

Explicit non-goals

  • A second LINQ-to-Objects query provider or widened DataLinq.Memory semantics.
  • Mocks that bypass metadata, key, equality, or relation invariants.
  • Simulated SQL-provider transaction behavior.
  • Generated test-shape interfaces without demonstrated need.
  • A broad query-assertion DSL.

Planning sources

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions