Agents\AgentPathTests.cs (32)
23_context.SetVariable("CLAUDE_CONFIG_DIR", value);
25? _context.Home.FullName
26: Path.Combine(_context.Home.FullName, relative.Replace('/', Path.DirectorySeparatorChar));
28Assert.Equal(expected, _context.ClaudeDirectory);
29Assert.Equal(Path.Combine(expected, ".claude.json"), ClaudeCodePaths.GetGlobalMcpConfigPath(_context.ExecutionContext, _context.Environment));
30Assert.Equal(expected, AgentPath.Expand(value, _context.ExecutionContext));
31Assert.Empty(_context.Project.EnumerateFileSystemInfos());
32Assert.Empty(_context.Home.EnumerateFileSystemInfos());
40_context.SetVariable("COPILOT_HOME", value);
41var expected = Path.Combine(_context.Home.FullName, "custom-config");
43Assert.Equal(expected, _context.CopilotDirectory);
45_context.Copilot.GetIntegrationConfigPath(AgentConfigurationScope.Global, _context.Project));
47_context.Copilot.GetMcpConfigPath(AgentConfigurationScope.Global, _context.Project));
48Assert.Empty(_context.Project.EnumerateFileSystemInfos());
49Assert.Empty(_context.Home.EnumerateFileSystemInfos());
55Assert.Equal(Path.Combine(_context.Project.FullName, "~other-user"), AgentPath.Expand("~other-user", _context.ExecutionContext));
65var path = Path.Combine(_context.Workspace.Path, directory, ".agents", "skills", "aspire", "SKILL.md");
67Assert.Equal(expected ?? path, AgentPath.GetDisplayPath(path, _context.Project, _context.ExecutionContext));
73var project = _context.Home.CreateSubdirectory("my-app");
76Assert.Equal(".agents/skills/aspire/SKILL.md", AgentPath.GetDisplayPath(path, project, _context.ExecutionContext));
82var homePath = Path.Combine(_context.Home.FullName, "config.json");
83var projectPath = Path.Combine(_context.Project.FullName, "config.json");
85Assert.Equal(homePath, AgentPath.GetDisplayPath(homePath, AgentConfigurationScope.Project, _context.Project, _context.ExecutionContext));
86Assert.Equal(projectPath, AgentPath.GetDisplayPath(projectPath, AgentConfigurationScope.Global, _context.Project, _context.ExecutionContext));
89public void Dispose() => _context.Dispose();