Class ProtoGrpcBuilder

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

Properties

Services

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.

public IProtoTargetBuilder AddClient(string name = "Default", 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.

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

Parameters

configure Action<GrpcAttachmentOptions>

Returns

ProtoGrpcBuilder