Skip to content

Commit 9b8cf68

Browse files
Copilotstephentoub
andcommitted
Use PascalCasing for const variables in test
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
1 parent 64f2c58 commit 9b8cf68

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/ModelContextProtocol.Tests/Server/McpServerTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -674,19 +674,19 @@ await transport.SendMessageAsync(
674674
[Fact]
675675
public async Task Can_Handle_Call_Tool_Requests_With_McpProtocolException_And_Data()
676676
{
677-
const string errorMessage = "Resource not found";
678-
const McpErrorCode errorCode = (McpErrorCode)(-32002);
679-
const string resourceUri = "file:///path/to/resource";
677+
const string ErrorMessage = "Resource not found";
678+
const McpErrorCode ErrorCode = (McpErrorCode)(-32002);
679+
const string ResourceUri = "file:///path/to/resource";
680680

681681
await using var transport = new TestServerTransport();
682682
var options = CreateOptions(new ServerCapabilities { Tools = new() });
683683
options.Handlers.CallToolHandler = async (request, ct) =>
684684
{
685-
throw new McpProtocolException(errorMessage, errorCode)
685+
throw new McpProtocolException(ErrorMessage, ErrorCode)
686686
{
687687
Data =
688688
{
689-
{ "uri", resourceUri }
689+
{ "uri", ResourceUri }
690690
}
691691
};
692692
};
@@ -716,14 +716,14 @@ await transport.SendMessageAsync(
716716
var error = await receivedMessage.Task.WaitAsync(TimeSpan.FromSeconds(10), TestContext.Current.CancellationToken);
717717
Assert.NotNull(error);
718718
Assert.NotNull(error.Error);
719-
Assert.Equal((int)errorCode, error.Error.Code);
720-
Assert.Equal(errorMessage, error.Error.Message);
719+
Assert.Equal((int)ErrorCode, error.Error.Code);
720+
Assert.Equal(ErrorMessage, error.Error.Message);
721721
Assert.NotNull(error.Error.Data);
722722

723723
// Verify the data contains the uri
724724
var dataDict = Assert.IsType<Dictionary<string, object?>>(error.Error.Data);
725725
Assert.True(dataDict.ContainsKey("uri"));
726-
Assert.Equal(resourceUri, dataDict["uri"]);
726+
Assert.Equal(ResourceUri, dataDict["uri"]);
727727

728728
await transport.DisposeAsync();
729729
await runTask;

0 commit comments

Comments
 (0)