UnitTestEx.Azure.Functions.Durable
7.0.0-preview
dotnet add package UnitTestEx.Azure.Functions.Durable --version 7.0.0-preview
NuGet\Install-Package UnitTestEx.Azure.Functions.Durable -Version 7.0.0-preview
<PackageReference Include="UnitTestEx.Azure.Functions.Durable" Version="7.0.0-preview" />
<PackageVersion Include="UnitTestEx.Azure.Functions.Durable" Version="7.0.0-preview" />
<PackageReference Include="UnitTestEx.Azure.Functions.Durable" />
paket add UnitTestEx.Azure.Functions.Durable --version 7.0.0-preview
#r "nuget: UnitTestEx.Azure.Functions.Durable, 7.0.0-preview"
#:package UnitTestEx.Azure.Functions.Durable@7.0.0-preview
#addin nuget:?package=UnitTestEx.Azure.Functions.Durable&version=7.0.0-preview&prerelease
#tool nuget:?package=UnitTestEx.Azure.Functions.Durable&version=7.0.0-preview&prerelease
UnitTestEx.Azure.Functions.Durable (preview)
Optional 7.0.0-preview package for fluent in-memory Durable Task SDK-host tests, activity mocks, invocation verification, managed diagnostics and a separate method-level virtual-time context. Regular UnitTestEx dependencies use 7.0.0.
Preview and scope: This evolving implementation targets key testing scenarios, not exhaustive Durable Functions coverage. It depends on Microsoft's preview Microsoft.DurableTask.InProcessTestHost 0.2.3-preview.1; breaking changes may occur between preview releases. Request additional scenarios.
Quick start
using System;
using System.Threading.Tasks;
using UnitTestEx;
using UnitTestEx.Azure.Functions.Durable.TestHost;
using var functions = FunctionTester.Create<WorkflowActivities>();
await using var run = await functions.DurableTask()
.Orchestrator<string, string>("OutputProbe", (_, input) => Task.FromResult(input))
.StartAsync("hello");
await run.WaitForCompletionAsync(TimeSpan.FromSeconds(10),
result => result.AssertCompleted().AssertOutput("hello"));
Use an ordinary class from your Functions application assembly in place of WorkflowActivities. This minimal delegate checks wiring; register delegates to real application orchestrations/activities to test their behavior. The showcase runs a real batch body with controlled activity responses.
To run application activities and orchestrations without forwarding delegates, use functions.DurableTask().WithSelfDiscovery(). It scans only the parent marker's assembly; WithSelfDiscovery<T>() adds another marker's assembly. Explicit registrations override discoveries. Direct orchestration runs select a root with .Orchestrator(...); for a starter function, use .StartHostAsync(), pass session.Client explicitly, and observe its known instance ID with session.Observe<TOutput>(id). See the starter example. Dispose the run before the session and FunctionTester. Real instance activities use owned invocation scopes; discovered instance orchestrations retain separate scopes across replay until session/run disposal. Duplicate names/unsupported signatures fail early. Real activities may have external side effects.
Boundaries
- SDK-host orchestration timers and retry delays use wall-clock time, not virtual time.
VirtualTimeOrchestrationContextis a separate method-level timer/event tool without engine history/replay or activity/child execution.- The pinned SDK host has a buffered-event preservation limitation across
ContinueAsNew; use real-worker integration to test preservation. - SDK-host tests do not run the Functions worker or prove binding/serializer parity. Ordinary activity-method tests use
FunctionTester.Trigger<T>()without this optional package. - Starter tests invoke the method directly with an SDK-host client; they do not exercise Service Bus delivery or
[DurableClient]binding.
AI assistance and documentation
The package includes skills/unittestex-durable/SKILL.md, version-matched to these APIs and boundaries. See discovery and optional installation.
| 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. net11.0 is compatible. |
-
net10.0
- Microsoft.DurableTask.Abstractions (>= 1.28.0)
- Microsoft.DurableTask.InProcessTestHost (>= 0.2.3-preview.1)
- UnitTestEx.Azure.Functions (>= 7.0.0)
-
net11.0
- Microsoft.DurableTask.Abstractions (>= 1.28.0)
- Microsoft.DurableTask.InProcessTestHost (>= 0.2.3-preview.1)
- UnitTestEx.Azure.Functions (>= 7.0.0)
-
net8.0
- Microsoft.DurableTask.Abstractions (>= 1.28.0)
- Microsoft.DurableTask.InProcessTestHost (>= 0.2.3-preview.1)
- UnitTestEx.Azure.Functions (>= 7.0.0)
-
net9.0
- Microsoft.DurableTask.Abstractions (>= 1.28.0)
- Microsoft.DurableTask.InProcessTestHost (>= 0.2.3-preview.1)
- UnitTestEx.Azure.Functions (>= 7.0.0)
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 |
|---|---|---|
| 7.0.0-preview | 0 | 11/15/2026 |