redb.Route.TestKit
4.7.1
Prefix Reserved
See the version list below for details.
dotnet add package redb.Route.TestKit --version 4.7.1
NuGet\Install-Package redb.Route.TestKit -Version 4.7.1
<PackageReference Include="redb.Route.TestKit" Version="4.7.1" />
<PackageVersion Include="redb.Route.TestKit" Version="4.7.1" />
<PackageReference Include="redb.Route.TestKit" />
paket add redb.Route.TestKit --version 4.7.1
#r "nuget: redb.Route.TestKit, 4.7.1"
#:package redb.Route.TestKit@4.7.1
#addin nuget:?package=redb.Route.TestKit&version=4.7.1
#tool nuget:?package=redb.Route.TestKit&version=4.7.1
redb.Route.TestKit
Test a route without its brokers, without changing the route. Works with xUnit, NUnit and MSTest:
assertions throw MockAssertionException, no test-framework dependency.
await using var ctx = new RouteContext().AddRoutes(new OrdersRoutes());
ctx.AdviceRoute("orders", a => a
.ReplaceFrom("direct://test-in") // instead of kafka://orders
.MockEndpoints("kafka://*", "sql:*")); // every matching To(...) goes to a mock
await ctx.Start();
var vip = ctx.Mock("kafka://orders-vip");
vip.ExpectMessageCount(1).ExpectHeader("priority", "high");
await ctx.SendBody("direct://test-in", order);
await vip.AssertIsSatisfiedAsync(TimeSpan.FromSeconds(2));
What is inside
| API | Purpose |
|---|---|
ctx.AdviceRoute(routeId, a => ...) |
rewrite a route definition before Start(): ReplaceFrom, MockEndpoints, MockEndpointsAndSkip, WeaveById, WeaveByToUri, WeaveAddFirst, WeaveAddLast |
ctx.Mock(uri) |
the MockEndpoint standing in for uri (original URI or mock://name) |
MockEndpoint.Expect* |
ExpectMessageCount, ExpectMinimumMessageCount, ExpectBodies, ExpectBodiesInAnyOrder, ExpectHeader, ExpectHeaderReceived, ExpectProperty, Expect(predicate / condition string) |
MockEndpoint.AssertIsSatisfiedAsync(timeout) |
waits, then fails with an "Expected / but was" diff and the bodies received |
MockEndpoint.Whenever(n) / WheneverAny() |
scripted replies: SetBody, SetHeader, Delay, Throw, Do — for Enrich and request-reply through mock:// |
ctx.Notify().FromRoute("orders").WhenDone(3).Create() |
wait for route events (WhenReceived, WhenCompleted, WhenFailed, WhenDone, From(uriMask), Filter(condition)) without a mock at the end |
ctx.SendBody, ctx.SendBodyAndHeaders, ctx.RequestBody<T> |
one-line sends instead of endpoint/producer plumbing |
URI masks (MockEndpoints, WeaveByToUri, Notify().From): exact URI, prefix with a trailing *
(kafka://*), or regex:<expression>. Query strings are ignored for matching.
MockEndpoints rewrites the static To(...) steps of the advised route; a dynamic ToD(...)
resolves its URI per message and is not rewritten — point it at a mock:// URI through the
message instead.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 is compatible. 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 is compatible. 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. |
-
net10.0
- JsonPath.Net (>= 2.2.0)
- JsonSchema.Net (>= 7.3.4)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.13)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Options (>= 10.0.13)
- redb.Route (>= 4.7.1)
-
net8.0
- JsonPath.Net (>= 2.2.0)
- JsonSchema.Net (>= 7.3.4)
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.13)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.13)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Options (>= 10.0.13)
- redb.Route (>= 4.7.1)
-
net9.0
- JsonPath.Net (>= 2.2.0)
- JsonSchema.Net (>= 7.3.4)
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.13)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.13)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Options (>= 10.0.13)
- redb.Route (>= 4.7.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.7.2 | 47 | 11/13/2026 |
| 4.7.1 | 82 | 11/11/2026 |
| 4.7.0 | 94 | 11/7/2026 |
| 4.6.2 | 95 | 11/5/2026 |
| 4.6.1 | 91 | 11/4/2026 |
| 4.6.0 | 92 | 11/3/2026 |
| 4.5.1 | 96 | 10/30/2026 |
| 4.5.0 | 95 | 10/29/2026 |
| 4.4.2 | 98 | 10/23/2026 |
| 4.4.1 | 102 | 10/21/2026 |
| 4.3.0 | 98 | 10/14/2026 |
| 4.2.3 | 89 | 10/8/2026 |
| 4.2.2 | 110 | 10/5/2026 |
| 4.2.0 | 107 | 9/30/2026 |
| 4.1.1 | 102 | 9/25/2026 |
| 4.1.0 | 100 | 9/21/2026 |
| 4.0.1 | 110 | 9/18/2026 |
| 4.0.0 | 115 | 9/11/2026 |