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>
This commit is contained in:
copilot-swe-agent[bot]
2026-05-13 19:02:21 +00:00
committed by GitHub
Unverified
parent 224d9ce6ee
commit 2b66bad6b3
@@ -526,8 +526,8 @@ public sealed class RouteBuilderTests
private static string GetPayloadValue(PortableValue message)
{
TestPayload? payload = message.As<TestPayload>();
payload.Should().NotBeNull();
return payload.Value;
return message.As<TestPayload>() is TestPayload payload
? payload.Value
: throw new InvalidOperationException("Expected catch-all message payload to deserialize as TestPayload.");
}
}