Add initial task extension conformance coverage (#1734)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7c99928c-a943-49f4-9a63-8b04a0e4d18b
This commit is contained in:
Pranav Senthilnathan 2026-07-24 17:16:20 -07:00 • committed by GitHub
commit 83523b0a42
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -75,5 +75,28 @@ public class CustomRequestHandlerCollisionTests(ITestOutputHelper testOutputHelp
await using var server = McpServer.Create(transport, options, LoggerFactory);
Assert.NotNull(server);
}
[Fact]
public async Task CustomHandler_EmptyRoutingNameParameter_Throws()
{
await using var transport = new StreamServerTransport(Stream.Null, Stream.Null);
var options = new McpServerOptions
{
RequestHandlers =
[
new McpServerRequestHandler
{
Method = "custom/method",
RoutingNameParameter = " ",
Handler = (request, cancellationToken) => new ValueTask<JsonNode?>((JsonNode?)null),
},
],
};
var ex = Assert.Throws<InvalidOperationException>(
() => McpServer.Create(transport, options, LoggerFactory));
Assert.Contains(nameof(McpServerRequestHandler.RoutingNameParameter), ex.Message);
}
#pragma warning restore MCPEXP002
}