Skip to content

Releases: JohnVerheij/GrpcAssertions.TUnit

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 14 Jun 17:04
v0.3.0
acaa274

[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 terminal StatusCode.OK.
  • GrpcCallBuilder.ServerStreamingFaulted<TResponse>(StatusCode statusCode, IEnumerable<TResponse> responses, string? detail = null) builds a server-streaming call that yields the responses and then throws an RpcException on the next read, so a wrapper's mid-stream fault handling can be exercised.
  • Streams() on an AsyncServerStreamingCall<TResponse> begins a server-streaming assertion that reads the response stream once. Chain StreamsAtLeast(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), and AndStreamItems(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

Choose a tag to compare

@github-actions github-actions released this 12 Jun 05:58
v0.2.0
de7852a

[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) and GrpcCallBuilder.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) and WithTrailer(string key, ReadOnlySpan<byte> value) on the ThrowsGrpcException() chain assert the exception's Trailers contain a text or binary (-bin) entry. Keys are matched case-insensitively (gRPC lowercases metadata keys). The text overload reads Metadata.Entry.Value and the binary overload reads Metadata.Entry.ValueBytes, each guarded by Entry.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 trailers Metadata instance on every call to the trailers accessor, matching a real client; it previously returned a fresh empty Metadata each 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 XAsync returns AsyncUnaryCall<T> whose fault lives in ResponseAsync, so a delegate that returns the call without awaiting it never surfaces the fault and the assertion reports no exception. Assert via async () => await client.XAsync(...) or client.XAsync(...).ResponseAsync when testing a raw generated client; wrapper tests, which return Task, are unaffected.
  • Bumped PackageValidationBaselineVersion from 0.1.1 to 0.1.2 on both packages so ApiCompat strict-mode validates 0.2.0 against the most recently published baseline. The new overloads are recorded as additive differences in CompatibilitySuppressions.xml.

v0.1.2

Choose a tag to compare

@github-actions github-actions released this 05 Jun 19:27
Immutable release. Only release title and notes can be modified.
v0.1.2
6d4d477

[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.md section 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

Choose a tag to compare

@github-actions github-actions released this 04 Jun 15:54
Immutable release. Only release title and notes can be modified.
v0.1.1
ba0eba0

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

Choose a tag to compare

@github-actions github-actions released this 02 Jun 19:05
Immutable release. Only release title and notes can be modified.
v0.1.0
06c41ce

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

Full Changelog: v0.0.1...v0.1.0

v0.0.1

Choose a tag to compare

@github-actions github-actions released this 01 Jun 18:50
Immutable release. Only release title and notes can be modified.
v0.0.1
fd19940