Skip to content

test: the contract's and the store's refusals are each held by a test that fails without them - #56

Merged
CaffeinatedCoder merged 1 commit into
mainfrom
test/52-guards-held-by-tests
Nov 12, 2026
Merged

CaffeinatedCoder merged 1 commit into
mainfrom
test/52-guards-held-by-tests

Conversation

@CaffeinatedCoder

Copy link
Copy Markdown
Owner

Closes #52

Problem

The analysis of #46 removed each guard in a scratch copy. Three refusals had no test that failed, and one test could not fail:

  • a contributor with no placement (SchemaContributorRegistry),
  • ImpactOf returning null (the base class),
  • a property written twice in a stored value,
  • The_read_model_is_ordered_by_key_whatever_the_order_of_declaration passed without the OrderBy, because EF Core returns an entity type's annotations sorted by name.

Change

Tests, and one change under src/:

  • A property stored twice has its own refusal. Until now "nullsDistinct":false,"nullsDistinct":true was refused only because what was read did not write back the same, with the message that blames the contributor's Read. And "nullsDistinct":true,"nullsDistinct":true was not refused at all. DeclarationCodec.Read now checks the whole value, nested objects and lists included, before anything is read, and names the object and the property ('K.keys[1]' has the property 'column' twice).
  • The ordering test keeps the OrderBy and reads a second time through an entity type that returns its annotations reversed (a DispatchProxy over the real one). The order is the store's promise; that EF Core's own entity types happen to sort is not.
  • CLAUDE.md names the new refusal beside the others.

Tests

Kernel tests without a server, on SDK 11.0.100 in the checkout: 279 before, 287 after. The PostgreSQL integration tests did not run locally; CI runs them.

New: A_contributor_without_a_placement_is_refused, An_impact_that_is_null_is_refused, A_property_that_is_stored_twice_is_refused (5 rows: different values, equal values, the version, inside a list, inside a nested object) and its allowed twin The_value_the_repetitions_are_made_from_is_read.

Each guard undone in a scratch copy:

Undone Fails
The Placement is null refusal A_contributor_without_a_placement_is_refused
The ImpactOf returned null refusal An_impact_that_is_null_is_refused
The repeated-property check all 5 rows of A_property_that_is_stored_twice_is_refused
The OrderBy in Stored The_read_model_is_ordered_by_key_whatever_the_order_of_declaration

🤖 Generated with Claude Code

… that fails without them

A contributor without a placement and an ImpactOf that returns null had no
test. The ordering test could not fail: EF Core returns an entity type's
annotations sorted, so it now also reads through an entity type that returns
them reversed.

A property stored twice was refused only because what was read did not write
back the same, with the message for a Read that changed the declaration, and
not at all when both values were equal. It is now refused before anything is
read, for what it is.

Closes #52

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@CaffeinatedCoder CaffeinatedCoder added this to the 11.0.0 milestone Nov 12, 2026
@CaffeinatedCoder CaffeinatedCoder added tests Adds or changes tests only (harnesses, parity suites); no library code package/core Affects CodoMetis.EFCore.SchemaKit (the kernel) area/migrations The differ and generator decorators, snapshot format, EnsureCreated and the UseSchemaKit wiring labels Nov 12, 2026
@CaffeinatedCoder
CaffeinatedCoder merged commit 55162fa into main Nov 12, 2026
6 of 7 checks passed
@CaffeinatedCoder
CaffeinatedCoder deleted the test/52-guards-held-by-tests branch November 12, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/migrations The differ and generator decorators, snapshot format, EnsureCreated and the UseSchemaKit wiring package/core Affects CodoMetis.EFCore.SchemaKit (the kernel) tests Adds or changes tests only (harnesses, parity suites); no library code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Three refusals of the contract and the store have no test that fails without them, and the ordering test cannot fail

1 participant