svrnty-mcp-client/tests/Svrnty.MCP.Client.Core.Tests/Exceptions/McpConnectionExceptionTests.cs
Svrnty d936ad7856 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

63 lines
1.9 KiB
C#

using OpenHarbor.MCP.Client.Core.Exceptions;
using Xunit;
namespace OpenHarbor.MCP.Client.Core.Tests.Exceptions;
/// <summary>
/// Unit tests for MCP exception types.
/// Tests exception creation, messages, and properties.
/// </summary>
public class McpConnectionExceptionTests
{
[Fact]
public void McpConnectionException_WithMessage_CreatesException()
{
// Arrange & Act
var exception = new McpConnectionException("Test error");
// Assert
Assert.Equal("Test error", exception.Message);
Assert.Null(exception.InnerException);
}
[Fact]
public void McpConnectionException_WithInnerException_CreatesException()
{
// Arrange
var innerException = new InvalidOperationException("Inner error");
// Act
var exception = new McpConnectionException("Test error", innerException);
// Assert
Assert.Equal("Test error", exception.Message);
Assert.Same(innerException, exception.InnerException);
}
[Fact]
public void ServerNotFoundException_WithServerName_SetsProperties()
{
// Arrange & Act
var exception = new ServerNotFoundException("test-server");
// Assert
Assert.Equal("test-server", exception.ServerName);
Assert.Contains("test-server", exception.Message);
Assert.Contains("not found or not connected", exception.Message);
}
[Fact]
public void ToolNotFoundException_WithServerAndToolName_SetsProperties()
{
// Arrange & Act
var exception = new ToolNotFoundException("test-server", "test_tool");
// Assert
Assert.Equal("test-server", exception.ServerName);
Assert.Equal("test_tool", exception.ToolName);
Assert.Contains("test_tool", exception.Message);
Assert.Contains("test-server", exception.Message);
Assert.Contains("not found on server", exception.Message);
}
}