Class ProtoTestAssemblyHost<TSelf>

Namespace
ProtoTest.Core
Assembly
ProtoTest.Core.dll

The assembly-level host every test-framework adapter manages: one ProtoHost per test assembly, started once from the framework's assembly hook and stopped from its teardown. The lifetime is a static of the closed generic type, so two adapter assemblies loaded in one process each own their host instead of sharing one.

public abstract class ProtoTestAssemblyHost<TSelf> where TSelf : ProtoTestAssemblyHost<TSelf>, IProtoTestAssemblyHost<TSelf>

Type Parameters

TSelf
Inheritance
ProtoTestAssemblyHost<TSelf>
Derived
Inherited Members
Extension Methods

Properties

Host

Gets the initialized root host for this adapter assembly.

public static ProtoHost Host { get; }

Property Value

ProtoHost

Exceptions

InvalidOperationException

Thrown when accessed before initialization.

Methods

StartAsync(Action<IProtoHostBuilder>)

Builds and starts the host. Throws if it has already been initialized.

protected static Task StartAsync(Action<IProtoHostBuilder> configure)

Parameters

configure Action<IProtoHostBuilder>

Returns

Task

StopAsync()

Stops and disposes the host, clearing it so later access reports "not initialized".

protected static Task StopAsync()

Returns

Task