UnitTestEx.Azure.Functions.Durable 7.0.0-preview

This is a prerelease version of UnitTestEx.Azure.Functions.Durable.
dotnet add package UnitTestEx.Azure.Functions.Durable --version 7.0.0-preview
                    
NuGet\Install-Package UnitTestEx.Azure.Functions.Durable -Version 7.0.0-preview
                    
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="UnitTestEx.Azure.Functions.Durable" Version="7.0.0-preview" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="UnitTestEx.Azure.Functions.Durable" Version="7.0.0-preview" />
                    
Directory.Packages.props
<PackageReference Include="UnitTestEx.Azure.Functions.Durable" />
                    
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 UnitTestEx.Azure.Functions.Durable --version 7.0.0-preview
                    
#r "nuget: UnitTestEx.Azure.Functions.Durable, 7.0.0-preview"
                    
#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 UnitTestEx.Azure.Functions.Durable@7.0.0-preview
                    
#: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=UnitTestEx.Azure.Functions.Durable&version=7.0.0-preview&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=UnitTestEx.Azure.Functions.Durable&version=7.0.0-preview&prerelease
                    
Install as a Cake Tool

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.
  • VirtualTimeOrchestrationContext is 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 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. 
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
7.0.0-preview 0 11/15/2026