Skip to content

Harden core template behavior - #74

Merged
codefoxx merged 49 commits into
mainfrom
story/harden-core-template-behavior
May 22, 2026
Merged

Harden core template behavior#74
codefoxx merged 49 commits into
mainfrom
story/harden-core-template-behavior

Conversation

@codefoxx

Copy link
Copy Markdown
Owner

Summary

Hardens reusable core template behavior with focused contract tests around application results, validation, API error mapping, global exception handling, feature composition, and generated-template validation.

Why

The Products feature is only a sample proof slice. Core template behavior such as Result/Error/Option semantics, validation aggregation, HTTP ProblemDetails mapping, exception handling, and feature composition should be protected directly so the template remains safe to evolve and easier to trust.

Changes

  • Adds direct contract coverage for Result, Result<T>, Option<T>, Error, and ErrorCode.
  • Adds validation and ValidationResult<T> behavior tests.
  • Adds direct tests for EndpointResultExtensions and HTTP ProblemDetails mapping.
  • Adds direct tests for GlobalExceptionHandler safe unexpected-failure behavior.
  • Extends Feature Composition tests for configuration, ordering, decorator behavior, and guard clauses.
  • Splits large core contract test classes into nested partial files for IDE readability.
  • Aligns tests with explicit // Arrange, // Act, // Assert sections.
  • Keeps tests focused on reusable template behavior instead of expanding the Products sample domain.

Design notes

  • No new production dependencies.
  • No broad architecture rewrite.
  • No deep Products business testing.
  • No test project reshuffle; tests stay in the current layer-based projects for now.
  • Partial contract test files avoid template source-variant suffixes such as .None.cs, .PostgreSql.cs, and .SqlServer.cs.

Validation

dotnet test content/Company.Template.slnx
./scripts/template.sh all-postgres

codefoxx added 30 commits May 22, 2026 08:46
@codefoxx
codefoxx merged commit 52f700e into main May 22, 2026
7 checks passed
@codefoxx
codefoxx deleted the story/harden-core-template-behavior branch May 22, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant