Add client-side Streamable HTTP transport support (#356)

This commit is contained in:
Stephen Halter 2025-04-30 17:21:43 -07:00 • committed by GitHub
commit e913d80f05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -18,10 +18,9 @@ public class SseServerIntegrationTestFixture : IAsyncDisposable
// multiple tests, so this dispatches the output to the current test.
private readonly DelegatingTestOutputHelper _delegatingTestOutputHelper = new();
private SseClientTransportOptions DefaultTransportOptions { get; } = new()
private SseClientTransportOptions DefaultTransportOptions { get; set; } = new()
{
Endpoint = new Uri("http://localhost/sse"),
Name = "TestServer",
Endpoint = new("http://localhost/"),
};
public SseServerIntegrationTestFixture()
@ -37,8 +36,9 @@ public class SseServerIntegrationTestFixture : IAsyncDisposable
HttpClient = new HttpClient(socketsHttpHandler)
{
BaseAddress = DefaultTransportOptions.Endpoint,
BaseAddress = new("http://localhost/"),
};
_serverTask = Program.MainAsync([], new XunitLoggerProvider(_delegatingTestOutputHelper), _inMemoryTransport, _stopCts.Token);
}
@ -53,9 +53,10 @@ public class SseServerIntegrationTestFixture : IAsyncDisposable
TestContext.Current.CancellationToken);
}
public void Initialize(ITestOutputHelper output)
public void Initialize(ITestOutputHelper output, SseClientTransportOptions clientTransportOptions)
{
_delegatingTestOutputHelper.CurrentTestOutputHelper = output;
DefaultTransportOptions = clientTransportOptions;
}
public void TestCompleted()