DynamicEndpoints.Testing 0.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package DynamicEndpoints.Testing --version 0.3.0
                    
NuGet\Install-Package DynamicEndpoints.Testing -Version 0.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DynamicEndpoints.Testing" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DynamicEndpoints.Testing" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="DynamicEndpoints.Testing" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DynamicEndpoints.Testing --version 0.3.0
                    
#r "nuget: DynamicEndpoints.Testing, 0.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DynamicEndpoints.Testing@0.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DynamicEndpoints.Testing&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=DynamicEndpoints.Testing&version=0.3.0
                    
Install as a Cake Tool

DynamicEndpoints.Testing

Test helpers for DynamicEndpoints. Run your dynamic endpoints in WebApplicationFactory, or on a small test server, without PostgreSQL or any other database.

License: MIT

Your application, in memory

await using var factory = new WebApplicationFactory<Program>()
    .WithInMemoryDynamicEndpoints(b => b.AddProcessor("fake-crm", _ => Results.Ok(new { id = 1 })));

await factory.AddDynamicEndpointAsync(DynamicEndpoint.Get("/customers/{id}").HandledBy("fake-crm").FromRoute("id"));
var response = await factory.CreateClient().GetAsync("/customers/1");

WithInMemoryDynamicEndpoints swaps the store for an in-memory one. It also removes store initializers (migrations), change notifiers and polling. Your seeders still run, against the in-memory store. In your own ConfigureTestServices it's services.UseInMemoryDynamicEndpoints().

Just your processors and validators

await using var server = await DynamicEndpointsTestServer.StartAsync(b => b
    .AddProcessor<OrderLookupProcessor>()
    .AddValidator<NipValidator>());

await server.AddEndpointAsync(DynamicEndpoint.Get("/orders/{id}").HandledBy<OrderLookupProcessor>().FromRoute("id"));
var order = await server.Client.GetFromJsonAsync<Order>("/orders/42");
var openApi = server.OpenApi.GetDocument();

Several instances

Share one InMemoryDynamicEndpointStore and one InMemoryDynamicEndpointChangeNotifier between servers:

var store = new InMemoryDynamicEndpointStore();
var notifier = new InMemoryDynamicEndpointChangeNotifier();
var options = new DynamicEndpointsTestServerOptions { Store = store, DynamicEndpoints = b => b.UseChangeNotifier(notifier) };
await using var a = await DynamicEndpointsTestServer.StartAsync(options);
await using var b = await DynamicEndpointsTestServer.StartAsync(options);

๐Ÿ“– Documentation ยท ๐Ÿ“ Changelog

Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.4.0 124 10/2/2026
0.3.0 106 10/2/2026