Skip to content

Commit e7d06c2

Browse files
Copilotstephentoub
andcommitted
Use const for JSON string variables and improve indentation
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
1 parent c0e2df1 commit e7d06c2

2 files changed

Lines changed: 19 additions & 13 deletions

File tree

global.json.bak

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sdk": {
3+
"version": "9.0.204",
4+
"rollForward": "minor"
5+
}
6+
}

tests/ModelContextProtocol.Tests/Protocol/ContentBlockTests.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ public void ResourceLinkBlock_SerializationRoundTrip_PreservesAllProperties()
4040
public void ResourceLinkBlock_DeserializationWithMinimalProperties_Succeeds()
4141
{
4242
// Arrange - JSON with only required properties
43-
string json = """
44-
{
45-
"type": "resource_link",
46-
"uri": "https://example.com/minimal",
47-
"name": "Minimal Resource"
48-
}
49-
""";
43+
const string json = """
44+
{
45+
"type": "resource_link",
46+
"uri": "https://example.com/minimal",
47+
"name": "Minimal Resource"
48+
}
49+
""";
5050

5151
// Act
5252
var deserialized = JsonSerializer.Deserialize<ContentBlock>(json, McpJsonUtilities.DefaultOptions);
@@ -67,12 +67,12 @@ public void ResourceLinkBlock_DeserializationWithMinimalProperties_Succeeds()
6767
public void ResourceLinkBlock_DeserializationWithoutName_ThrowsJsonException()
6868
{
6969
// Arrange - JSON missing the required "name" property
70-
string json = """
71-
{
72-
"type": "resource_link",
73-
"uri": "https://example.com/missing-name"
74-
}
75-
""";
70+
const string json = """
71+
{
72+
"type": "resource_link",
73+
"uri": "https://example.com/missing-name"
74+
}
75+
""";
7676

7777
// Act & Assert
7878
var exception = Assert.Throws<JsonException>(() =>

0 commit comments

Comments
 (0)