Enable netfx testing. (#588)

* Enable netfx testing.

* Skip impacted tests and re-enable netfx testing.

* Remove redundant comment.

* Remove unnecessary project configuration.

* Simplify test server copying.
This commit is contained in:
Eirik Tsarpalis 2025-07-08 18:50:37 +03:00 • committed by GitHub
commit aa75f6f37e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1940 additions and 53 deletions

View file

@ -1,4 +1,6 @@
namespace ModelContextProtocol.Tests.Utils;
using System.Net.Http;
namespace ModelContextProtocol.Tests.Utils;
public class MockHttpHandler : HttpMessageHandler
{

View file

@ -0,0 +1,15 @@
namespace System.Diagnostics;
public static class ProcessExtensions
{
public static async Task WaitForExitAsync(this Process process, TimeSpan timeout)
{
#if NET
using var shutdownCts = CancellationTokenSource.CreateLinkedTokenSource(TestContext.Current.CancellationToken);
shutdownCts.CancelAfter(timeout);
await process.WaitForExitAsync(shutdownCts.Token);
#else
process.WaitForExit(milliseconds: (int)timeout.TotalMilliseconds);
#endif
}
}