diff --git a/CHANGELOG.md b/CHANGELOG.md index f460219..69ec247 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,11 @@ All notable changes to this project are documented here. The format is based on - `LintReport.ToHtml()` and `ToolSurfaceDiff.ToHtml()`: a self-contained HTML page (inline CSS, no scripts) with a banner, a summary and, when there are findings or changes, a table. Server text is sanitized and HTML-encoded. - `mcpprobe lint --report ` and `mcpprobe diff --report ` also write that page. Stdout and exit codes are unchanged. The file is written on exit 0 and 1, not on a usage or connection error (exit 2). - GitHub Action and Azure Pipelines template inputs `strict`, `transport`, and `report`. All three are off by default, so existing workflows keep the same CLI invocation. `report` is a directory (`lint.html` and `diff.html`); the job summary is unchanged, and artifact upload is left to the workflow (`actions/upload-artifact` / `PublishPipelineArtifact@1`). `report` requires a CLI that has `--report`; the wrapper fails fast if the installed tool does not. +- Options-first overloads for `McpProbeHost.VerifyToolSnapshotAsync`, `ToolSnapshot.Verify` and `ToolSnapshot.VerifyAsync`, so `VerifyToolSnapshotAsync(new SnapshotOptions { ... })` compiles. The existing path-first signatures are unchanged. The new overloads name their options parameter `snapshotOptions`, so a call that names only `options:` still binds to the path-first overload. + +### Fixed + +- The README Quickstart now includes a short `WeatherTools` type (with `UseStructuredContent`) and the missing usings, so it compiles and runs as written. The snapshot example shows a real `VerifyToolSnapshotAsync` call with `Log`. Notes were added for `*.received.json` in `.gitignore` and for the CLI's net8.0/net10.0 runtime and `DOTNET_ROOT`. ### Changed diff --git a/README.md b/README.md index fe62a04..7d6c407 100644 --- a/README.md +++ b/README.md @@ -28,17 +28,34 @@ dotnet add package McpProbe --prerelease using McpProbe; using McpProbe.Assertions; using Microsoft.Extensions.DependencyInjection; // WithTools() +using ModelContextProtocol.Server; +using System.ComponentModel; -[Fact] -public async Task Forecast_works() +[McpServerToolType] +public sealed class WeatherTools +{ + [McpServerTool(Name = "get_forecast", UseStructuredContent = true)] + [Description("Gets a daily weather forecast for a city.")] + public static Forecast GetForecast( + [Description("City name, for example 'Paris'.")] string city) + => new Forecast(city, "Sunny"); +} + +public sealed record Forecast(string City, string Summary); + +public class WeatherServerTests { - await using var probe = await McpProbeHost.StartAsync(mcp => mcp.WithTools()); + [Fact] + public async Task Forecast_works() + { + await using var probe = await McpProbeHost.StartAsync(mcp => mcp.WithTools()); - var tools = await probe.Client.ListToolsAsync(); - McpAssert.That(tools).ContainsTool("get_forecast").HasParameter("city", type: "string", required: true); + var tools = await probe.Client.ListToolsAsync(); + McpAssert.That(tools).ContainsTool("get_forecast").HasParameter("city", type: "string", required: true); - var result = await probe.Client.CallToolAsync("get_forecast", new Dictionary { ["city"] = "Paris" }); - McpAssert.That(result).Succeeded().HasStructuredValue("city", "Paris"); + var result = await probe.Client.CallToolAsync("get_forecast", new Dictionary { ["city"] = "Paris" }); + McpAssert.That(result).Succeeded().HasStructuredValue("city", "Paris"); + } } ``` @@ -61,10 +78,15 @@ McpAssert.That(resources).ContainsResource("weather://cities").HasMimeType("text ## Snapshot workflow ```csharp +using McpProbe.Snapshots; + [Fact] -public Task Tool_surface_matches_snapshot() => probe.VerifyToolSnapshotAsync(); +public Task Tool_surface_matches_snapshot() => + probe.VerifyToolSnapshotAsync(new SnapshotOptions { Log = output.WriteLine }); ``` +`output.WriteLine` is xUnit's `ITestOutputHelper`. To use the default file name with no options, call `VerifyToolSnapshotAsync()`. + 1. The first run writes `mcp-tools.json` next to the test file and fails, so you look at it. Commit it. 2. Later runs compare the live tool surface with the file: - **Breaking changes fail the test**: removed tool, removed parameter, newly required parameter, narrowed type or enum, tighter input constraints (`minimum`, `maxLength`, `minItems`, `multipleOf`, a new or changed `pattern` or `format`, a new `const`, `uniqueItems: true` or `additionalProperties: false`, ...), and removed or narrowed output fields. A removed parameter that looks renamed gets a hint. @@ -72,7 +94,7 @@ public Task Tool_surface_matches_snapshot() => probe.VerifyToolSnapshotAsync(); - Local `$ref`s (`#/$defs/...`, `#/definitions/...`, and the `#/properties/...` refs the C# SDK emits for recursive types) are followed, so a change inside a referenced schema is classified like an inline one. - Schema-valued `additionalProperties` (and `unevaluatedProperties`, `additionalItems`, `unevaluatedItems`) are compared like nested schemas, at paths such as `input.meta[additionalProperties]`. - Schema keywords McpProbe doesn't classify yet (such as `allOf`, `anyOf` or `oneOf`) are reported as non-breaking, marked "review by hand". -3. On a failure, the current surface is written to `mcp-tools.received.json`. To accept the change, run with `MCPPROBE_UPDATE_SNAPSHOTS=1` (or set `SnapshotOptions.Update`), review the diff in git, and commit. +3. On a failure, the current surface is written to `mcp-tools.received.json`. Add `*.received.json` to your `.gitignore` so those files aren't committed. To accept the change, run with `MCPPROBE_UPDATE_SNAPSHOTS=1` (or set `SnapshotOptions.Update`), review the diff in git, and commit. On CI (`CI` or `TF_BUILD` set), a missing snapshot is not created: the test fails. Set `SnapshotOptions.FailOnNonBreakingChanges` to fail on every change. @@ -92,6 +114,8 @@ Non-breaking: ## Lint rules ```csharp +using McpProbe.Linting; + var report = await probe.LintToolsAsync(); report.ThrowIfFailed(); // fails on warnings and errors by default @@ -136,6 +160,8 @@ mcpprobe lint --http https://localhost:5001/mcp --header "Authorization: Bea mcpprobe lint --http http://localhost:5000/sse --transport sse --header "Authorization: Bearer $TOKEN" ``` +The `mcpprobe` tool is packed for net8.0 and net10.0 (`RollForward=Major`), so a .NET 8 or .NET 10 runtime must be installed. An SDK is also needed if the `--stdio` command is `dotnet run`. If the apphost errors with "You must install .NET to run this application" even though `dotnet` works, set `DOTNET_ROOT` to that install's root (the directory that contains `dotnet` and the `shared` folder). + `--http` already tries Streamable HTTP and falls back to legacy SSE. Use `--transport streamable-http` or `--transport sse` to pin a mode (`auto` is the default). Legacy SSE servers usually listen at `/sse` (and `/message`), not at the Streamable HTTP path. If the server maps MCP at a prefix such as `/mcp` and enables legacy SSE, the C# SDK places those endpoints under the prefix (`/mcp/sse` and `/mcp/message`). There is no WebSocket transport. Exit codes: `0` passed, `1` check failed (breaking change or lint findings), `2` usage or connection error. The server's stderr is printed when it fails to start. `diff` and `lint` also take `--from-file ` to check a file without starting a server. Run `mcpprobe --help` for every option. diff --git a/src/McpProbe/McpProbeHost.cs b/src/McpProbe/McpProbeHost.cs index 4a2cfea..f89baf0 100644 --- a/src/McpProbe/McpProbeHost.cs +++ b/src/McpProbe/McpProbeHost.cs @@ -159,6 +159,24 @@ public Task VerifyToolSnapshotAsync( [CallerFilePath] string callerFilePath = "") => ToolSnapshot.VerifyAsync(Client, snapshotPath, options, cancellationToken, callerFilePath); + /// + /// Checks the server's tool surface against a snapshot file, using the default file name. + /// See for the workflow. + /// + /// Snapshot options. + /// Cancels the request. + /// Filled in by the compiler. + /// The diff between the snapshot and the current surface. + /// The check failed. + public Task VerifyToolSnapshotAsync( + SnapshotOptions snapshotOptions, + CancellationToken cancellationToken = default, + [CallerFilePath] string callerFilePath = "") + { + ArgumentNullException.ThrowIfNull(snapshotOptions); + return VerifyToolSnapshotAsync(ToolSnapshot.DefaultFileName, snapshotOptions, cancellationToken, callerFilePath); + } + /// /// Lists the server's tools and lints them. /// diff --git a/src/McpProbe/PublicAPI.Unshipped.txt b/src/McpProbe/PublicAPI.Unshipped.txt index fdd0053..7c63e03 100644 --- a/src/McpProbe/PublicAPI.Unshipped.txt +++ b/src/McpProbe/PublicAPI.Unshipped.txt @@ -116,6 +116,7 @@ McpProbe.McpProbeHost.DisposeAsync() -> System.Threading.Tasks.ValueTask McpProbe.McpProbeHost.LintToolsAsync(McpProbe.Linting.LintOptions? options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task! McpProbe.McpProbeHost.Server.get -> ModelContextProtocol.Server.McpServer! McpProbe.McpProbeHost.Services.get -> System.IServiceProvider! +McpProbe.McpProbeHost.VerifyToolSnapshotAsync(McpProbe.Snapshots.SnapshotOptions! snapshotOptions, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken), string! callerFilePath = "") -> System.Threading.Tasks.Task! McpProbe.McpProbeHost.VerifyToolSnapshotAsync(string! snapshotPath = "mcp-tools.json", McpProbe.Snapshots.SnapshotOptions? options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken), string! callerFilePath = "") -> System.Threading.Tasks.Task! McpProbe.McpProbeHostOptions McpProbe.McpProbeHostOptions.ClientOptions.get -> ModelContextProtocol.Client.McpClientOptions? @@ -251,7 +252,9 @@ static McpProbe.McpProbeHost.StartAsync(System.Action bool static McpProbe.Snapshots.ToolContractAnnotations.operator ==(McpProbe.Snapshots.ToolContractAnnotations? left, McpProbe.Snapshots.ToolContractAnnotations? right) -> bool static McpProbe.Snapshots.ToolSnapshot.GetReceivedPath(string! snapshotPath) -> string! +static McpProbe.Snapshots.ToolSnapshot.Verify(McpProbe.Snapshots.ToolSurface! current, McpProbe.Snapshots.SnapshotOptions! snapshotOptions, string! callerFilePath = "") -> McpProbe.Snapshots.ToolSurfaceDiff! static McpProbe.Snapshots.ToolSnapshot.Verify(McpProbe.Snapshots.ToolSurface! current, string! snapshotPath = "mcp-tools.json", McpProbe.Snapshots.SnapshotOptions? options = null, string! callerFilePath = "") -> McpProbe.Snapshots.ToolSurfaceDiff! +static McpProbe.Snapshots.ToolSnapshot.VerifyAsync(ModelContextProtocol.Client.McpClient! client, McpProbe.Snapshots.SnapshotOptions! snapshotOptions, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken), string! callerFilePath = "") -> System.Threading.Tasks.Task! static McpProbe.Snapshots.ToolSnapshot.VerifyAsync(ModelContextProtocol.Client.McpClient! client, string! snapshotPath = "mcp-tools.json", McpProbe.Snapshots.SnapshotOptions? options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken), string! callerFilePath = "") -> System.Threading.Tasks.Task! static McpProbe.Snapshots.ToolSurface.CaptureAsync(ModelContextProtocol.Client.McpClient! client, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task! static McpProbe.Snapshots.ToolSurface.FromClientTools(System.Collections.Generic.IEnumerable! tools) -> McpProbe.Snapshots.ToolSurface! diff --git a/src/McpProbe/Snapshots/ToolSnapshot.cs b/src/McpProbe/Snapshots/ToolSnapshot.cs index 416ca87..e000c56 100644 --- a/src/McpProbe/Snapshots/ToolSnapshot.cs +++ b/src/McpProbe/Snapshots/ToolSnapshot.cs @@ -39,6 +39,23 @@ public static async Task VerifyAsync( return VerifyResolved(surface, ResolvePath(snapshotPath, options, callerFilePath), options ?? new SnapshotOptions()); } + /// Captures the client's tool surface and checks it against the default snapshot file. + /// A connected client. + /// Snapshot options. + /// Cancels the request. + /// Filled in by the compiler. + /// The diff between the snapshot and the current surface. + /// The check failed. + public static Task VerifyAsync( + McpClient client, + SnapshotOptions snapshotOptions, + CancellationToken cancellationToken = default, + [CallerFilePath] string callerFilePath = "") + { + ArgumentNullException.ThrowIfNull(snapshotOptions); + return VerifyAsync(client, DefaultFileName, snapshotOptions, cancellationToken, callerFilePath); + } + /// Checks a captured surface against a snapshot file. /// The current surface. /// The snapshot path. Relative paths resolve against or the calling source file's directory. @@ -56,6 +73,21 @@ public static ToolSurfaceDiff Verify( return VerifyResolved(current, ResolvePath(snapshotPath, options, callerFilePath), options ?? new SnapshotOptions()); } + /// Checks a captured surface against the default snapshot file. + /// The current surface. + /// Snapshot options. + /// Filled in by the compiler. + /// The diff between the snapshot and the current surface. + /// The check failed. + public static ToolSurfaceDiff Verify( + ToolSurface current, + SnapshotOptions snapshotOptions, + [CallerFilePath] string callerFilePath = "") + { + ArgumentNullException.ThrowIfNull(snapshotOptions); + return Verify(current, DefaultFileName, snapshotOptions, callerFilePath); + } + /// Gets the path of the file written next to a snapshot when the check fails. /// The snapshot path. /// The .received.json path. diff --git a/tests/McpProbe.Tests/ToolSnapshotTests.cs b/tests/McpProbe.Tests/ToolSnapshotTests.cs index a090d00..55d4368 100644 --- a/tests/McpProbe.Tests/ToolSnapshotTests.cs +++ b/tests/McpProbe.Tests/ToolSnapshotTests.cs @@ -1,5 +1,7 @@ +using System.Runtime.CompilerServices; using McpProbe.Snapshots; using McpProbe.Tests.TestSupport; +using ModelContextProtocol.Client; using WeatherServer; using static McpProbe.Tests.TestSupport.SchemaTools; @@ -200,6 +202,221 @@ public async Task EndToEnd_WithInMemoryHost() Assert.False(diff.HasChanges); Assert.Contains("\"get_forecast\"", File.ReadAllText(_dir.File("mcp-tools.json")), StringComparison.Ordinal); } + + [Fact] + public async Task OptionsFirst_HostVerify_UsesDefaultFileNameAndHonorsOptions() + { + await using var probe = await McpProbeHost.StartAsync(mcp => mcp.WithWeatherFeatures(), TestContext.Current.CancellationToken); + + var error = await Assert.ThrowsAsync(() => + probe.VerifyToolSnapshotAsync(Local(), TestContext.Current.CancellationToken)); + + Assert.Equal(_dir.File(ToolSnapshot.DefaultFileName), error.SnapshotPath); + Assert.True(File.Exists(_dir.File(ToolSnapshot.DefaultFileName))); + Assert.Contains("\"get_forecast\"", File.ReadAllText(_dir.File(ToolSnapshot.DefaultFileName)), StringComparison.Ordinal); + } + + [Fact] + public async Task OptionsFirst_HostVerify_ResolvesPathFromTestFileNotHostSource() + { + var expected = ToolSnapshot.ResolvePath(ToolSnapshot.DefaultFileName, options: null, callerFilePath: ThisFile()); + var received = ToolSnapshot.GetReceivedPath(expected); + try + { + await using var probe = await McpProbeHost.StartAsync(mcp => mcp.WithWeatherFeatures(), TestContext.Current.CancellationToken); + var options = new SnapshotOptions { Update = false, CreateMissing = false }; + + var error = await Assert.ThrowsAsync(() => + probe.VerifyToolSnapshotAsync(options, TestContext.Current.CancellationToken)); + + Assert.Equal(expected, error.SnapshotPath); + Assert.DoesNotContain("McpProbeHost.cs", error.SnapshotPath, StringComparison.Ordinal); + Assert.Contains(Path.Combine("tests", "McpProbe.Tests"), error.SnapshotPath, StringComparison.Ordinal); + } + finally + { + if (File.Exists(expected)) + { + File.Delete(expected); + } + + if (File.Exists(received)) + { + File.Delete(received); + } + } + } + + [Fact] + public void OptionsFirst_Verify_UsesDefaultFileNameAndHonorsOptions() + { + var error = Assert.Throws(() => ToolSnapshot.Verify(Baseline, Local())); + + Assert.Equal(_dir.File(ToolSnapshot.DefaultFileName), error.SnapshotPath); + Assert.Equal(Baseline.ToJson(), File.ReadAllText(_dir.File(ToolSnapshot.DefaultFileName))); + } + + [Fact] + public async Task OptionsFirst_VerifyAsync_UsesDefaultFileNameAndHonorsOptions() + { + await using var probe = await McpProbeHost.StartAsync(mcp => mcp.WithWeatherFeatures(), TestContext.Current.CancellationToken); + + var error = await Assert.ThrowsAsync(() => + ToolSnapshot.VerifyAsync(probe.Client, Local(), TestContext.Current.CancellationToken)); + + Assert.Equal(_dir.File(ToolSnapshot.DefaultFileName), error.SnapshotPath); + Assert.True(File.Exists(_dir.File(ToolSnapshot.DefaultFileName))); + } + + [Fact] + public void OptionsFirst_Verify_NullOptions_Throws() + { + var ex = Assert.Throws(() => ToolSnapshot.Verify(Baseline, (SnapshotOptions)null!)); + Assert.Equal("snapshotOptions", ex.ParamName); + } + + [Fact] + public async Task OptionsFirst_VerifyAsync_NullOptions_Throws() + { + await using var probe = await McpProbeHost.StartAsync(mcp => mcp.WithWeatherFeatures(), TestContext.Current.CancellationToken); + + var ex = await Assert.ThrowsAsync(() => + ToolSnapshot.VerifyAsync(probe.Client, (SnapshotOptions)null!, TestContext.Current.CancellationToken)); + Assert.Equal("snapshotOptions", ex.ParamName); + } + + [Fact] + public async Task OptionsFirst_HostVerify_NullOptions_Throws() + { + await using var probe = await McpProbeHost.StartAsync(mcp => mcp.WithWeatherFeatures(), TestContext.Current.CancellationToken); + + var ex = await Assert.ThrowsAsync(() => + probe.VerifyToolSnapshotAsync((SnapshotOptions)null!, TestContext.Current.CancellationToken)); + Assert.Equal("snapshotOptions", ex.ParamName); + } + + [Fact] + public void NamedOptions_Verify_UsesDefaultFileNameAndHonorsOptions() + { + var error = Assert.Throws(() => ToolSnapshot.Verify(Baseline, options: Local())); + + Assert.Equal(_dir.File(ToolSnapshot.DefaultFileName), error.SnapshotPath); + Assert.Equal(Baseline.ToJson(), File.ReadAllText(_dir.File(ToolSnapshot.DefaultFileName))); + } + + [Fact] + public async Task NamedOptions_VerifyAsync_UsesDefaultFileNameAndHonorsOptions() + { + await using var probe = await McpProbeHost.StartAsync(mcp => mcp.WithWeatherFeatures(), TestContext.Current.CancellationToken); + + var error = await Assert.ThrowsAsync(() => + ToolSnapshot.VerifyAsync(probe.Client, options: Local(), cancellationToken: TestContext.Current.CancellationToken)); + + Assert.Equal(_dir.File(ToolSnapshot.DefaultFileName), error.SnapshotPath); + Assert.True(File.Exists(_dir.File(ToolSnapshot.DefaultFileName))); + } + + [Fact] + public async Task NamedOptions_HostVerify_UsesDefaultFileNameAndHonorsOptions() + { + await using var probe = await McpProbeHost.StartAsync(mcp => mcp.WithWeatherFeatures(), TestContext.Current.CancellationToken); + + var error = await Assert.ThrowsAsync(() => + probe.VerifyToolSnapshotAsync(options: Local(), cancellationToken: TestContext.Current.CancellationToken)); + + Assert.Equal(_dir.File(ToolSnapshot.DefaultFileName), error.SnapshotPath); + Assert.True(File.Exists(_dir.File(ToolSnapshot.DefaultFileName))); + Assert.Contains("\"get_forecast\"", File.ReadAllText(_dir.File(ToolSnapshot.DefaultFileName)), StringComparison.Ordinal); + } + + [Fact] + public async Task NamedOptions_HostVerify_ResolvesPathFromTestFile() + { + var expected = ToolSnapshot.ResolvePath(ToolSnapshot.DefaultFileName, options: null, callerFilePath: ThisFile()); + var received = ToolSnapshot.GetReceivedPath(expected); + try + { + await using var probe = await McpProbeHost.StartAsync(mcp => mcp.WithWeatherFeatures(), TestContext.Current.CancellationToken); + var options = new SnapshotOptions { Update = false, CreateMissing = false }; + + var error = await Assert.ThrowsAsync(() => + probe.VerifyToolSnapshotAsync(options: options, cancellationToken: TestContext.Current.CancellationToken)); + + Assert.Equal(expected, error.SnapshotPath); + Assert.DoesNotContain("McpProbeHost.cs", error.SnapshotPath, StringComparison.Ordinal); + Assert.Contains(Path.Combine("tests", "McpProbe.Tests"), error.SnapshotPath, StringComparison.Ordinal); + } + finally + { + if (File.Exists(expected)) + { + File.Delete(expected); + } + + if (File.Exists(received)) + { + File.Delete(received); + } + } + } + + [Fact] + public void OverloadResolution_CallShapes_Compile() + { + // The body of CompileOverloadResolutionMatrix is the compile matrix: if any shape is + // CS0121 or binds to the wrong parameter type, this test project does not build. + Assert.NotNull((Action)CompileOverloadResolutionMatrix); + } + + private static void CompileOverloadResolutionMatrix( + McpProbeHost probe, + McpClient client, + ToolSurface surface, + SnapshotOptions snapshotOptions, + CancellationToken cancellationToken) + { + // Named options: only, the 0.2/0.3 workaround. Must bind to the path-first overloads. + _ = probe.VerifyToolSnapshotAsync(options: snapshotOptions); + _ = probe.VerifyToolSnapshotAsync(options: snapshotOptions, cancellationToken: cancellationToken); + _ = ToolSnapshot.Verify(surface, options: snapshotOptions); + _ = ToolSnapshot.VerifyAsync(client, options: snapshotOptions); + _ = ToolSnapshot.VerifyAsync(client, options: snapshotOptions, cancellationToken: cancellationToken); + + // Positional options. Must bind to the options-first overloads. + _ = probe.VerifyToolSnapshotAsync(snapshotOptions); + _ = probe.VerifyToolSnapshotAsync(snapshotOptions, cancellationToken); + _ = ToolSnapshot.Verify(surface, snapshotOptions); + _ = ToolSnapshot.VerifyAsync(client, snapshotOptions); + _ = ToolSnapshot.VerifyAsync(client, snapshotOptions, cancellationToken); + + // Path only. + _ = probe.VerifyToolSnapshotAsync("custom.json"); + _ = ToolSnapshot.Verify(surface, "custom.json"); + _ = ToolSnapshot.VerifyAsync(client, "custom.json"); + + // No-arg (default path, default options). + _ = probe.VerifyToolSnapshotAsync(); + _ = ToolSnapshot.Verify(surface); + _ = ToolSnapshot.VerifyAsync(client); + + // cancellationToken: only, as used by samples/WeatherServer.Tests. + _ = probe.VerifyToolSnapshotAsync(cancellationToken: cancellationToken); + _ = ToolSnapshot.VerifyAsync(client, cancellationToken: cancellationToken); + + // Path plus options, positional and named. + _ = probe.VerifyToolSnapshotAsync("custom.json", snapshotOptions); + _ = ToolSnapshot.Verify(surface, "custom.json", snapshotOptions); + _ = ToolSnapshot.VerifyAsync(client, "custom.json", snapshotOptions); + _ = probe.VerifyToolSnapshotAsync("custom.json", options: snapshotOptions); + _ = ToolSnapshot.Verify(surface, snapshotPath: "custom.json", options: snapshotOptions); + + // Explicit name of the new parameter. + _ = probe.VerifyToolSnapshotAsync(snapshotOptions: snapshotOptions); + _ = ToolSnapshot.Verify(surface, snapshotOptions: snapshotOptions); + _ = ToolSnapshot.VerifyAsync(client, snapshotOptions: snapshotOptions); + } + + private static string ThisFile([CallerFilePath] string path = "") => path; } [CollectionDefinition(nameof(EnvironmentVariableTests), DisableParallelization = true)]