Repost.Client.Testing
1.0.8
dotnet add package Repost.Client.Testing --version 1.0.8
NuGet\Install-Package Repost.Client.Testing -Version 1.0.8
<PackageReference Include="Repost.Client.Testing" Version="1.0.8" />
<PackageVersion Include="Repost.Client.Testing" Version="1.0.8" />
<PackageReference Include="Repost.Client.Testing" />
paket add Repost.Client.Testing --version 1.0.8
#r "nuget: Repost.Client.Testing, 1.0.8"
#:package Repost.Client.Testing@1.0.8
#addin nuget:?package=Repost.Client.Testing&version=1.0.8
#tool nuget:?package=Repost.Client.Testing&version=1.0.8
Repost.Client.Testing
Test doubles for the Repost.Client webhook publish client. Consumer tests drive the real runtime end to end — options validation, serialization, retry, and delivery semantics — without network access.
StubTransport— a thread-safe scriptedITransport: an ordered FIFO script of one-attempt outcomes plus credential-free request recording (Authorizationstripped, exact body copy). An empty script surfaces a faultedInvalidOperationException, the raw-defect shape the runtime never retries.ControlledResponse— the test-driven pending response fromStubTransport.EnqueuePending():Complete(...)/Fail(...)/Cancel(...)/IsDone.TestDefaultValueGenerators—Fixed(now, uuid, cuid),Sequence(...),Failing(...)injectables behind@default(now()/uuid()/cuid())and the envelope timestamp.TestIdempotencyKeyGenerator—Fixed(key),Sequence(...),Failing(...)forRepostClientOptions.IdempotencyKeyGenerator.DeterministicRetryEntropy—Sequence(...)(range-validated, throws when exhausted) andZeroforRepostClientOptions.RetryEntropy.ManualTimeProvider— aTimeProviderwhose wall and monotonic clocks share one counter advanced explicitly viaAdvance(...)/UtcNow, firing due timers in order.RecordingObserver— anIRepostObserverrecorder with anEventssnapshot andAwaitNextAsync(timeout).
Example
using Repost.Client;
using Repost.Client.Testing;
var transport = new StubTransport();
transport.EnqueueResponse(
202,
"{\"id\":\"msg_1\",\"type\":\"book.created\",\"customerId\":\"cus_1\","
+ "\"timestamp\":\"1970-01-01T00:00:00.000Z\"}");
var options = new RepostClientOptions
{
ApiKey = "test-key",
Transport = transport,
DefaultValueGenerators = TestDefaultValueGenerators.Fixed(
DateTimeOffset.UnixEpoch,
"00000000-0000-4000-8000-000000000000",
"ck0nf0rm4nc3f1x3dcu1d000"),
IdempotencyKeyGenerator = TestIdempotencyKeyGenerator.Fixed("test-key-1"),
RetryEntropy = DeterministicRetryEntropy.Zero,
};
The accepted-response body must echo the request envelope's type,
customerId, and timestamp; fixing Now() makes that echo knowable, so
the script above parses as a real acceptance.
Every recorded request is an assertion target:
RecordedRequest sent = transport.Requests[0];
// sent.RequestUri, sent.Headers (no Authorization), sent.Body,
// sent.ConnectTimeout, sent.AttemptTimeout, sent.CaptureSequence
There is intentionally no "no network" guard type: the runtime reaches the
network only through RepostClientOptions.Transport, so injecting
StubTransport makes a test network-free by construction.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.7.2
- Microsoft.Bcl.TimeProvider (>= 8.0.1)
- Repost.Client (>= 1.0.8)
-
.NETStandard 2.0
- Microsoft.Bcl.TimeProvider (>= 8.0.1)
- Repost.Client (>= 1.0.8)
-
net8.0
- Repost.Client (>= 1.0.8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.