Skip to content

Commit 04c0877

Browse files
committed
Make StdioClientTransportTests a LoggedTest
1 parent 4793ebf commit 04c0877

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
using ModelContextProtocol.Client;
2+
using ModelContextProtocol.Tests.Utils;
23
using System.Runtime.InteropServices;
34

45
namespace ModelContextProtocol.Tests.Transport;
56

6-
public class StdioClientTransportTests
7+
public class StdioClientTransportTests(ITestOutputHelper testOutputHelper) : LoggedTest(testOutputHelper)
78
{
89
[Fact]
910
public async Task CreateAsync_ValidProcessInvalidServer_Throws()
1011
{
1112
string id = Guid.NewGuid().ToString("N");
1213

1314
StdioClientTransport transport = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ?
14-
new(new() { Command = "cmd", Arguments = ["/C", $"echo \"{id}\" >&2"] }) :
15-
new(new() { Command = "ls", Arguments = [id] });
15+
new(new() { Command = "cmd", Arguments = ["/C", $"echo \"{id}\" >&2"] }, LoggerFactory) :
16+
new(new() { Command = "ls", Arguments = [id] }, LoggerFactory);
1617

17-
IOException e = await Assert.ThrowsAsync<IOException>(() => McpClientFactory.CreateAsync(transport, cancellationToken: TestContext.Current.CancellationToken));
18+
IOException e = await Assert.ThrowsAsync<IOException>(() => McpClientFactory.CreateAsync(transport, loggerFactory: LoggerFactory, cancellationToken: TestContext.Current.CancellationToken));
1819
Assert.Contains(id, e.ToString());
1920
}
2021
}

0 commit comments

Comments
 (0)