svrnty-mcp-client/tests/Svrnty.MCP.Client.Core.Tests/Models/McpToolTests.cs
Svrnty 97880406dc refactor: rename OpenHarbor.MCP to Svrnty.MCP across all libraries
- Renamed all directories: OpenHarbor.MCP.* → Svrnty.MCP.*
- Updated all namespaces in 179 C# files
- Renamed 20 .csproj files and 3 .sln files
- Updated 193 documentation references
- Updated 33 references in main CODEX codebase
- Updated Codex.sln with new paths
- Build verified: 0 errors

Preparing for extraction to standalone repositories.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 21:04:17 -04:00

70 lines
1.6 KiB
C#

using System.Text.Json;
using Svrnty.MCP.Client.Core.Models;
using Xunit;
namespace Svrnty.MCP.Client.Core.Tests.Models;
/// <summary>
/// Unit tests for McpTool model.
/// Tests tool creation and property validation.
/// </summary>
public class McpToolTests
{
[Fact]
public void Constructor_WithRequiredProperties_CreatesTool()
{
// Arrange & Act
var tool = new McpTool
{
Name = "test_tool",
Description = "Test tool description"
};
// Assert
Assert.Equal("test_tool", tool.Name);
Assert.Equal("Test tool description", tool.Description);
Assert.Null(tool.Schema);
}
[Fact]
public void Constructor_WithSchema_StoresSchema()
{
// Arrange
var schema = JsonDocument.Parse("""
{
"type": "object",
"properties": {
"param1": {"type": "string"}
}
}
""");
// Act
var tool = new McpTool
{
Name = "test_tool",
Description = "Test description",
Schema = schema
};
// Assert
Assert.Equal("test_tool", tool.Name);
Assert.NotNull(tool.Schema);
Assert.Equal("object", tool.Schema.RootElement.GetProperty("type").GetString());
}
[Fact]
public void Constructor_WithoutSchema_HasNullSchema()
{
// Arrange & Act
var tool = new McpTool
{
Name = "simple_tool",
Description = "Simple tool without parameters"
};
// Assert
Assert.Null(tool.Schema);
}
}