Class ProtoTestHostLifetime
Owns the single root ProtoHost for a test assembly and enforces one-time initialization. Shared by every test-framework adapter so host lifetime, guards, and shutdown ordering stay identical across frameworks.
public sealed class ProtoTestHostLifetime
- Inheritance
-
ProtoTestHostLifetime
- Inherited Members
- Extension Methods
Constructors
ProtoTestHostLifetime(string)
public ProtoTestHostLifetime(string initializationHint = "Initialize the ProtoTest assembly fixture before running tests.")
Parameters
initializationHintstringAdapter-specific guidance appended to the "not initialized" error message.
Properties
Host
Gets the initialized host.
public ProtoHost Host { get; }
Property Value
Exceptions
- InvalidOperationException
Thrown when accessed before initialization.
Methods
StartAsync(Action<IProtoHostBuilder>)
Builds and starts the host. Throws if it has already been initialized.
public Task StartAsync(Action<IProtoHostBuilder> configure)
Parameters
configureAction<IProtoHostBuilder>
Returns
StopAsync()
Stops and disposes the host, clearing it so later access reports "not initialized".
public Task StopAsync()