Add server "completions" capability (#232)
* Split apart Capabilities.cs No code changes, just moving each type to its own file. * Add server completions capability
This commit is contained in:
parent
ac0bc3a1f1
commit
82510d5629
1 changed files with 321 additions and 272 deletions
|
|
@ -110,16 +110,16 @@ public class McpServerBuilderExtensionsHandlerTests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void WithGetCompletionHandler_Sets_Handler()
|
||||
public void WithCompleteHandler_Sets_Handler()
|
||||
{
|
||||
Func<RequestContext<CompleteRequestParams>, CancellationToken, Task<CompleteResult>> handler = (context, token) => Task.FromResult(new CompleteResult());
|
||||
|
||||
_builder.Object.WithGetCompletionHandler(handler);
|
||||
_builder.Object.WithCompleteHandler(handler);
|
||||
|
||||
var serviceProvider = _services.BuildServiceProvider();
|
||||
var options = serviceProvider.GetRequiredService<IOptions<McpServerHandlers>>().Value;
|
||||
|
||||
Assert.Equal(handler, options.GetCompletionHandler);
|
||||
Assert.Equal(handler, options.CompleteHandler);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
Loading…
Reference in a new issue