No meaningful code changes, just lots of namespace shuffling to have fewer namespaces and to put things in better namespaces.
20 lines
767 B
C#
20 lines
767 B
C#
using ModelContextProtocol.Client;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace ModelContextProtocol.Tests.Transport;
|
|
|
|
public class StdioClientTransportTests
|
|
{
|
|
[Fact]
|
|
public async Task CreateAsync_ValidProcessInvalidServer_Throws()
|
|
{
|
|
string id = Guid.NewGuid().ToString("N");
|
|
|
|
StdioClientTransport transport = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ?
|
|
new(new() { Command = "cmd", Arguments = ["/C", $"echo \"{id}\" >&2"] }) :
|
|
new(new() { Command = "ls", Arguments = [id] });
|
|
|
|
IOException e = await Assert.ThrowsAsync<IOException>(() => McpClientFactory.CreateAsync(transport, cancellationToken: TestContext.Current.CancellationToken));
|
|
Assert.Contains(id, e.ToString());
|
|
}
|
|
}
|