@@ -20,9 +20,6 @@ Describe 'Tests for MCP server' {
20
20
while ($mcp.StandardOutput.Peek () -eq -1 ) {
21
21
Start-Sleep - Milliseconds 100
22
22
}
23
- while ($mcp.StandardError.Peek () -ne -1 ) {
24
- $stderr = $mcp.StandardError.ReadLine ()
25
- }
26
23
$stdout = $mcp.StandardOutput.ReadLine ()
27
24
return ($stdout | ConvertFrom-Json - Depth 30 )
28
25
}
@@ -302,4 +299,38 @@ Describe 'Tests for MCP server' {
302
299
$response.result.structuredContent.functions.Count | Should - Be 0
303
300
$response.result.structuredContent.functions | Should - BeNullOrEmpty
304
301
}
302
+
303
+ It ' Calling invoke_dsc_resource for operation: <operation>' - TestCases @ (
304
+ @ { operation = ' get' ; property = ' actualState' }
305
+ @ { operation = ' set' ; property = ' beforeState' }
306
+ @ { operation = ' test' ; property = ' desiredState' }
307
+ @ { operation = ' export' ; property = ' actualState' }
308
+ ) {
309
+ param ($operation )
310
+
311
+ $mcpRequest = @ {
312
+ jsonrpc = " 2.0"
313
+ id = 12
314
+ method = " tools/call"
315
+ params = @ {
316
+ name = " invoke_dsc_resource"
317
+ arguments = @ {
318
+ type = ' Test/Operation'
319
+ operation = $operation
320
+ resource_type = ' Test/Operation'
321
+ properties_json = (@ {
322
+ hello = " World"
323
+ action = $operation
324
+ } | ConvertTo-Json - Depth 20 )
325
+ }
326
+ }
327
+ }
328
+
329
+ $response = Send-McpRequest - request $mcpRequest
330
+ $response.id | Should - Be 12
331
+ $because = ($response | ConvertTo-Json - Depth 20 | Out-String )
332
+ ($response.result.structuredContent.psobject.properties | Measure-Object ).Count | Should - Be 1 - Because $because
333
+ $response.result.structuredContent.result .$property.action | Should - BeExactly $operation - Because $because
334
+ $response.result.structuredContent.result .$property.hello | Should - BeExactly " World" - Because $because
335
+ }
305
336
}
0 commit comments