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:
parent
f7c61fafdb
commit
83523b0a42
1 changed files with 463 additions and 43 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue