Table of Contents

Class GrpcOutcomeRendering

Namespace
GrpcAssertions
Assembly
GrpcAssertions.dll

Framework-agnostic rendering of gRPC outcomes for assertion failure messages. Keeping the rendering in the core package lets consumer-authored gRPC assertions (in any test framework) produce diagnostics identical in shape to the GrpcAssertions.TUnit adapter.

public static class GrpcOutcomeRendering
Inheritance
GrpcOutcomeRendering
Inherited Members

Fields

MaxDetailLength

The maximum number of characters of a status detail rendered before truncation. Detail strings longer than this are cut to this length and suffixed with a horizontal-ellipsis character (U+2026), matching the truncation convention used across the assertion family.

public const int MaxDetailLength = 200

Field Value

int

Methods

Describe(RpcException)

Renders a gRPC RpcException as a single-line RpcException with StatusCode X, Detail "..." fragment for use in a failure message.

public static string Describe(RpcException exception)

Parameters

exception RpcException

The exception to render. Must not be null.

Returns

string

The rendered fragment.

Exceptions

ArgumentNullException

exception is null.

DescribeStatus(StatusCode, string?)

Renders a status code and detail as a single-line StatusCode X, Detail "..." fragment, with the detail truncated to MaxDetailLength characters.

public static string DescribeStatus(StatusCode statusCode, string? detail)

Parameters

statusCode StatusCode

The gRPC status code.

detail string

The status detail. A null value is rendered as an empty string.

Returns

string

The rendered fragment.