Class ProtoGrpcBuilder

Namespace
ProtoTest.Grpc
Assembly
ProtoTest.Grpc.dll
public sealed class ProtoGrpcBuilder
Inheritance
ProtoGrpcBuilder
Inherited Members
Extension Methods

Fields

ProtocolName

Stable protocol key gRPC clients are registered and resolved under.

public const string ProtocolName = "Grpc"

Field Value

string

Properties

Services

Gets the service collection the gRPC integration registers into.

public IServiceCollection Services { get; }

Property Value

IServiceCollection

Methods

AddClient(string?, Func<ProtoExecutionContext, CancellationToken, ValueTask<Uri>>, Action<GrpcClientOptions>?)

Adds a client whose absolute address is resolved from per-test context.

public IProtoTargetBuilder AddClient(string? name, Func<ProtoExecutionContext, CancellationToken, ValueTask<Uri>> addressResolver, Action<GrpcClientOptions>? configure = null)

Parameters

name string
addressResolver Func<ProtoExecutionContext, CancellationToken, ValueTask<Uri>>
configure Action<GrpcClientOptions>

Returns

IProtoTargetBuilder

AddClient(string?, Func<ProtoExecutionContext, Uri>, Action<GrpcClientOptions>?)

Adds a client whose absolute address is read from per-test context.

public IProtoTargetBuilder AddClient(string? name, Func<ProtoExecutionContext, Uri> addressResolver, Action<GrpcClientOptions>? configure = null)

Parameters

name string
addressResolver Func<ProtoExecutionContext, Uri>
configure Action<GrpcClientOptions>

Returns

IProtoTargetBuilder

AddClient(string?, string?, Action<GrpcClientOptions>?)

Registers a named gRPC client. Inside AddApplication the client belongs to that application and takes its address from ProtoTest:Applications:{app}:Grpc:Address, falling back to the application's BaseUrl or its in-process transport. The name may be omitted for an application's only gRPC client.

public IProtoTargetBuilder AddClient(string? name = null, string? address = null, Action<GrpcClientOptions>? configure = null)

Parameters

name string
address string
configure Action<GrpcClientOptions>

Returns

IProtoTargetBuilder

CaptureAttachments(Action<GrpcAttachmentOptions>?)

Enables automatic request and response message attachments, sanitized and redacted. Repeated calls compose: every callback runs in registration order and configuration binds over the result.

public ProtoGrpcBuilder CaptureAttachments(Action<GrpcAttachmentOptions>? configure = null)

Parameters

configure Action<GrpcAttachmentOptions>

Returns

ProtoGrpcBuilder