Releases: JohnVerheij/GrpcAssertions.TUnit
Releases · JohnVerheij/GrpcAssertions.TUnit
Release list
v0.3.0
[0.3.0] - 2026-06-14: server-streaming builders and assertions
Minor release. Extends the builder and the assertion surface from unary calls to server-streaming calls: GrpcCallBuilder now constructs AsyncServerStreamingCall<T> test doubles, and a Streams() chain asserts on the streamed responses. Purely additive; the 0.2.0 ApiCompat baseline is preserved.
Added
GrpcCallBuilder.ServerStreaming<TResponse>(IEnumerable<TResponse> responses)builds a successful server-streaming call whose response stream yields the responses in order and then ends cleanly with a terminalStatusCode.OK.GrpcCallBuilder.ServerStreamingFaulted<TResponse>(StatusCode statusCode, IEnumerable<TResponse> responses, string? detail = null)builds a server-streaming call that yields the responses and then throws anRpcExceptionon the next read, so a wrapper's mid-stream fault handling can be exercised.Streams()on anAsyncServerStreamingCall<TResponse>begins a server-streaming assertion that reads the response stream once. ChainStreamsAtLeast(int)/StreamsExactly(int)to assert the response count,StreamContains(Func<TResponse, bool>)to assert at least one response matches (the predicate text is captured for the failure message), andAndStreamItems(Func<IReadOnlyList<TResponse>, Task>)to run follow-on assertions against the materialized responses without re-reading the stream. A stream that faults mid-read fails with the partial count and the rendered gRPC outcome.
v0.2.0
[0.2.0] - 2026-06-12: response and trailer metadata on the builder, trailer assertions
Minor release. Lets a faked call carry response headers and trailers, and adds trailer assertions (text and binary) to the RpcException chain. Purely additive.
Added
GrpcCallBuilder.Success<T>(T response, Metadata? responseHeaders, Metadata? trailers)andGrpcCallBuilder.Faulted<T>(StatusCode statusCode, string? detail, Metadata trailers)build calls that carry response metadata, so a wrapper that reads response headers or trailers can be tested against a fake. A null headers or trailers argument is treated as empty metadata.WithTrailer(string key, string value)andWithTrailer(string key, ReadOnlySpan<byte> value)on theThrowsGrpcException()chain assert the exception'sTrailerscontain a text or binary (-bin) entry. Keys are matched case-insensitively (gRPC lowercases metadata keys). The text overload readsMetadata.Entry.Valueand the binary overload readsMetadata.Entry.ValueBytes, each guarded byEntry.IsBinary, so the value of a binary entry is never read as a string. On failure the message renders the trailers, with binary entries shown as(binary, N bytes).
Fixed
GrpcCallBuilder.Success<T>now returns the same trailersMetadatainstance on every call to the trailers accessor, matching a real client; it previously returned a fresh emptyMetadataeach time, so an identity check or mutation did not behave as it would against a real call.
Changed
- README adds an "Await the call against a generated client" note: a generated client's
XAsyncreturnsAsyncUnaryCall<T>whose fault lives inResponseAsync, so a delegate that returns the call without awaiting it never surfaces the fault and the assertion reports no exception. Assert viaasync () => await client.XAsync(...)orclient.XAsync(...).ResponseAsyncwhen testing a raw generated client; wrapper tests, which returnTask, are unaffected. - Bumped
PackageValidationBaselineVersionfrom0.1.1to0.1.2on both packages so ApiCompat strict-mode validates0.2.0against the most recently published baseline. The new overloads are recorded as additive differences inCompatibilitySuppressions.xml.
v0.1.2
Immutable
release. Only release title and notes can be modified.
[0.1.2] - 2026-06-05: documentation refresh
Documentation and release-tooling release. No API or behavior change.
Changed
- Refreshed the README (plain-ASCII punctuation) and rewrote the shared
CONVENTIONS.md: removed the version-history preamble so it reads as a conventions document, not a changelog. - The release workflow now publishes the matching
CHANGELOG.mdsection as the GitHub release body (body_path), so release notes carry the full hand-written detail instead of GitHub's auto-generated commit summary.
v0.1.1
Immutable
release. Only release title and notes can be modified.
What's Changed
- deps(nuget): update tunit to v1.49.0 by @renovate[bot] in #7
- docs: add GrpcCallBuilder and ThrowsGrpcException cookbook recipes by @JohnVerheij in #6
Full Changelog: v0.1.0...v0.1.1
v0.1.0
Immutable
release. Only release title and notes can be modified.
What's Changed
- feat: gRPC outcome assertions (0.1.0) by @JohnVerheij in #1
- ci(github-actions): update actions/checkout action to v6.0.3 by @renovate[bot] in #3
- ci(github-actions): update github/codeql-action action to v4.36.1 by @renovate[bot] in #4
- deps(nuget): update tunit to v1.48.6 by @renovate[bot] in #5
New Contributors
- @JohnVerheij made their first contribution in #1
- @renovate[bot] made their first contribution in #3
Full Changelog: v0.0.1...v0.1.0
v0.0.1
Immutable
release. Only release title and notes can be modified.