Fix private reflection (#60)
* Fix private reflection Two changes in this PR - Remove private reflection from one of the tests - Move to use `TaskCompletionSource` (feedback from previous PR) * fix * spelling
This commit is contained in:
parent
d18da9a08d
commit
e76dbb5372
1 changed files with 17 additions and 19 deletions
|
|
@ -89,10 +89,12 @@ public class McpServerTests
|
|||
{
|
||||
// Arrange
|
||||
await using var server = McpServerFactory.Create(_serverTransport.Object, _options, _loggerFactory.Object, _serviceProvider);
|
||||
server.GetType().GetField("_isInitializing", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)?.SetValue(server, true);
|
||||
var task = server.StartAsync(TestContext.Current.CancellationToken);
|
||||
|
||||
// Act & Assert
|
||||
await Assert.ThrowsAsync<InvalidOperationException>(() => server.StartAsync(TestContext.Current.CancellationToken));
|
||||
|
||||
await task;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
Loading…
Reference in a new issue