XBullet.EasyTesting.AzureFunctions
1.0.12
dotnet add package XBullet.EasyTesting.AzureFunctions --version 1.0.12
NuGet\Install-Package XBullet.EasyTesting.AzureFunctions -Version 1.0.12
<PackageReference Include="XBullet.EasyTesting.AzureFunctions" Version="1.0.12" />
<PackageVersion Include="XBullet.EasyTesting.AzureFunctions" Version="1.0.12" />
<PackageReference Include="XBullet.EasyTesting.AzureFunctions" />
paket add XBullet.EasyTesting.AzureFunctions --version 1.0.12
#r "nuget: XBullet.EasyTesting.AzureFunctions, 1.0.12"
#:package XBullet.EasyTesting.AzureFunctions@1.0.12
#addin nuget:?package=XBullet.EasyTesting.AzureFunctions&version=1.0.12
#tool nuget:?package=XBullet.EasyTesting.AzureFunctions&version=1.0.12
XBullet.EasyTesting.AzureFunctions
In-memory test infrastructure for .NET isolated Azure Functions, including function contexts, middleware, bindings, retry state, Durable orchestration activity dispatch, and fluent trigger data.
The package targets .NET 8, .NET 9, and .NET 10.
Install
dotnet add package XBullet.EasyTesting.AzureFunctions
await using var host = AzureFunctionTestHost.CreateBuilder()
.AddFunction<ProcessOrderHttpFunction>()
.Build();
var request = host.HttpRequest(nameof(ProcessOrderHttpFunction))
.WithMethod(HttpMethod.Post)
.WithUrl("/api/orders")
.WithJsonBody(new CreateOrderRequest("order-42", 3))
.Build();
var function = host.GetRequiredService<ProcessOrderHttpFunction>();
var response = await function.RunAsync(request, request.FunctionContext);
Builders are available for HTTP, timer, Kafka, Service Bus, Queue Storage, Blob, Event Grid, and Event Hubs triggers.
Durable orchestrators can use TestOrchestrationContext to record activity scheduling and dispatch each call to a real activity instance:
var activity = new CreateOrderActivity(dependency);
var context = new TestOrchestrationContext(async call =>
call.ActivityName switch
{
nameof(CreateOrderActivity) =>
await activity.RunAsync((CreateOrderRequest)call.Input!),
_ => throw new InvalidOperationException($"Unexpected activity '{call.ActivityName}'."),
});
var result = await orchestrator.RunAsync(context);
Assert.Equal(nameof(CreateOrderActivity), context.ActivityCalls.Single().ActivityName);
Only CallActivityAsync is emulated; Durable runtime operations such as timers, external events, sub-orchestrators, and replay state throw NotSupportedException.
See the repository documentation for invocation and binding examples.
| 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
- Microsoft.Azure.Functions.Worker.Core (>= 2.52.0)
- Microsoft.Azure.Functions.Worker.Extensions.Http (>= 3.3.0)
- Microsoft.Azure.Functions.Worker.Extensions.Timer (>= 4.3.1)
- Microsoft.DurableTask.Abstractions (>= 1.24.1)
-
net8.0
- Microsoft.Azure.Functions.Worker.Core (>= 2.52.0)
- Microsoft.Azure.Functions.Worker.Extensions.Http (>= 3.3.0)
- Microsoft.Azure.Functions.Worker.Extensions.Timer (>= 4.3.1)
- Microsoft.DurableTask.Abstractions (>= 1.24.1)
-
net9.0
- Microsoft.Azure.Functions.Worker.Core (>= 2.52.0)
- Microsoft.Azure.Functions.Worker.Extensions.Http (>= 3.3.0)
- Microsoft.Azure.Functions.Worker.Extensions.Timer (>= 4.3.1)
- Microsoft.DurableTask.Abstractions (>= 1.24.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.