Skip to content

Define package-detection and target-test-shape rules for generated tests #127

Description

@cwinland

Docs reference: docs/roadmap/generator-roadmap.md

Generated tests must be package-aware. This issue defines the shared package-detection and target-test-shape matrix that both generators and analyzers use.

Current dependency note:

  • #125 is the settled constructor-selection and graph-metadata contract boundary that generated test shapes must target.
  • This issue should decide package-aware harness or scaffold shape around that contract, not reopen the public construction-planning surface, parameter metadata model, or parameter-source enum from #125.
  • Broader project or suite preferences about desired generated test direction belong here or later authoring-flow issues, not in #125.

Current implementation status:

  • implemented on feature/122-graph-metadata-slice in commit c159ed8
  • added a shared analyzer package-layout and target-test-shape matrix for aggregate, core-only, and split helper-package layouts
  • wired MissingHelperPackageAnalyzer to the shared matrix so package guidance stops guessing from ad hoc checks
  • added focused analyzer tests for core-only, split-helper, and aggregate layouts
  • validated with dotnet test FastMoq.Analyzers.Tests/FastMoq.Analyzers.Tests.csproj across net8.0, net9.0, and net10.0

Acceptance checklist

  • The package-detection matrix is explicit for aggregate, core-only, and split helper-package layouts.
  • Supported generated test shapes are explicit for core, web, database, Azure, and Azure Functions package combinations.
  • Generated imports, harness selection, scenario or scaffold shapes, and helper availability are all derived from the same documented rules.
  • Analyzer package-suggestion and stop rules align with the same matrix before generation is offered.
  • The issue stays separate from helper-surface normalization so package rules do not silently absorb API-shape design.
  • Generated output never assumes an unreferenced helper package or ambiguous helper family.
  • The issue does not restate or reopen the constructor-selection contract already defined in #125.

Follow-on boundaries

  • helper-surface normalization stays in #134
  • analyzer rollout stays in #124

Metadata

Metadata

Assignees

No one assigned

    Labels

    analyzersAnalyzer and code-fix follow-up workapi-designPublic API and design evaluation workenhancementNew feature or requestpriorityThis should be worked on before others

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions