svrnty-mcp-gateway/tests/Svrnty.MCP.Gateway.Core.Tests/Models/ServerInfoTests.cs
Svrnty a4a1dd2e38 docs: comprehensive AI coding assistant research and MCP-first implementation plan
Research conducted on modern AI coding assistants (Cursor, GitHub Copilot, Cline,
Aider, Windsurf, Replit Agent) to understand architecture patterns, context management,
code editing workflows, and tool use protocols.

Key Decision: Pivoted from building full CLI (40-50h) to validation-driven MCP-first
approach (10-15h). Build 5 core CODEX MCP tools that work with ANY coding assistant,
validate adoption over 2-4 weeks, then decide on full CLI if demand proven.

Files:
- research/ai-systems/modern-coding-assistants-architecture.md (comprehensive research)
- research/ai-systems/codex-coding-assistant-implementation-plan.md (original CLI plan, preserved)
- research/ai-systems/codex-mcp-tools-implementation-plan.md (approved MCP-first plan)
- ideas/registry.json (updated with approved MCP tools proposal)

Architech Validation: APPROVED with pivot to MCP-first approach
Human Decision: Approved (pragmatic validation-driven development)

Next: Begin Phase 1 implementation (10-15 hours, 5 core MCP tools)

🤖 Generated with CODEX Research System

Co-Authored-By: The Archivist <archivist@codex.svrnty.io>
Co-Authored-By: The Architech <architech@codex.svrnty.io>
Co-Authored-By: Mathias Beaulieu-Duncan <mat@svrnty.io>
2025-10-22 21:00:34 -04:00

79 lines
2.3 KiB
C#

using Xunit;
using OpenHarbor.MCP.Gateway.Core.Models;
namespace OpenHarbor.MCP.Gateway.Core.Tests.Models;
/// <summary>
/// Unit tests for ServerInfo model following TDD approach.
/// Tests server metadata representation.
/// </summary>
public class ServerInfoTests
{
[Fact]
public void ServerInfo_WithValidData_CreatesSuccessfully()
{
// Arrange
var now = DateTime.UtcNow;
// Act
var serverInfo = new ServerInfo
{
Id = "test-server",
Name = "Test Server",
IsHealthy = true,
LastHealthCheck = now,
ResponseTime = TimeSpan.FromMilliseconds(50),
Metadata = new Dictionary<string, string>
{
{ "region", "us-east" },
{ "version", "1.0.0" }
}
};
// Assert
Assert.Equal("test-server", serverInfo.Id);
Assert.Equal("Test Server", serverInfo.Name);
Assert.True(serverInfo.IsHealthy);
Assert.Equal(now, serverInfo.LastHealthCheck);
Assert.Equal(50, serverInfo.ResponseTime?.TotalMilliseconds);
Assert.NotNull(serverInfo.Metadata);
Assert.Equal("us-east", serverInfo.Metadata["region"]);
}
[Fact]
public void ServerInfo_DefaultState_HasEmptyId()
{
// Arrange & Act
var serverInfo = new ServerInfo();
// Assert
Assert.Equal(string.Empty, serverInfo.Id);
Assert.Equal(string.Empty, serverInfo.Name);
Assert.False(serverInfo.IsHealthy);
Assert.Null(serverInfo.LastHealthCheck);
Assert.Null(serverInfo.ResponseTime);
Assert.Null(serverInfo.Metadata);
}
[Fact]
public void ServerInfo_WithMetadata_StoresCorrectly()
{
// Arrange & Act
var serverInfo = new ServerInfo
{
Id = "metadata-test",
Metadata = new Dictionary<string, string>
{
{ "environment", "production" },
{ "datacenter", "dc1" }
}
};
// Assert
Assert.NotNull(serverInfo.Metadata);
Assert.Equal(2, serverInfo.Metadata.Count);
Assert.Equal("production", serverInfo.Metadata["environment"]);
Assert.Equal("dc1", serverInfo.Metadata["datacenter"]);
}
}