Skip to content

Commit 2190d2d

Browse files
committed
refactor: Remove unused using directives and improve test comments
1 parent dcbc3bf commit 2190d2d

4 files changed

Lines changed: 13 additions & 7 deletions

File tree

tests/NetContextServer/BaseDirectoryTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using ModelContextProtocol.Client;
2-
using System.Collections.Generic;
32
using System.Text.Json;
43

54
namespace NetContextServer.Tests;

tests/NetContextServer/IgnoreOperationTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using ModelContextProtocol.Client;
2-
using System.Collections.Generic;
32
using System.Text.Json;
43

54
namespace NetContextServer.Tests;

tests/NetContextServer/NetContextServerFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,4 +230,4 @@ private static async Task CleanupExistingProcesses()
230230
}
231231
}
232232
}
233-
}
233+
}

tests/NetContextServer/ThinkOperationTests.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using ModelContextProtocol.Client;
2-
using System.Collections.Generic;
32
using System.Text.Encodings.Web;
43
using System.Text.Json;
54
using System.Text.Json.Serialization;
@@ -200,7 +199,9 @@ public async Task Think_WithPotentiallyHarmfulContent_ReturnsError()
200199
[Fact]
201200
public async Task Think_WithUnicodeAndEmoji_HandlesSpecialCharactersCorrectly()
202201
{
203-
// Arrange
202+
// Arrange - Use only emoji that work well with the MCP protocol
203+
// Note: While Chinese characters may display as question marks in some contexts,
204+
// common emoji are correctly preserved in the JSON responses
204205
var unicodeThought = "Testing emoji: 🔍 🚀 👍";
205206

206207
// Act
@@ -215,10 +216,15 @@ public async Task Think_WithUnicodeAndEmoji_HandlesSpecialCharactersCorrectly()
215216

216217
var response = JsonSerializer.Deserialize<ThinkResponse>(content.Text, DefaultJsonOptions);
217218
Assert.NotNull(response);
219+
220+
// Verify the thought is correctly returned
218221
Assert.Equal(unicodeThought, response.Thought);
222+
223+
// Verify at least some emoji characters are present
219224
Assert.Contains("🔍", response.Thought);
220225
Assert.Contains("🚀", response.Thought);
221226
Assert.Contains("👍", response.Thought);
227+
222228
Assert.NotEmpty(response.Message);
223229
Assert.Null(response.Error);
224230
}
@@ -267,8 +273,10 @@ public async Task Think_WithValidThought_ReturnsISO8601Timestamp()
267273
var response = JsonSerializer.Deserialize<ThinkResponse>(content.Text, DefaultJsonOptions);
268274
Assert.NotNull(response);
269275
Assert.NotNull(response.Timestamp);
276+
277+
// Verify ISO 8601 format
270278
Assert.True(DateTime.TryParse(response.Timestamp, out _));
271-
Assert.Contains("T", response.Timestamp);
272-
Assert.Contains(":", response.Timestamp);
279+
Assert.Contains("T", response.Timestamp); // ISO 8601 separator
280+
Assert.Contains(":", response.Timestamp); // Time separator
273281
}
274282
}

0 commit comments

Comments
 (0)