- 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>
89 lines
2.3 KiB
C#
89 lines
2.3 KiB
C#
using Xunit;
|
|
using Svrnty.MCP.Gateway.Core.Models;
|
|
|
|
namespace Svrnty.MCP.Gateway.Core.Tests.Models;
|
|
|
|
/// <summary>
|
|
/// Unit tests for ServerConfig model following TDD approach.
|
|
/// Tests server configuration.
|
|
/// </summary>
|
|
public class ServerConfigTests
|
|
{
|
|
[Fact]
|
|
public void ServerConfig_WithStdioTransport_CreatesSuccessfully()
|
|
{
|
|
// Arrange & Act
|
|
var config = new ServerConfig
|
|
{
|
|
Id = "codex-server",
|
|
Name = "Codex MCP Server",
|
|
TransportType = "Stdio",
|
|
Command = "dotnet",
|
|
Args = new[] { "run", "--project", "CodexMcpServer.csproj" },
|
|
Enabled = true
|
|
};
|
|
|
|
// Assert
|
|
Assert.Equal("codex-server", config.Id);
|
|
Assert.Equal("Codex MCP Server", config.Name);
|
|
Assert.Equal("Stdio", config.TransportType);
|
|
Assert.Equal("dotnet", config.Command);
|
|
Assert.NotNull(config.Args);
|
|
Assert.Equal(3, config.Args.Length);
|
|
Assert.True(config.Enabled);
|
|
Assert.Null(config.BaseUrl);
|
|
}
|
|
|
|
[Fact]
|
|
public void ServerConfig_WithHttpTransport_CreatesSuccessfully()
|
|
{
|
|
// Arrange & Act
|
|
var config = new ServerConfig
|
|
{
|
|
Id = "api-server",
|
|
Name = "API MCP Server",
|
|
TransportType = "Http",
|
|
BaseUrl = "https://api.example.com/mcp"
|
|
};
|
|
|
|
// Assert
|
|
Assert.Equal("Http", config.TransportType);
|
|
Assert.Equal("https://api.example.com/mcp", config.BaseUrl);
|
|
Assert.Null(config.Command);
|
|
Assert.Null(config.Args);
|
|
}
|
|
|
|
[Fact]
|
|
public void ServerConfig_DefaultEnabled_IsTrue()
|
|
{
|
|
// Arrange & Act
|
|
var config = new ServerConfig
|
|
{
|
|
Id = "default-server"
|
|
};
|
|
|
|
// Assert
|
|
Assert.True(config.Enabled);
|
|
Assert.Equal("Stdio", config.TransportType);
|
|
}
|
|
|
|
[Fact]
|
|
public void ServerConfig_WithMetadata_StoresCorrectly()
|
|
{
|
|
// Arrange & Act
|
|
var config = new ServerConfig
|
|
{
|
|
Id = "meta-server",
|
|
Metadata = new Dictionary<string, string>
|
|
{
|
|
{ "priority", "high" },
|
|
{ "region", "us-west" }
|
|
}
|
|
};
|
|
|
|
// Assert
|
|
Assert.NotNull(config.Metadata);
|
|
Assert.Equal("high", config.Metadata["priority"]);
|
|
}
|
|
}
|