svrnty-mcp-gateway/tests/Svrnty.MCP.Gateway.Infrastructure.Tests/Transport/StdioServerTransportTests.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

65 lines
1.8 KiB
C#

using Xunit;
using OpenHarbor.MCP.Gateway.Infrastructure.Transport;
using OpenHarbor.MCP.Gateway.Core.Models;
namespace OpenHarbor.MCP.Gateway.Infrastructure.Tests.Transport;
/// <summary>
/// Unit tests for StdioServerTransport following TDD approach.
/// Tests stdio transport implementation.
/// </summary>
public class StdioServerTransportTests
{
[Fact]
public void Constructor_WithValidCommand_CreatesSuccessfully()
{
// Arrange & Act
var transport = new StdioServerTransport("dotnet", new[] { "run" });
// Assert
Assert.NotNull(transport);
Assert.False(transport.IsConnected);
}
[Fact]
public void Constructor_WithNullCommand_ThrowsException()
{
// Arrange, Act & Assert
Assert.Throws<ArgumentNullException>(() =>
new StdioServerTransport(null!, new[] { "arg" }));
}
[Fact]
public void IsConnected_BeforeConnect_ReturnsFalse()
{
// Arrange
var transport = new StdioServerTransport("echo", new[] { "test" });
// Act & Assert
Assert.False(transport.IsConnected);
}
[Fact]
public async Task SendRequestAsync_WithoutConnect_ThrowsException()
{
// Arrange
var transport = new StdioServerTransport("echo", new[] { "test" });
var request = new GatewayRequest { ToolName = "test" };
// Act & Assert
await Assert.ThrowsAsync<InvalidOperationException>(() =>
transport.SendRequestAsync(request, CancellationToken.None));
}
[Fact]
public void Dispose_MultipleTimesests_DoesNotThrow()
{
// Arrange
var transport = new StdioServerTransport("echo", new[] { "test" });
// Act & Assert
transport.Dispose();
transport.Dispose(); // Should not throw
}
}