From 2b66bad6b35205d84070cd6b7a14f036dbcf0e8c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 13 May 2026 19:02:21 +0000 Subject: [PATCH] Fix RouteBuilder test nullability warning Agent-Logs-Url: https://github.com/microsoft/agent-framework/sessions/012f3b3b-acb9-4869-9084-b767cbe1885b Co-authored-by: lokitoth <6936551+lokitoth@users.noreply.github.com> --- .../RouteBuilderTests.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/RouteBuilderTests.cs b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/RouteBuilderTests.cs index a88fd4426b..1e404c8a76 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/RouteBuilderTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/RouteBuilderTests.cs @@ -526,8 +526,8 @@ public sealed class RouteBuilderTests private static string GetPayloadValue(PortableValue message) { - TestPayload? payload = message.As(); - payload.Should().NotBeNull(); - return payload.Value; + return message.As() is TestPayload payload + ? payload.Value + : throw new InvalidOperationException("Expected catch-all message payload to deserialize as TestPayload."); } }