Skip to content

CommandTestsBase returning null on server error. #443

@hallipr

Description

@hallipr

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

Type

Projects

Status

In Progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions