feat(nsubstitute): milestone 5 phase 1 - Compono.NSubstitute package - #29
Conversation
NSubstituteProvider/NSubstituteOptions/UseNSubstitute per ADR-0025 (Amendment 1's corrected snapshot/delegate-matching shapes). Tests (Phase 2) and docs (Phase 3) tracked separately in PLAN-0005. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Trim wording that implied all transitive dependencies would otherwise disappear - it's specifically the analyzer asset that needs to flow through. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bd47a90118
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ### Phase 1: `Compono.NSubstitute` package (ADR-0025) | ||
|
|
||
| **Status:** Not Started | ||
| **Status:** Done |
There was a problem hiding this comment.
Update the shipped-state docs in this phase
Marking Phase 1 done while leaving docs/public-api.md:425-427 and docs/mvp.md:270-276 saying that Compono.NSubstitute is “not yet implemented” makes the API and roadmap documentation contradict the packable project and public entry points added by this commit. This affects readers immediately after the change lands, even if verification remains pending in Phase 2; update those statements to distinguish implemented package code from pending tests rather than deferring the correction to Phase 3.
AGENTS.md reference: AGENTS.md:L156-L157
Useful? React with 👍 / 👎.
…nted docs/public-api.md and docs/mvp.md still said the package was "not yet implemented" after this phase's code landed - pulled the correction forward into this PR rather than deferring to Phase 3, per Codex review and matching the same fix pattern PR #28 established for Phase 0. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Summary
Implements Milestone 5 Phase 1: the
Compono.NSubstitutepackage itself, per ADR-0025 (Amendment 1's corrected shapes). Phase 0's coreICompositionValueProviderextensibility mechanism (ADR-0024) already merged in #28 — this phase is the first real consumer of it.Changes
src/Compono.NSubstituteproject:NSubstituteProvider(interface / delegate / optional unsealed-abstract-class substitution viaSubstitute.For(Type[], object[])),NSubstituteOptions(SubstituteAbstractClasses, defaulttrue), andCompositionBuilderExtensions.UseNSubstitute()/UseNSubstitute(configure).NSubstituteProvidersnapshotsNSubstituteOptions.SubstituteAbstractClassesinto aprivate readonly boolat construction rather than retaining the mutable options instance, and delegate matching usesIsSubclassOf(typeof(MulticastDelegate))rather thantypeof(Delegate).IsAssignableFrom(...)— both per ADR-0025 Amendment 1, catching a pre-implementation review finding before any code shipped.Compono.NSubstitute.csprojmirrorsCompono.XunitV3.csproj's shape (net10.0;net11.0,ProjectReferencetoComponowithPrivateAssets="none"soCompono.Generators's analyzer asset flows to consumers,PackageReferencetoNSubstitute).Compono.slnx;docs/plans/0005-milestone-5-nsubstitute-integration.mdPhase 1 markedDone.PrivateAssets="none"comment onCompono.XunitV3.csproj'sComponoreference — the original wording implied all transitive dependencies would otherwise disappear rather than specifically the analyzer asset.Validation
dotnet buildon the whole solution (Compono.slnx): 0 warnings, 0 errors.test/Compono.NSubstitute.Testsis Phase 2 of PLAN-0005, tracked separately and not part of this PR's scope.Related Issues
Part of PLAN-0005, implementing ADR-0025.