- Notifications
You must be signed in to change notification settings - Fork 236
Open
Description
In live tests' CommandTestsBase.CallToolAsync()
, when the mcpClient.CallToolAsync
call throws an McpException
containing the string An error occurred
, CommandTestsBase
returns null
rather than bubbling that tool call exception.
This obfuscates server errors during live tests making troubleshooting difficult. If a tool call causes an exception, that exception should be the reason for the test failure. If a test is asserting that a specific call should throw an exception, XUnit has appropriate testing patterns:
// Act & Assert var exception = await Assert.ThrowsAsync<McpException>(async () => await CallToolAsync(command, parameters)); // Optionally, verify the exception message Assert.Contains("An error occurred", exception.Message);
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
In Progress