Fix some code smells (#39)

* Fix some code smells

* Fix build

* Fix come issues

* Revert some changes
This commit is contained in:
Toni Wenzel 2025-03-10 18:03:47 +01:00 • committed by GitHub
commit 709b2e0a74
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 270 additions and 244 deletions

View file

@ -47,5 +47,6 @@ public class ClientIntegrationTestFixture : IDisposable
public void Dispose()
{
LoggerFactory?.Dispose();
GC.SuppressFinalize(this);
}
}

View file

@ -60,7 +60,9 @@ public class EverythingSseServerFixture : IAsyncDisposable
catch (Exception ex)
{
// Log the exception but don't throw
Console.Error.WriteLine($"Error stopping Docker container: {ex.Message}");
await Console.Error.WriteLineAsync($"Error stopping Docker container: {ex.Message}");
}
GC.SuppressFinalize(this);
}
}

View file

@ -153,10 +153,13 @@ public class McpServerBuilderExtensionsToolsTests
{
public EchoToolWithDi(IDependendService service)
{
}
[McpTool, Description("Echoes the input back to the client.")]
#pragma warning disable CA1822 // Mark members as static
public Task<string> Echo(string message)
#pragma warning restore CA1822 // Mark members as static
{
return Task.FromResult("hello " + message);
}

View file

@ -52,5 +52,6 @@ public class ServerIntegrationTestFixture : IDisposable
var client = Factory.GetClientAsync("test_server").Result;
client.DisposeAsync().AsTask().Wait();
LoggerFactory?.Dispose();
GC.SuppressFinalize(this);
}
}