From 9c839ea6eb9e89508c849cc07d398914f83039a0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 May 2026 19:13:09 +0000 Subject: [PATCH] Document workflow edge test helpers Agent-Logs-Url: https://github.com/microsoft/agent-framework/sessions/af831ee2-0a99-4427-9ffd-a3b5022c1b3b Co-authored-by: lokitoth <6936551+lokitoth@users.noreply.github.com> --- .../WorkflowBuilderExtensions.cs | 7 +++++++ .../WorkflowBuilderSmokeTests.cs | 3 +++ 2 files changed, 10 insertions(+) diff --git a/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowBuilderExtensions.cs b/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowBuilderExtensions.cs index 37b6f26388..179dc78c88 100644 --- a/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowBuilderExtensions.cs +++ b/dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowBuilderExtensions.cs @@ -116,6 +116,13 @@ public static class WorkflowBuilderExtensions static bool IsAllowedType(object? message) => message is null; } + /// + /// Validates a target collection and returns it as a list. + /// + /// The target executor bindings to validate. + /// A validated list of target executor bindings. + /// Thrown when is null or contains a null element. + /// Thrown when is empty. private static List ValidateTargets(IEnumerable targets) { Throw.IfNull(targets); diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/WorkflowBuilderSmokeTests.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/WorkflowBuilderSmokeTests.cs index a44bd9ad8b..27bbb1092c 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/WorkflowBuilderSmokeTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/WorkflowBuilderSmokeTests.cs @@ -447,6 +447,9 @@ public partial class WorkflowBuilderSmokeTests Assert.Throws("executors", () => switchBuilder.WithDefault([target, null!])); } + /// + /// Gets the only edge emitted by the specified workflow source. + /// private static Edge GetSingleEdge(Workflow workflow, string sourceId) => workflow.Edges[sourceId].Should().ContainSingle().Subject; }