TestBucket.AI.Xunit 0.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package TestBucket.AI.Xunit --version 0.0.1
                    
NuGet\Install-Package TestBucket.AI.Xunit -Version 0.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TestBucket.AI.Xunit" Version="0.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TestBucket.AI.Xunit" Version="0.0.1" />
                    
Directory.Packages.props
<PackageReference Include="TestBucket.AI.Xunit" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TestBucket.AI.Xunit --version 0.0.1
                    
#r "nuget: TestBucket.AI.Xunit, 0.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=TestBucket.AI.Xunit&version=0.0.1
                    
Install TestBucket.AI.Xunit as a Cake Addin
#tool nuget:?package=TestBucket.AI.Xunit&version=0.0.1
                    
Install TestBucket.AI.Xunit as a Cake Tool

MCP test extensions for xunit v3

The TestBucket.McpTest.Xunit package provides helpers for writing integration tests against Model Context Protocol (MCP) servers using xUnit v3. It is designed to work with the IMcpClient interface and the McpClientFactory from the ModelContextProtocol library.

Getting Started

  1. Add Package Reference

    Ensure your test project references the following NuGet packages:

    • TestBucket.McpTest.Xunit
    • ModelContextProtocol.Core
    • xunit.v3.assert
    • xunit.v3.extensibility.core
  2. Create an MCP Client

    Use McpClientFactory to create an IMcpClient instance. Typically, you will need to provide a transport (e.g., SseClientTransport) and authentication headers (if needed).

Example

    [Fact]
    public async Task Should_Invoke_MyTool_Successfully()
    {
        // Arrange: create your IMcpClient (using your factory or fixture)
        IMcpClient client = /* get or create your client, e.g. from a fixture */;

        // Tool name and arguments
        string toolName = "myTool";
        var arguments = new Dictionary<string, object?>
        {
            { "param1", "value1" },
            { "param2", 42 }
        };

        // Act: call the tool
        var response = await client.TestCallToolAsync(
            toolName,
            arguments,
            progress: null, // or provide a progress reporter if needed
            jsonSerializerOptions: new JsonSerializerOptions { PropertyNameCaseInsensitive = true }
        );

        // Assert: check the response
        response.ShouldBeSuccess();
        response.ShouldHaveContent();
    }
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.0.4 207 6/13/2025
0.0.2 241 6/13/2025
0.0.1 239 6/13/2025