File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
tests/ModelContextProtocol.Tests/Client Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,29 @@ public async Task CanReadServerInfo()
7171 Assert . Equal ( "dark" , icon1 . Theme ) ;
7272 }
7373
74+ [ Fact ]
75+ public async Task ServerCanReadClientInfo ( )
76+ {
77+ var clientOptions = new McpClientOptions
78+ {
79+ ClientInfo = new Implementation
80+ {
81+ Name = "test-client" ,
82+ Version = "2.0.0" ,
83+ Description = "A test client for validating client-server communication"
84+ }
85+ } ;
86+
87+ await using McpClient client = await CreateMcpClientForServer ( clientOptions ) ;
88+
89+ // Verify the server received the client info with description
90+ var clientInfo = Server . ClientInfo ;
91+ Assert . NotNull ( clientInfo ) ;
92+ Assert . Equal ( "test-client" , clientInfo . Name ) ;
93+ Assert . Equal ( "2.0.0" , clientInfo . Version ) ;
94+ Assert . Equal ( "A test client for validating client-server communication" , clientInfo . Description ) ;
95+ }
96+
7497 [ Theory ]
7598 [ InlineData ( null , 10 ) ]
7699 [ InlineData ( 0.7f , 50 ) ]
You can’t perform that action at this time.
0 commit comments