Table of Contents

Class TestStageSetup

Namespace
Mokkit.Suite
Assembly
Mokkit.dll

Represents the setup and initialization phase for test stages, managing the lifecycle of dependency container builders. This class orchestrates the multi-phase initialization process (PreInit → Init → PreBuild → Build) and creates test stages with configured containers.

public class TestStageSetup

Inheritance

Inherited Members

Constructors

TestStageSetup(IEnumerable<IDependencyContainerBuilder>)

Initializes a new instance of the Mokkit.Suite.TestStageSetup class with the specified dependency container builders. This constructor creates a new test host bag accessor for managing shared test resources.

protected TestStageSetup(IEnumerable<IDependencyContainerBuilder> builders)

Parameters

builders IEnumerable<IDependencyContainerBuilder>

The collection of dependency container builders to manage.

Methods

BuildContainers()

Executes the multi-phase container building process for all registered dependency container builders. This method orchestrates the complete initialization lifecycle: PreInit → Init → PreBuild → Build. Each phase is executed for all builders before proceeding to the next phase to ensure proper initialization order.

protected Task BuildContainers()

Returns

Task

A task that represents the asynchronous container building operation.

Create(params IDependencyContainerBuilder[])

Creates and initializes a new Mokkit.Suite.TestStageSetup instance with the specified dependency container builders. This factory method executes the complete container building process before returning the setup instance.

public static Task<TestStageSetup> Create(params IDependencyContainerBuilder[] builders)

Parameters

builders IDependencyContainerBuilder[]

The dependency container builders to configure for the test stage setup.

Returns

Task<TestStageSetup>

A fully initialized Mokkit.Suite.TestStageSetup instance ready to create test stages.

EnterStage()

Creates and enters a new test stage with the configured dependency containers. This method can only be called after the containers have been successfully built through the initialization process.

public TestStage EnterStage()

Returns

TestStage

A new Mokkit.Suite.TestStage instance with the configured containers and a unique stage identifier.

Exceptions

InvalidOperationException

Thrown when containers have not been built yet.