Add more tests (#51)
* Add more tests * Fix some code smells * Remove more code smells * Combine "ServerIntegrationTests" and "ClientIntegrationTests" because both are client integration tests just using different servers * Clean up resources after test * Improve kill logic for spawned child processes * Improved testability for Stdio * Fix SseIntegration tests
This commit is contained in:
parent
fe632617dc
commit
b5076263d1
1 changed files with 883 additions and 751 deletions
|
|
@ -0,0 +1,23 @@
|
|||
using McpDotNet.Configuration;
|
||||
using McpDotNet.Protocol.Transport;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Moq;
|
||||
|
||||
namespace McpDotNet.Tests.Configuration;
|
||||
|
||||
public class McpServerBuilderExtensionsTransportsTests
|
||||
{
|
||||
[Fact]
|
||||
public void WithStdioServerTransport_Sets_Transport()
|
||||
{
|
||||
var services = new ServiceCollection();
|
||||
var builder = new Mock<IMcpServerBuilder>();
|
||||
builder.SetupGet(b => b.Services).Returns(services);
|
||||
|
||||
builder.Object.WithStdioServerTransport();
|
||||
|
||||
var transportType = services.FirstOrDefault(s => s.ServiceType == typeof(IServerTransport));
|
||||
Assert.NotNull(transportType);
|
||||
Assert.Equal(typeof(StdioServerTransport), transportType.ImplementationType);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue