1 write to Project
Aspire.Cli.Tests (1)
Agents\AgentConfigurationTestContext.cs (1)
27Project = Workspace.CreateDirectory("project");
145 references to Project
Aspire.Cli.Tests (145)
Agents\AgentConfigurationTestContext.cs (4)
36ExecutionContext = TestExecutionContextHelper.CreateExecutionContext(Project, homeDirectory: Home); 74=> AgentConfiguration.ApplyRemoteAsync(clients, Project, scope, cancellationToken); 81client.GetMcpConfigPath(scope, Project), Project, scope, edit, cancellationToken);
Agents\AgentConfigurationTests.cs (53)
32var path = Path.Combine(_context.Project.FullName, "settings.json"); 55var path = Path.Combine(_context.Project.FullName, "settings.json"); 81var path = Path.Combine(_context.Project.FullName, "settings.json"); 108var path = Path.Combine(_context.Project.FullName, "settings.json"); 133var directory = Path.Combine(_context.Project.FullName, "missing"); 143Assert.Empty(Directory.GetFiles(_context.Project.FullName, "*", SearchOption.AllDirectories)); 151var path = Path.Combine(_context.Project.FullName, "settings.json"); 163Assert.Equal(existed ? [path] : [], Directory.GetFiles(_context.Project.FullName)); 173var path = Path.Combine(_context.Project.FullName, "settings.json"); 188Assert.Equal([path], Directory.GetFiles(_context.Project.FullName)); 196var path = _context.Copilot.GetIntegrationConfigPath(AgentConfigurationScope.Project, _context.Project); 205config, _context.Project, AgentConfigurationScope.Project, edit, CancellationToken.None); 210Assert.Equal([path], Directory.GetFiles(_context.Project.FullName, "*", SearchOption.AllDirectories)); 220var inherited = client.GetIntegrationConfigPath(AgentConfigurationScope.Global, _context.Project); 222var path = client.GetIntegrationConfigPath(AgentConfigurationScope.Project, _context.Project); 226config, _context.Project, AgentConfigurationScope.Project, edit, CancellationToken.None); 252var path = _context.ClaudeCode.GetIntegrationConfigPath(AgentConfigurationScope.Project, _context.Project); 256config, _context.Project, AgentConfigurationScope.Project, edit, CancellationToken.None); 272Assert.Empty(Directory.GetFiles(_context.Project.FullName, "*", SearchOption.AllDirectories)); 280var path = _context.ClaudeCode.GetIntegrationConfigPath(AgentConfigurationScope.Project, _context.Project); 284config, _context.Project, AgentConfigurationScope.Project, edit, CancellationToken.None); 295var path = _context.OpenCode.GetIntegrationConfigPath(AgentConfigurationScope.Global, _context.Project); 300remote, _context.Project, AgentConfigurationScope.Global, remoteEdit, CancellationToken.None); 303path, _context.Project, AgentConfigurationScope.Global, mcpEdit, CancellationToken.None); 324var path = Path.Combine(_context.Project.FullName, "settings.json"); 325var target = Path.Combine(_context.Project.FullName, "linked.json"); 355var path = Path.Combine(_context.Project.FullName, "settings.json"); 356var directory = _context.Project.GetAccessControl(); 360_context.Project.SetAccessControl(directory); 387Assert.Equal([path], Directory.GetFiles(_context.Project.FullName)); 401var path = Path.Combine(_context.Project.FullName, "settings.json"); 408TestPosixAcl.SetDefault(_context.Project.FullName, "user::rwx,user:65534:r-x,group::---,mask::r-x,other::---"); 423Assert.Equal([path], Directory.GetFiles(_context.Project.FullName)); 434var path = Path.Combine(_context.Project.FullName, "settings.json"); 461var path = Path.Combine(_context.Project.FullName, "settings.json"); 516Assert.Equal([path], Directory.GetFiles(_context.Project.FullName)); 525Assert.Equal(Path.Combine(_context.Project.FullName, ".github", "copilot", "settings.json"), 538var project = await File.ReadAllTextAsync(Path.Combine(_context.Project.FullName, ".github", "copilot", "settings.json")).DefaultTimeout(); 541Assert.False(Directory.Exists(Path.Combine(_context.Project.FullName, ".vscode"))); 576var project = await File.ReadAllTextAsync(Path.Combine(_context.Project.FullName, ".claude", "settings.json")).DefaultTimeout(); 593var path = local ? Path.Combine(_context.Project.FullName, ".claude", "settings.local.json") 594: client.GetIntegrationConfigPath(AgentConfigurationScope.Global, _context.Project); 602Directory.EnumerateFiles(_context.Project.FullName, "*", SearchOption.AllDirectories)); 603Assert.False(File.Exists(client.GetIntegrationConfigPath(AgentConfigurationScope.Project, _context.Project))); 616var target = Path.Combine(_context.Project.FullName, ".claude", "settings.json"); 636Assert.Empty(_context.Project.EnumerateFileSystemInfos()); 652var target = Path.Combine(_context.Project.FullName, ".claude", "settings.json"); 684_context.SetVariable("COPILOT_HOME", Path.Combine(_context.Project.FullName, ".github", "copilot")); 689Assert.Equal(Path.Combine(_context.Project.FullName, ".github", "copilot", "settings.json"), results[0].TargetPath); 690Assert.Equal([results[0].TargetPath], Directory.EnumerateFiles(_context.Project.FullName, "*", SearchOption.AllDirectories)); 734var unreadable = Path.Combine(_context.Project.FullName, ".github", "copilot", "settings.json"); 741Assert.True(File.Exists(Path.Combine(_context.Project.FullName, ".claude", "settings.json"))); 753Assert.Empty(_context.Project.EnumerateFileSystemInfos());
Agents\AgentPathTests.cs (5)
31Assert.Empty(_context.Project.EnumerateFileSystemInfos()); 45_context.Copilot.GetIntegrationConfigPath(AgentConfigurationScope.Global, _context.Project)); 47_context.Copilot.GetMcpConfigPath(AgentConfigurationScope.Global, _context.Project)); 48Assert.Empty(_context.Project.EnumerateFileSystemInfos()); 55Assert.Equal(Path.Combine(_context.Project.FullName, "~other-user"), AgentPath.Expand("~other-user", _context.ExecutionContext));
Agents\LocalAspireSkillsTests.cs (24)
26var paths = names.Select(name => Path.Combine(_context.Project.FullName, ".agents", "skills", name, "SKILL.md")).ToArray(); 49var path = Path.Combine(_context.Project.FullName, directory, "skills", "aspire", "SKILL.md"); 52var empty = Path.Combine(_context.Project.FullName, directory, "skills", "aspire-init", "SKILL.md"); 55await AgentConfigurationTestContext.WriteAsync(Path.Combine(_context.Project.FullName, directory, "skills", "aspire-custom", "SKILL.md"), "unrelated"); 56await AgentConfigurationTestContext.WriteAsync(Path.Combine(_context.Project.FullName, directory, "skills", "playwright-cli", "SKILL.md"), "unrelated"); 72var project = Path.Combine(_context.Project.FullName, ".agents", "skills", "aspire-init", "SKILL.md"); 91await AgentConfigurationTestContext.WriteAsync(Path.Combine(_context.Project.FullName, ".github", "skills", "aspire", "SKILL.md"), "other agent"); 106Path.Combine(_context.Project.FullName, ".opencode", "skill", "aspire", "SKILL.md"), 129: Path.Combine(_context.Project.FullName, ".opencode", "opencode.jsonc"); 132Path.Combine(_context.Project.FullName, "team-skills", "aspire", "SKILL.md"), 161var path = Path.Combine(_context.Project.FullName, "opencode.json"); 176await AgentConfigurationTestContext.WriteAsync(Path.Combine(_context.Project.FullName, "unrelated", ".agents", "skills", "aspire", "SKILL.md"), "unrelated"); 193var parent = _context.Project.CreateSubdirectory("apps"); 195var paths = new[] { _context.Project, parent, working } 207var result = LocalAspireSkills.Find(working, _context.Project, 219var selected = Path.Combine(_context.Project.FullName, ".agents", "skills", "aspire", "SKILL.md"); 224var result = LocalAspireSkills.Find(outside, _context.Project, [_context.OpenCode], 234var path = Path.Combine(_context.Project.FullName, ".agents", "skills", "aspire", "SKILL.md"); 236await AgentConfigurationTestContext.WriteAsync(Path.Combine(_context.Project.FullName, ".agents", "skills", "aspireify", "SKILL.md"), "readable"); 250LocalAspireSkills.Find(_context.Project, _context.Project, _context.Clients, new CancellationToken(canceled: true))); 251Assert.Empty(_context.Project.EnumerateFileSystemInfos()); 256=> LocalAspireSkills.Find(_context.Project, _context.Project, agents, TestContext.Current.CancellationToken);
Agents\OpenCodeAgentClientTests.cs (25)
19var workingDirectory = _context.Project.CreateSubdirectory(Path.Combine("apps", "api")); 25var target = client.GetIntegrationConfigPath(AgentConfigurationScope.Project, _context.Project); 27Assert.True(client.HasIntegrationRegistration(_context.Project, AgentConfigurationScope.Project, TestContext.Current.CancellationToken)); 28Assert.Equal(Path.Combine(_context.Project.FullName, "opencode.jsonc"), target); 46var lowerPath = Path.Combine(_context.Project.FullName, "opencode.json"); 47var ownerPath = Path.Combine(_context.Project.FullName, ".opencode", "opencode.json"); 74var json = Path.Combine(_context.Project.FullName, "opencode.json"); 103var directory = scope is AgentConfigurationScope.Project ? _context.Project.FullName : _context.OpenCodeDirectory; 117Assert.Empty((scope is AgentConfigurationScope.Project ? _context.Home : _context.Project).EnumerateFileSystemInfos()); 125var json = Path.Combine(_context.Project.FullName, "opencode.json"); 144var path = Path.Combine(_context.Project.FullName, "opencode.json"); 156var path = Path.Combine(_context.Project.FullName, "opencode.json"); 184Assert.Empty((scope is AgentConfigurationScope.Project ? _context.Home : _context.Project).EnumerateFileSystemInfos()); 190var root = Path.Combine(_context.Project.FullName, "opencode.jsonc"); 193var path = Path.Combine(_context.Project.FullName, ".opencode", "opencode.jsonc"); 214var path = Path.Combine(_context.Project.FullName, "opencode.json"); 240var path = Path.Combine(_context.Project.FullName, "opencode.json"); 265var path = Path.Combine(_context.Project.FullName, "opencode.json"); 291var path = Path.Combine(_context.Project.FullName, "opencode.json"); 306var directory = scope is AgentConfigurationScope.Project ? _context.Project.FullName : _context.OpenCodeDirectory; 334Assert.Empty(_context.Project.EnumerateFileSystemInfos()); 344? Path.Combine(_context.Project.FullName, "~", "custom-opencode") 356Assert.Equal(_context.OpenCode.GetMcpConfigPath(AgentConfigurationScope.Global, _context.Project), result.TargetPath); 360.Concat(Directory.EnumerateFiles(_context.Project.FullName, "*", SearchOption.AllDirectories)).Order()); 387Assert.True(_context.OpenCode.HasIntegrationRegistration(_context.Project, AgentConfigurationScope.Project, TestContext.Current.CancellationToken));
Commands\AgentInitClientSelectionTests.cs (4)
1339var projectSkillPath = Path.Combine(context.Project.FullName, projectDirectory, "skills", "aspire-init", "SKILL.md"); 1380Assert.True(File.Exists(context.Copilot.GetIntegrationConfigPath(AgentConfigurationScope.Global, context.Project))); 1381Assert.True(File.Exists(context.Copilot.GetMcpConfigPath(AgentConfigurationScope.Global, context.Project))); 1382Assert.False(File.Exists(context.ClaudeCode.GetIntegrationConfigPath(AgentConfigurationScope.Global, context.Project)));
Commands\AgentInitCommandTests.cs (30)
100await File.WriteAllTextAsync(Path.Combine(context.Project.FullName, "apphost.cs"), string.Empty); 131Assert.Equal(expectSourcePrompt, File.Exists(context.Copilot.GetIntegrationConfigPath(AgentConfigurationScope.Project, context.Project))); 132Assert.False(File.Exists(Path.Combine(context.Project.FullName, ".mcp.json"))); 164Assert.Empty(context.Project.EnumerateFileSystemInfos()); 201Assert.Equal(remote, File.Exists(context.Copilot.GetIntegrationConfigPath(AgentConfigurationScope.Project, context.Project))); 202Assert.Equal(!remote, File.Exists(Path.Combine(context.Project.FullName, ".agents", "skills", "aspire", "SKILL.md"))); 210await File.WriteAllTextAsync(Path.Combine(context.Project.FullName, "apphost.cs"), string.Empty); 580Assert.True(File.Exists(client.GetIntegrationConfigPath(configurationScope, context.Project))); 582context.Project, configurationScope, TestContext.Current.CancellationToken)); 584var skillsRoot = configurationScope is AgentConfigurationScope.Project ? context.Project : context.Home; 940var global = client.GetIntegrationConfigPath(AgentConfigurationScope.Global, context.Project); 944var project = client.GetIntegrationConfigPath(AgentConfigurationScope.Project, context.Project); 948"claude" => Path.Combine(context.Project.FullName, ".claude", "settings.json"), 967Assert.True(File.Exists(Path.Combine(client.GetSkillBaseDirectory(AgentConfigurationScope.Project, context.Project), "scope-test", "SKILL.md"))); 1131var root = scope == "project" ? context.Project : context.Home; 1132var otherRoot = scope == "project" ? context.Home : context.Project; 1174var scopeRoot = scope is AgentConfigurationScope.Project ? context.Project : context.Home; 1177$"{client.DisplayName}: {prefix}{Path.GetRelativePath(scopeRoot.FullName, client.GetIntegrationConfigPath(scope, context.Project)).Replace(Path.DirectorySeparatorChar, '/')}").ToArray(); 1205client.GetIntegrationConfigPath(AgentConfigurationScope.Project, context.Project), original); 1226client.GetIntegrationConfigPath(AgentConfigurationScope.Project, context.Project))); 1237var path = Path.Combine(context.Project.FullName, "opencode.json"); 1264Assert.Equal([path], context.Project.EnumerateFiles().Select(file => file.FullName)); 1274var configPath = Path.Combine(context.Project.FullName, ".opencode", "opencode.jsonc"); 1275var skillPath = Path.Combine(context.Project.FullName, "team-skills", "aspire", "SKILL.md"); 1313var path = context.OpenCode.GetMcpConfigPath(scope, context.Project); 1331Assert.True(File.Exists(context.Copilot.GetMcpConfigPath(scope, context.Project))); 1345var integrationPath = client.GetIntegrationConfigPath(AgentConfigurationScope.Project, context.Project); 1361client.GetMcpConfigPath(AgentConfigurationScope.Project, context.Project)))!; 1364Assert.True(File.Exists(context.Copilot.GetIntegrationConfigPath(AgentConfigurationScope.Project, context.Project))); 1365Assert.True(File.Exists(context.Copilot.GetMcpConfigPath(AgentConfigurationScope.Project, context.Project)));