Class ProtoHostBuilderSinkExtensions

Namespace
ProtoTest.Core
Assembly
ProtoTest.Core.dll
public static class ProtoHostBuilderSinkExtensions
Inheritance
ProtoHostBuilderSinkExtensions
Inherited Members

Methods

AddSink<TSink>(IProtoHostBuilder, Action<TSink>?)

Adds a report sink and ensures all registered sinks export at the end of the test run. The sink is constructed through dependency injection before the optional callback is applied; a callback supplied by a repeated call is applied too, when the sink is resolved. The same sink implementation type is registered once, however it was added - including a sink registered directly in the service collection - and distinct types compose. A sink registered directly through DI is left to construct itself; repeated calls only configure it.

public static IProtoHostBuilder AddSink<TSink>(this IProtoHostBuilder builder, Action<TSink>? configure = null) where TSink : class, IProtoSink

Parameters

builder IProtoHostBuilder
configure Action<TSink>

Returns

IProtoHostBuilder

Type Parameters

TSink

AddSink<TSink>(IProtoHostBuilder, TSink)

Adds an existing report sink instance.

public static IProtoHostBuilder AddSink<TSink>(this IProtoHostBuilder builder, TSink sink) where TSink : class, IProtoSink

Parameters

builder IProtoHostBuilder
sink TSink

Returns

IProtoHostBuilder

Type Parameters

TSink

Remarks

The instance is registered as-is. Unlike the generic overload, it is neither constructed through dependency injection nor bound from configuration, so the values it was created with are the values it keeps - a section that exists for the sink's options is ignored. The same sink implementation type is registered once, however it was added; distinct types compose, and the first registration wins.