- 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>
85 lines
2.1 KiB
C#
85 lines
2.1 KiB
C#
using Xunit;
|
|
using Svrnty.MCP.Core.Models;
|
|
|
|
namespace Svrnty.MCP.Core.Tests.Models;
|
|
|
|
/// <summary>
|
|
/// Unit tests for RoutingContext model following TDD approach.
|
|
/// Tests routing metadata representation.
|
|
/// </summary>
|
|
public class RoutingContextTests
|
|
{
|
|
[Fact]
|
|
public void RoutingContext_WithToolName_CreatesSuccessfully()
|
|
{
|
|
// Arrange & Act
|
|
var context = new RoutingContext
|
|
{
|
|
ToolName = "search_codex",
|
|
ClientId = "web-client-123"
|
|
};
|
|
|
|
// Assert
|
|
Assert.Equal("search_codex", context.ToolName);
|
|
Assert.Equal("web-client-123", context.ClientId);
|
|
}
|
|
|
|
[Fact]
|
|
public void RoutingContext_WithHeaders_StoresHeaderData()
|
|
{
|
|
// Arrange
|
|
var headers = new Dictionary<string, string>
|
|
{
|
|
{ "X-API-Key", "test-key" },
|
|
{ "User-Agent", "MCP-Client/1.0" }
|
|
};
|
|
|
|
// Act
|
|
var context = new RoutingContext
|
|
{
|
|
Headers = headers
|
|
};
|
|
|
|
// Assert
|
|
Assert.NotNull(context.Headers);
|
|
Assert.Equal("test-key", context.Headers["X-API-Key"]);
|
|
}
|
|
|
|
[Fact]
|
|
public void RoutingContext_WithMetadata_StoresAdditionalData()
|
|
{
|
|
// Arrange
|
|
var metadata = new Dictionary<string, object>
|
|
{
|
|
{ "priority", "high" },
|
|
{ "timeout", 5000 },
|
|
{ "authenticated", true }
|
|
};
|
|
|
|
// Act
|
|
var context = new RoutingContext
|
|
{
|
|
Metadata = metadata
|
|
};
|
|
|
|
// Assert
|
|
Assert.NotNull(context.Metadata);
|
|
Assert.Equal("high", context.Metadata["priority"]);
|
|
Assert.Equal(5000, context.Metadata["timeout"]);
|
|
Assert.Equal(true, context.Metadata["authenticated"]);
|
|
}
|
|
|
|
[Fact]
|
|
public void RoutingContext_Empty_AllowsNullProperties()
|
|
{
|
|
// Arrange & Act
|
|
var context = new RoutingContext();
|
|
|
|
// Assert
|
|
Assert.Null(context.ToolName);
|
|
Assert.Null(context.ClientId);
|
|
Assert.Null(context.Headers);
|
|
Assert.Null(context.Metadata);
|
|
}
|
|
}
|