Class RpcExceptionAssertions
- Namespace
- GrpcAssertions.TUnit
- Assembly
- GrpcAssertions.TUnit.dll
TUnit-native fluent entry points for asserting on gRPC exceptions. The v0.0.1 surface ships the
IsRpcException() discriminator only; the full outcome-assertion surface
(ThrowsGrpcException and the StatusCode shorthands, plus the GrpcCallBuilder
test infrastructure) ships in v0.1.0.
public static class RpcExceptionAssertions
- Inheritance
-
RpcExceptionAssertions
- Inherited Members
Remarks
Source methods carry the [GenerateAssertion] attribute; TUnit's source generator emits
the fluent Assert.That(...).<Method>() entry point at consumer build time. The
generated chain is AOT-clean (no runtime reflection in the assertion path).
Methods
IsRpcException(Exception)
Asserts that the exception is a gRPC RpcException (the exception type a failed gRPC
call surfaces). Use it as a lightweight discriminator when a test has caught an exception
and wants to confirm it originated from a gRPC call before inspecting its status.
[GenerateAssertion]
public static AssertionResult IsRpcException(this Exception value)
Parameters
valueExceptionThe exception under test.
Returns
- AssertionResult
A passing assertion when
valueis a gRPCRpcException; otherwise a failing assertion naming the actual exception type.
Exceptions
- ArgumentNullException
valueis null.