Class StageResolve
- Namespace
- Mokkit.Containers
- Assembly
- Mokkit.dll
Resolves services from the test host bag. DI container adapters register this as their Mokkit.Containers.IStageResolve implementation so stage-provided instances (e.g. mocks) can be injected into the real graph.
public class StageResolve : IStageResolveInheritance
Implements
Inherited Members
Constructors
StageResolve(ITestHostBagAccessor)
Initializes a new instance of the Mokkit.Containers.StageResolve class with the specified test host bag accessor.
public StageResolve(ITestHostBagAccessor testHostBagAccessor)Parameters
testHostBagAccessorITestHostBagAccessor-
The test host bag accessor for accessing shared test resources.
Methods
Resolve(Type)
Resolves a service of the specified type from the test host bag.
public object? Resolve(Type serviceType)Parameters
serviceTypeType-
The type of service to resolve.
Returns
- object?
-
An instance of the requested service type from the test host bag, or
nullif not found.
Exceptions
- InvalidOperationException
-
Thrown when the test host bag is missing, indicating a corrupt resolver state.