Skip to content

Compono.NSubstituteProvider

Compono.NSubstitute

Compono

NSubstituteProvider Class

A stage-6 test-double provider that composes an interface, delegate, or (when SubstituteAbstractClasses allows it) unsealed abstract-class request as a real NSubstitute substitute, via NSubstitute.Substitute.For(System.Type[],System.Object[]). Registered via CompositionBuilderExtensions.UseNSubstitute(). See docs/adr/0025-compono-nsubstitute-package-design.md (Amendment 1 for the corrected shape below).

public sealed class NSubstituteProvider : Compono.ICompositionValueProvider

Inheritance System.Object → NSubstituteProvider

Implements ICompositionValueProvider

Constructors
NSubstituteProvider(NSubstituteOptions) Creates an NSubstituteProvider, snapshotting options's current values - the provider never retains the caller-owned NSubstituteOptions instance itself, so a caller mutating it after construction can't change this already-registered provider's behavior (ADR-0024's immutable-provider-registration guarantee).
Methods
TryProvide(CompositionProviderRequest, ICompositionContext) Attempts to produce a value for request. Returns NotHandled for any request this provider doesn't apply to, so a later provider or pipeline stage still gets a chance - never throws for an expected non-match.