1404 references to Parse
aspire (1)
Completions\CompletionInvocation.cs (1)
58return WriteCompletions(command.Parse(args[1]).GetCompletions(position), output);
Aspire.Cli.Tests (1398)
CliBootstrapTests.cs (2)
468var parseResult = command.Parse(commandLine); 489var parseResult = command.Parse("ls");
Commands\AddCommandTests.cs (80)
166.Parse($"add --apphost \"{appHostFile.FullName}\"{versionOption}") 376.Parse($"add {integrationArgument} --apphost \"{appHostFile.FullName}\"").InvokeAsync().DefaultTimeout(); 490.Parse($"{commandLine} --apphost \"{appHostFile.FullName}\"") 583.Parse($"add --apphost \"{appHostFile.FullName}\"").InvokeAsync().DefaultTimeout(); 614var exitCode = await provider.GetRequiredService<AddCommand>().Parse(commandLine).InvokeAsync().DefaultTimeout(); 656.Parse(commandLine).InvokeAsync().DefaultTimeout(); 729.Parse($"add Contoso.Hosting.One --apphost \"{appHostFile.FullName}\" --version 1.0.0").InvokeAsync().DefaultTimeout(); 822.Parse($"add {id} --apphost \"{appHostFile.FullName}\" --version 1.0.0").InvokeAsync().DefaultTimeout(); 888.Parse($"add Acme.Hosting.Redis --apphost \"{appHostFile.FullName}\" --version 1.0.0").InvokeAsync().DefaultTimeout(); 952.Parse($"add Aspire.Hosting.Redis --apphost \"{appHostFile.FullName}\" --version 1.0.0") 1132.Parse($"add {packageId} --apphost \"{appHostFile.FullName}\" --version 1.0.0") 1248.Parse($"add Acme.Hosting.Redis --apphost \"{appHostFile.FullName}\"{versionArgument}").InvokeAsync().DefaultTimeout(); 1271var result = command.Parse("add --help"); 1285var result = command.Parse("integration add --help"); 1314var result = command.Parse("integration search redis --json"); 1345var result = command.Parse("integration search --format json"); 1423var result = command.Parse("integration list --format json"); 1471var result = command.Parse(commandLine); 1496var result = command.Parse("integration list"); 1546var result = command.Parse("integration search redis --format json"); 1592var result = command.Parse("integration search rdis --format json"); 1679var result = command.Parse($"integration search redis --apphost \"{appHostFile.FullName}\" --format json"); 1751var result = command.Parse($"integration search redis --apphost \"{appHostFile.FullName}\" --format json"); 1838var result = command.Parse($"integration search foundry --apphost \"{appHostFile.FullName}\" --format json"); 1933var result = command.Parse($"integration search redis --apphost \"{appHostFile.FullName}\" --format json"); 2015var result = command.Parse($"{commandText} --apphost \"{appHostFile.FullName}\" --format json"); 2064var result = command.Parse($"integration search redis --apphost \"{appHostFile.FullName}\" --format json"); 2147var result = command.Parse($"integration search foundry --apphost \"{appHostFile.FullName}\" --format json"); 2205var result = command.Parse("integration list --format json"); 2258var result = command.Parse("integration search azure --format json"); 2342var result = command.Parse("add"); 2420var result = command.Parse("add docker"); 2503var result = command.Parse("add docker --version 9.2.0"); 2583var result = command.Parse("add docker --version 9.2.0"); 2658var result = command.Parse("add redis --version 13.2.0"); 2727var result = command.Parse("add redis --version 13.2.0"); 2818var result = command.Parse("add redis --version 13.2.0"); 2889var result = command.Parse($"add {integrationName}"); 2963var result = command.Parse("add redis --version 13.2.0"); 3038var result = command.Parse("add --version 13.2.0"); 3109var result = command.Parse("add --version 13.2.0"); 3179var result = command.Parse("add redis --version 13.2.0"); 3256var result = command.Parse("add redis --version 13.2.0"); 3340var result = command.Parse("add red"); 3428var result = command.Parse($"add redis --source {expectedSource}"); 3454var result = command.Parse($"add redis --source {source}"); 3489var result = command.Parse("add"); 3564var result = command.Parse("add nonexistentpackage"); 4006var result = command.Parse($"add {packageId} --apphost \"{appHostFile.FullName}\""); 4075.Parse($"{commandLine} --apphost \"{appHostFile.FullName}\"") 4147var result = command.Parse($"add Aspire.Hosting.Azure.Storage --apphost \"{appHostFile.FullName}\""); 4205var result = command.Parse("add redis"); 4273var result = command.Parse("add redis"); 4520var result = command.Parse("add redis"); 4589var result = command.Parse("add redis"); 4639var result = command.Parse($"add Aspire.Hosting.Foo --apphost \"{appHostFile.FullName}\""); 4699var result = command.Parse($"add {integrationName} --apphost \"{appHostFile.FullName}\"{sourceArgument}"); 4749var result = command.Parse($"add redis --apphost \"{appHostFile.FullName}\" --source ./feed"); 4810var result = command.Parse($"add Aspire.Hosting.Redis --apphost \"{appHostFile.FullName}\""); 4862var result = command.Parse($"add Aspire.Hosting.Foo --all --apphost \"{appHostFile.FullName}\""); 4908var result = command.Parse($"integration list --apphost \"{appHostFile.FullName}\" --format json"); 4956var result = command.Parse($"integration list --apphost \"{appHostFile.FullName}\""); 5003var result = command.Parse($"integration list --apphost \"{appHostFile.FullName}\""); 5052var result = command.Parse($"integration search zzznomatch --apphost \"{appHostFile.FullName}\""); 5110var result = command.Parse($"add Aspire.Hosting.Foo --apphost \"{appHostFile.FullName}\""); 5164var result = command.Parse($"add Aspire.Hosting.Redis --apphost \"{appHostFile.FullName}\""); 5210var result = command.Parse($"integration list --apphost \"{appHostFile.FullName}\" --format json"); 5376var result = command.Parse("add postgre"); 5443var result = command.Parse("add kube"); 5496var result = command.Parse("add kubernetes"); 5553var result = command.Parse("add kube"); 5622var result = command.Parse(integrationName is null ? "add" : $"add {integrationName}"); 5677var result = command.Parse("add postgre --version 9.2.0"); 5729var result = command.Parse("add nonexistentpackage --version 9.2.0"); 5815var result = command.Parse("add sql"); 5896var result = command.Parse("add sql --version 13.2.0"); 5979var result = command.Parse("add sql --version 13.2.0"); 6067var result = command.Parse("add nonexistentpackage --version 13.2.0"); 6154var result = command.Parse("add nonexistentpackage --version 13.2.0"); 6231var result = command.Parse("add azureapp");
Commands\AgentInitClientSelectionTests.cs (48)
38var result = provider.GetRequiredService<RootCommand>().Parse("agent init --skills aspire --mcp=false"); 91var result = provider.GetRequiredService<RootCommand>().Parse( 145var result = provider.GetRequiredService<RootCommand>().Parse( 171var result = provider.GetRequiredService<RootCommand>().Parse( 199var result = command.Parse($"agent init {options}"); 213var result = provider.GetRequiredService<RootCommand>().Parse($"agent init --scope {value}"); 229var result = provider.GetRequiredService<RootCommand>().Parse($"{command} --agent copilot"); 250var result = root.Parse($"{command} --agents {selection}"); 255var rejected = root.Parse($"{command} --agents copilot"); 260root.Parse($"{command} --agents ").GetCompletions().Select(item => item.Label).Order(StringComparer.Ordinal)); 273var result = provider.GetRequiredService<RootCommand>().Parse( 309var result = provider.GetRequiredService<RootCommand>().Parse("agent init --skills all --mcp"); 346var result = provider.GetRequiredService<RootCommand>().Parse( 385var result = provider.GetRequiredService<RootCommand>().Parse( 433var result = provider.GetRequiredService<RootCommand>().Parse( 517var result = provider.GetRequiredService<RootCommand>().Parse("agent init"); 566var result = provider.GetRequiredService<RootCommand>().Parse("agent init"); 604var result = provider.GetRequiredService<RootCommand>().Parse("agent init"); 616var result = provider.GetRequiredService<RootCommand>().Parse( 645var result = provider.GetRequiredService<RootCommand>().Parse($"agent init --agents all --scope {scope} --skills none --mcp"); 671var result = provider.GetRequiredService<RootCommand>().Parse("agent init --agents copilot,claude --skills none --mcp"); 690var result = provider.GetRequiredService<RootCommand>().Parse($"agent init --agents {client} --scope {scope} --skills none --mcp"); 719var result = provider.GetRequiredService<RootCommand>().Parse( 741var result = command.Parse($"agent init --agents {client} --skills none --mcp"); 770var result = provider.GetRequiredService<RootCommand>().Parse( 815var result = provider.GetRequiredService<RootCommand>().Parse( 878var result = provider.GetRequiredService<RootCommand>().Parse( 914var result = provider.GetRequiredService<RootCommand>().Parse( 940var result = provider.GetRequiredService<RootCommand>().Parse( 994var result = provider.GetRequiredService<RootCommand>().Parse( 1033var result = provider.GetRequiredService<RootCommand>().Parse( 1060var result = provider.GetRequiredService<RootCommand>().Parse("agent init --agents opencode --scope global --skills none --mcp"); 1098var result = provider.GetRequiredService<RootCommand>().Parse("agent init --agents all --scope global --skills none --mcp"); 1132var result = provider.GetRequiredService<RootCommand>().Parse( 1161var result = provider.GetRequiredService<RootCommand>().Parse( 1193var result = provider.GetRequiredService<RootCommand>().Parse( 1246var result = provider.GetRequiredService<RootCommand>().Parse( 1278var result = provider.GetRequiredService<RootCommand>().Parse( 1318var result = provider.GetRequiredService<RootCommand>().Parse( 1353var result = provider.GetRequiredService<RootCommand>().Parse( 1373var result = provider.GetRequiredService<RootCommand>().Parse($"agent init --agents claude --scope {scope} --skills aspire"); 1408var result = provider.GetRequiredService<RootCommand>().Parse( 1438var result = provider.GetRequiredService<RootCommand>().Parse( 1512var result = provider.GetRequiredService<RootCommand>().Parse( 1544var result = provider.GetRequiredService<RootCommand>().Parse( 1575var result = provider.GetRequiredService<RootCommand>().Parse( 1588var result = provider.GetRequiredService<RootCommand>().Parse( 1631var result = provider.GetRequiredService<RootCommand>().Parse(
Commands\AgentInitCommandTests.cs (49)
40Assert.Empty(root.Parse(command).Errors); 44Assert.Empty(root.Parse($"{command} --skills {skills}").Errors); 54Assert.NotEmpty(root.Parse($"{command} {options}").Errors); 58root.Parse($"{command} --skills ").GetCompletions().Select(item => item.Label).Order(StringComparer.Ordinal)); 102var result = provider.GetRequiredService<RootCommand>().Parse( 133var result = provider.GetRequiredService<RootCommand>().Parse( 154var result = provider.GetRequiredService<RootCommand>().Parse( 214var result = provider.GetRequiredService<RootCommand>().Parse( 235var result = root.Parse($"agent init --mcp{suffix}"); 239Assert.NotEmpty(root.Parse("agent init --mcp invalid").Errors); 240Assert.NotEmpty(root.Parse($"new aspire-empty --mcp{suffix}").Errors); 241Assert.NotEmpty(root.Parse($"init --mcp{suffix}").Errors); 300var result = provider.GetRequiredService<RootCommand>().Parse( 356var result = provider.GetRequiredService<RootCommand>().Parse( 385var result = provider.GetRequiredService<RootCommand>().Parse("agent init --agents copilot --mcp=false"); 425var command = provider.GetRequiredService<RootCommand>().Parse( 444var result = command.Parse($"agent init --workspace-root {workspace.WorkspaceRoot.FullName} --agents none --skills all"); 464var result = command.Parse($"agent init --workspace-root {workspace.WorkspaceRoot.FullName} --skills none"); 486var result = command.Parse($"agent init --agents all --scope {scope}"); 512var result = command.Parse($"agent init --workspace-root {workspace.WorkspaceRoot.FullName} --agents invalid --skills all"); 529var result = command.Parse("agent init --agents copilot"); 620var result = command.Parse($"agent init --workspace-root {workspace.WorkspaceRoot.FullName} --agents all --skills none"); 639var result = command.Parse($"agent init --workspace-root {workspace.WorkspaceRoot.FullName} --agents all"); 658var result = command.Parse($"agent init --workspace-root {workspace.WorkspaceRoot.FullName} --agents all --mcp"); 675var result = command.Parse($"agent init --workspace-root {workspace.WorkspaceRoot.FullName} --agents all --mcp=false"); 695var result = command.Parse($"agent init --workspace-root {workspace.WorkspaceRoot.FullName} --agents none --skills all"); 736Assert.Equal(CliExitCodes.Success, await command.Parse( 740Assert.Equal(CliExitCodes.Success, await command.Parse( 759var result = command.Parse($"agent init --workspace-root {workspace.WorkspaceRoot.FullName} --agents copilot --scope global --skills aspire"); 796var result = command.Parse($"agent init --workspace-root {workspace.WorkspaceRoot.FullName} --agents copilot --scope global --skills aspire"); 832var result = command.Parse($"agent init --workspace-root {workspace.WorkspaceRoot.FullName} --agents copilot --scope global --skills aspire"); 871var result = provider.GetRequiredService<RootCommand>().Parse( 923var result = provider.GetRequiredService<RootCommand>().Parse( 953var result = provider.GetRequiredService<RootCommand>().Parse( 984var result = provider.GetRequiredService<RootCommand>().Parse( 1012var result = provider.GetRequiredService<RootCommand>().Parse( 1043var result = provider.GetRequiredService<RootCommand>().Parse( 1059var repeated = provider.GetRequiredService<RootCommand>().Parse( 1089var result = provider.GetRequiredService<RootCommand>().Parse( 1151var result = provider.GetRequiredService<RootCommand>().Parse($"agent init --agents {agents} --scope project --skills {skills} --mcp=false --remove-skill-copies"); 1203var result = provider.GetRequiredService<RootCommand>().Parse( 1235var result = provider.GetRequiredService<RootCommand>().Parse( 1290var result = provider.GetRequiredService<RootCommand>().Parse( 1309var result = provider.GetRequiredService<RootCommand>().Parse( 1341var result = provider.GetRequiredService<RootCommand>().Parse( 1378var result = provider.GetRequiredService<RootCommand>().Parse( 1416var result = provider.GetRequiredService<RootCommand>().Parse( 1474var result = provider.GetRequiredService<RootCommand>().Parse( 1504var result = provider.GetRequiredService<RootCommand>().Parse(
Commands\AgentMcpCommandTests.cs (8)
95var parseResult = rootCommand.Parse(commandLine); 1596var parseResult = rootCommand.Parse("agent mcp --dashboard-url not-a-url"); 1616var parseResult = rootCommand.Parse( 1673var parseResult = rootCommand.Parse(commandLine); 1707var parseResult = rootCommand.Parse($"agent mcp --apphost \"{appHostProjectFile.FullName}\""); 1740var parseResult = rootCommand.Parse($"agent mcp --apphost \"{appHostDirectory.FullName}\""); 1768var parseResult = rootCommand.Parse($"agent mcp --apphost \"{missingPath}\""); 1803var parseResult = rootCommand.Parse($"agent mcp --apphost \"{appHostDirectory.FullName}\"");
Commands\AgentTelemetryCommandTests.cs (7)
168var result = command.Parse("agent telemetry --event-type skill_invocation --client-name copilot-cli --session-id 11111111-1111-1111-1111-111111111111 --skill-name aspire --timestamp 2026-01-01T00:00:00Z"); 200var result = command.Parse("agent telemetry --event-type tool_invocation --tool-name aspire-list_resources"); 231var result = command.Parse($"agent telemetry --event-type reference_file_read --file-reference {longValue}"); 289var result = command.Parse("agent telemetry --event-type not_a_real_event --skill-name aspire"); 336var result = command.Parse("agent telemetry --event-type skill_invocation --some-future-flag value"); 351var result = command.Parse("agent telemetry"); 383var result = command.Parse("agent telemetry --event-type reference_file_read --file-reference aspire/references/deploy.md");
Commands\ApiCommandTests.cs (5)
24var result = command.Parse("docs api"); 41var result = command.Parse("docs api list csharp"); 58var result = command.Parse("docs api search emulator --language typescript --format json"); 75var result = command.Parse("docs api get csharp/aspire.test.package/testtype"); 92var result = command.Parse("docs api get missing/id");
Commands\BaseCommandTests.cs (26)
46var result = command.Parse(args); 72var result = command.Parse("integration list --format json"); 93var result = command.Parse("stop"); 119var result = command.Parse("stop"); 143var result = command.Parse("stop"); 164var result = command.Parse("test"); 221var result = command.Parse(args); 247var result = command.Parse("run"); 284var result = command.Parse("run"); 336var result = provider.GetRequiredService<RootCommand>().Parse("ps"); 369var result = provider.GetRequiredService<RootCommand>().Parse("ps"); 399var result = command.Parse("add SomePackage"); 434var result = command.Parse("run"); 492var result = command.Parse(commandArgs); 542var result = command.Parse("ps"); 571var result = command.Parse("ps"); 624var result = command.Parse("run"); 663var result = command.Parse("run"); 699var result = command.Parse(args); 727var result = command.Parse("run --apphost somepath"); 755var result = command.Parse($"run {optionName}={value}"); 801var result = command.Parse("run --custom-arg value"); 827var result = command.Parse("run -- --AppHost somepath"); 848var result = command.Parse("run --AppHost foo -- --AppHost bar"); 867var result = command.Parse("add --AppHost somepath"); 888var result = command.Parse("resource myresource mycommand --AppHost primary");
Commands\CacheCommandTests.cs (7)
22var result = command.Parse("cache"); 37var result = command.Parse("cache --help"); 58var result = command.Parse("cache clear"); 79var result = command.Parse("cache clear"); 109var result = command.Parse("cache clear"); 136var result = command.Parse("cache clear"); 156var result = command.Parse("cache clear");
Commands\CertificatesCommandTests.cs (4)
27var result = command.Parse("certs --help"); 42var result = command.Parse("certs clean --help"); 57var result = command.Parse("certs trust --help"); 111var result = command.Parse("certs trust --non-interactive");
Commands\ConfigCommandTests.cs (56)
107var result = command.Parse("config"); 121var result = command.Parse("config"); 135var result = command.Parse("config set foo bar"); 160var exitCode = await command.Parse($"config set {key} true --global").InvokeAsync().DefaultTimeout(); 174var setLlmsResult = command.Parse("config set docs.llmsTxtUrl http://localhost:4321/llms-small.txt"); 178var setSitemapResult = command.Parse("config set docs.api.sitemapUrl http://localhost:4321/sitemap-0.xml"); 210var result = command.Parse("config set certificates.nssDbPaths firefox=/profiles/firefox --global"); 253var result = command.Parse($"config set {AspireConfigContainerTunnel.BaseImageConfigKey} {image}"); 289var result = command.Parse("config set foo.bar baz"); 314var result = command.Parse("config set foo.bar.baz hello"); 344var result1 = command.Parse("config set foo primitive"); 349var result2 = command.Parse("config set foo.bar nested"); 374var setResult = command1.Parse("config set testkey testvalue"); 385var getResult = command2.Parse("config get testkey"); 400var setResult = command1.Parse("config set level1.level2.level3 nestedvalue"); 410var getResult = command2.Parse("config get level1.level2.level3"); 423var result = command.Parse("config get nonexistent.key"); 439Assert.Equal(CliExitCodes.Success, await command.Parse("config set plugins[0] deployment").InvokeAsync().DefaultTimeout()); 446Assert.Equal(CliExitCodes.Success, await readerCommand.Parse("config get plugins[0]").InvokeAsync().DefaultTimeout()); 448Assert.Equal(CliExitCodes.Success, await readerCommand.Parse("config delete plugins[0]").InvokeAsync().DefaultTimeout()); 481Assert.Equal(CliExitCodes.InvalidCommand, await command.Parse(commandLine).InvokeAsync().DefaultTimeout()); 498var setResult = command.Parse("config set deletekey deletevalue"); 503var deleteResult = command.Parse("config delete deletekey"); 508var getResult = command.Parse("config get deletekey"); 523var setResult = command.Parse("config set deep.nested.value test"); 528var deleteResult = command.Parse("config delete deep.nested.value"); 552var setResult1 = command.Parse("config set flatkey flatvalue"); 556var setResult2 = command.Parse("config set nested.key nestedvalue"); 560var setResult3 = command.Parse("config set deep.nested.key deepvalue"); 565var listResult = command.Parse("config list"); 584var setResult = command.Parse("config set testkey testvalue"); 588var listResult = command.Parse("config list"); 610var setResult = command.Parse("config set testkey testvalue"); 614var listResult = command.Parse("config list --all"); 636var listResult = command.Parse("config list"); 658var listResult = command.Parse("config list --all"); 679var setResult = command.Parse($"config set {KnownFeatures.FeaturePrefix}.testFeature true"); 697var setResult = command.Parse($"config set {KnownFeatures.FeaturePrefix}.testFeature false"); 721var setResult = command.Parse($"config set {KnownFeatures.FeaturePrefix}.testFeature invalid"); 754var setResult = command.Parse($"config set {KnownFeatures.FeaturePrefix}.{KnownFeatures.ShowDeprecatedPackages} true"); 787var result = command.Parse("config set features:polyglotSupportEnabled true"); 820var setResult = command.Parse($"config set {key} true"); 844.Parse($"config get {key}"); 848.Parse($"config delete features:{featureName}"); 863var result1 = command.Parse("config set features:polyglotSupportEnabled true"); 868var result2 = command.Parse("config set features.polyglotSupportEnabled false"); 894var result1 = command.Parse("config set features.polyglotSupportEnabled true"); 899var result2 = command.Parse("config set features:polyglotSupportEnabled false"); 925var setResult = command.Parse("config set features.polyglotSupportEnabled true"); 930var deleteResult = command.Parse("config delete features:polyglotSupportEnabled"); 1018var result = command.Parse($"config set {key} AppHost.csproj"); 1048var result = command.Parse($"config set {key} AppHost.csproj"); 1080var result = command.Parse($"config set {key} AppHost.csproj --global"); 1105var result = command.Parse($"config set -g overrideStagingFeed {stagingFeed}"); 1145var result = command.Parse("config set appHostPath AppHost.csproj"); 1163var result = command.Parse("config set appHost.language typescript/nodejs");
Commands\ConfigSourceCommandTests.cs (38)
48var exitCode = await provider.GetRequiredService<RootCommand>().Parse(commandLine).InvokeAsync().DefaultTimeout(); 74.Parse($"{commandLine} --suppress-agent-init --non-interactive").InvokeAsync().DefaultTimeout(); 173await provider.GetRequiredService<RootCommand>().Parse(commandLine).InvokeAsync().DefaultTimeout(); 267await provider.GetRequiredService<RootCommand>().Parse(commandLine).InvokeAsync().DefaultTimeout(); 321await provider.GetRequiredService<RootCommand>().Parse("config list").InvokeAsync().DefaultTimeout(); 364var result = root.Parse($"agent init --agents {agent} --scope project --skills aspire --non-interactive"); 429var result = provider.GetRequiredService<RootCommand>().Parse( 442var agentResult = agentProvider.GetRequiredService<RootCommand>().Parse( 482.Parse("update --config-source --yes --non-interactive").InvokeAsync().DefaultTimeout(); 526var result = command.Parse("update --config-source --yes --non-interactive"); 562var result = provider.GetRequiredService<RootCommand>().Parse("update --config-source --yes --non-interactive"); 626var result = provider.GetRequiredService<RootCommand>().Parse("config get skillSources.team.repository"); 643var refresh = provider.GetRequiredService<RootCommand>().Parse("update --config-source --yes --non-interactive"); 657var result = provider.GetRequiredService<RootCommand>().Parse("update --config-source --non-interactive"); 674var result = provider.GetRequiredService<RootCommand>().Parse($"update --config-source {option}"); 714var result = provider.GetRequiredService<RootCommand>().Parse($"update --config-source{argument} --yes --non-interactive"); 758var result = provider.GetRequiredService<RootCommand>().Parse( 786var result = command.Parse($"update --config-source --apphost \"{Path.Combine(project.FullName, "apphost.cs")}\" --yes --non-interactive"); 810var result = provider.GetRequiredService<RootCommand>().Parse("update --config-source --yes --non-interactive"); 847var result = provider.GetRequiredService<RootCommand>().Parse( 923var result = provider.GetRequiredService<RootCommand>().Parse($"update --apphost \"{projectFile.FullName}\" --yes{consent}"); 989var result = provider.GetRequiredService<RootCommand>().Parse($"update --apphost \"{projectFile.FullName}\" --yes{consent}"); 1021var result = provider.GetRequiredService<RootCommand>().Parse("update --yes --non-interactive"); 1066var result = provider.GetRequiredService<RootCommand>().Parse("update --config-source --yes --non-interactive"); 1195var result = provider.GetRequiredService<RootCommand>().Parse( 1228var result = provider.GetRequiredService<RootCommand>().Parse($"{commandLine} --apphost \"{missingProject}\""); 1247var result = provider.GetRequiredService<RootCommand>().Parse(commandLine); 1266var result = provider.GetRequiredService<RootCommand>().Parse(commandLine); 1294var result = provider.GetRequiredService<RootCommand>().Parse( 1317var result = provider.GetRequiredService<RootCommand>().Parse( 1335Assert.Equal(CliExitCodes.Success, await original.GetRequiredService<RootCommand>().Parse(command).InvokeAsync().DefaultTimeout()); 1346Assert.Equal(CliExitCodes.Success, await provider.GetRequiredService<RootCommand>().Parse( 1454var exitCode = await provider.GetRequiredService<RootCommand>().Parse(command).InvokeAsync().DefaultTimeout(); 1494var refresh = refreshProvider.GetRequiredService<RootCommand>().Parse( 1523var result = provider.GetRequiredService<RootCommand>().Parse( 1576var result = provider.GetRequiredService<RootCommand>().Parse( 1622.Parse("new aspire-empty --language csharp --use-config-source true --non-interactive") 1657.Parse("update --config-source --yes --non-interactive").InvokeAsync().DefaultTimeout();
Commands\DashboardRunCommandTests.cs (18)
39var result = command.Parse("dashboard run"); 56var result = command.Parse("dashboard run --help"); 79var result = command.Parse($"dashboard run {args}"); 92var result = command.Parse("dashboard run --ASPNETCORE_URLS=http://localhost:9999"); 144var result = command.Parse("dashboard run"); 164var result = command.Parse("dashboard run"); 203var result = command.Parse("dashboard run"); 222var result = command.Parse("dashboard run"); 255var result = command.Parse("dashboard run"); 279var result = command.Parse("dashboard run"); 311var result = command.Parse($"dashboard run {cliArgs}"); 331var result = command.Parse("dashboard run"); 355var result = command.Parse("dashboard run"); 376var result = command.Parse("dashboard run --CUSTOM_SETTING=myvalue"); 401var result = command.Parse("dashboard run --frontend-url http://localhost:5000 --otlp-grpc-url http://localhost:9317 --otlp-http-url http://localhost:9318 --allow-anonymous --application-name TestApp --persistence Run --config-file-path /my/config.json"); 429var result = command.Parse("dashboard run"); 460var result = command.Parse("dashboard run"); 517var result = command.Parse("dashboard run");
Commands\DeployCommandTests.cs (12)
30var result = command.Parse("deploy --help"); 60var result = command.Parse("deploy"); 126var result = command.Parse(invocation); 178var result = command.Parse("deploy --apphost invalid.csproj"); 212var result = command.Parse("deploy --apphost valid.csproj"); 246var result = command.Parse("deploy --apphost valid.csproj"); 314var result = command.Parse("deploy"); 386var result = command.Parse("deploy"); 444var result = command.Parse($"deploy --apphost \"{appHostFile.FullName}\" --environment \"{environment}\""); 492var result = command.Parse($"deploy --apphost \"{appHostFile.FullName}\" --environment Production"); 563var result = command.Parse($"deploy --output-path {testOutputPath}"); 623var result = command.Parse("deploy");
Commands\DescribeCommandTests.cs (43)
64var exitCode = await provider.GetRequiredService<RootCommand>().Parse(commandLine).InvokeAsync().DefaultTimeout(); 86var exitCode = await provider.GetRequiredService<RootCommand>().Parse(commandLine).InvokeAsync().DefaultTimeout(); 110var exitCode = await provider.GetRequiredService<RootCommand>().Parse("describe --follow").InvokeAsync().DefaultTimeout(); 129var exitCode = await provider.GetRequiredService<RootCommand>().Parse("describe").InvokeAsync().DefaultTimeout(); 161var exitCode = await provider.GetRequiredService<RootCommand>().Parse("describe").InvokeAsync().DefaultTimeout(); 175var result = command.Parse("describe --help"); 189var result = command.Parse("describe"); 208var result = command.Parse(commandLine); 226var result = command.Parse($"describe --format {format} --help"); 244var result = command.Parse($"describe --format {format} --help"); 259var result = command.Parse("describe --format invalid"); 274var result = command.Parse("describe --follow --help"); 289var result = command.Parse("describe --watch --help"); 304var result = command.Parse("resources --help"); 319var result = command.Parse("describe --follow --format json --help"); 334var result = command.Parse("describe myresource --help"); 349var result = command.Parse("describe myresource --follow --format json --help"); 550var result = command.Parse("describe --follow --format json"); 633var result = command.Parse("describe --follow --format json"); 672var result = command.Parse("describe --follow --format json"); 710var result = command.Parse("describe --follow --format json"); 758var result = command.Parse("describe --follow --format json --include-disabled-commands"); 803var result = command.Parse("describe --follow --format json"); 851var result = command.Parse("describe --follow"); 884var result = command.Parse("describe --follow --format json"); 914var result = command.Parse("describe --follow --format json"); 938var result = command.Parse("describe --follow --format json"); 965var result = command.Parse("describe --format json"); 1004var result = command.Parse("describe --format json"); 1035var result = command.Parse("describe --follow --format json"); 1065var result = command.Parse("describe --format json"); 1091var result = command.Parse("describe --format json --include-hidden"); 1118var result = command.Parse("describe aspire-dashboard --format json"); 1143var result = command.Parse("describe --follow --format json"); 1171var result = command.Parse("describe --follow --format json --include-hidden"); 1217var result = provider.GetRequiredService<RootCommand>().Parse(args); 1239var exitCode = await provider.GetRequiredService<RootCommand>().Parse("resources --format mermaid").InvokeAsync().DefaultTimeout(); 1262var exitCode = await provider.GetRequiredService<RootCommand>().Parse($"resources {resource} --format mermaid").InvokeAsync().DefaultTimeout(); 1280var exitCode = await provider.GetRequiredService<RootCommand>().Parse($"resources {resource} --format mermaid").InvokeAsync().DefaultTimeout(); 1294var exitCode = await provider.GetRequiredService<RootCommand>().Parse("resources --format mermaid --follow").InvokeAsync().DefaultTimeout(); 1311var exitCode = await provider.GetRequiredService<RootCommand>().Parse("resources missing --format mermaid").InvokeAsync().DefaultTimeout(); 1332var exitCode = await provider.GetRequiredService<RootCommand>().Parse("resources --format mermaid").InvokeAsync().DefaultTimeout(); 1376var result = command.Parse("describe");
Commands\DestroyCommandTests.cs (9)
28var result = command.Parse("destroy --help"); 65var result = command.Parse(commandLine); 84var result = command.Parse(commandLine); 116var result = command.Parse("destroy --apphost invalid.csproj"); 175var result = command.Parse("destroy"); 211var result = command.Parse(commandLine); 274var result = command.Parse(commandLine); 332var result = command.Parse($"destroy --output-path {testOutputPath}"); 385var result = command.Parse("destroy --yes");
Commands\DoCommandTests.cs (23)
29var result = command.Parse("do --help"); 56var result = command.Parse("do"); 114var result = command.Parse("do my-custom-step"); 167var result = command.Parse("do deploy"); 220var result = command.Parse("do publish"); 278var result = command.Parse("do my-step --output-path test-output"); 310var result = command.Parse("do my-step --apphost invalid.csproj"); 399var result = command.Parse(commandLine); 461var exitCode = await command.Parse("do --list-steps --format json").InvokeAsync().DefaultTimeout(); 507var exitCode = await command.Parse("do --list-steps --format json").InvokeAsync().DefaultTimeout(); 563var result = command.Parse("do deploy --list-steps"); 617var result = command.Parse("do deploy --list-steps"); 646var exitCode = await command.Parse("do --list-steps --format json").InvokeAsync().DefaultTimeout(); 675var exitCode = await command.Parse("do --list-steps --format json").InvokeAsync().DefaultTimeout(); 707var exitCode = await command.Parse("do --list-steps --format json").InvokeAsync().DefaultTimeout(); 737var exitCode = await command.Parse("do --list-steps --format json").InvokeAsync().DefaultTimeout(); 773var exitCode = await command.Parse("do --list-steps --format json").InvokeAsync().DefaultTimeout(); 829var result = command.Parse("do deploy --list-steps"); 844var result = command.Parse("do --help"); 882var exitCode = await command.Parse("do deploy --format yaml").InvokeAsync().DefaultTimeout(); 906var exitCode = await command.Parse(commandLine).InvokeAsync().DefaultTimeout(); 956var result = command.Parse("do my-step --pipeline-log-level debug"); 1011var result = command.Parse("do my-step --log-level Warning");
Commands\DocsCommandTests.cs (10)
24var result = command.Parse("docs"); 42var result = command.Parse("docs list"); 59var result = command.Parse("docs list --format json"); 77var result = command.Parse("docs search redis"); 95var result = command.Parse("docs search redis -n 3"); 113var result = command.Parse("docs search redis --format json"); 130var result = command.Parse("docs get redis-integration"); 147var result = command.Parse("docs get redis-integration --section \"Getting Started\""); 203var result = command.Parse("docs get docs-smoke-test"); 246var result = command.Parse("docs get nonexistent-page");
Commands\DoctorCommandTests.cs (8)
30var result = command.Parse("doctor --help"); 106var exitCode = await command.Parse("doctor").InvokeAsync().DefaultTimeout(); 224var result = command.Parse("doctor --format json"); 805var result = command.Parse("doctor --self"); 870var result = command.Parse("doctor"); 924var result = command.Parse("doctor"); 1051var result = command.Parse("doctor"); 1099var result = command.Parse(commandLine);
Commands\ExportCommandTests.cs (14)
61var result = command.Parse($"export --output {outputPath}"); 132var result = command.Parse($"export --output {outputPath}"); 165var result = command.Parse($"export --apphost {appHostProjectPath} --output {outputPath}"); 280var result = command.Parse($"export --output {outputPath}"); 342var result = command.Parse($"export --output {outputPath}"); 460var result = command.Parse($"export redis --output {outputPath}"); 518var result = command.Parse($"export webfrontend --output {outputPath}"); 578var result = command.Parse($"export apiservice --output {outputPath}"); 628var result = command.Parse($"export --output {outputPath}"); 670var result = command.Parse($"export --include-hidden --output {outputPath}"); 714var result = command.Parse($"export aspire-dashboard --output {outputPath}"); 750var result = command.Parse($"export nonexistent --output {outputPath}"); 789var result = command.Parse($"export --dashboard-url http://localhost:18888 --api-key test-token --output {outputPath}"); 836var result = command.Parse($"export --output {outputPath}");
Commands\ExtensionInternalCommandTests.cs (8)
37var result = command.Parse("extension --help"); 51var result = command.Parse("extension"); 72var result = command.Parse("extension get-apphosts"); 120var result = command.Parse("extension get-apphosts --nologo"); 149var result = command.Parse("extension get-apphosts"); 188var result = command.Parse("extension get-apphosts"); 206var result = command.Parse("extension get-apphosts"); 220var result = command.Parse("extension get-apphosts --help");
Commands\InitCommandTests.cs (58)
66var exitCode = await command.Parse("init").InvokeAsync().DefaultTimeout(); 154var parseResult = initCommand.Parse("init"); 182var result = provider.GetRequiredService<RootCommand>().Parse( 233var parseResult = initCommand.Parse($"init{additionalArgs}"); 261var parseResult = initCommand.Parse("init --file-based"); 309var parseResult = command.Parse("init --file-based --language csharp --non-interactive --suppress-agent-init"); 334var parseResult = command.Parse("init --help"); 350var parseResult = initCommand.Parse("init"); 372var parseResult = initCommand.Parse("init"); 394var parseResult = initCommand.Parse("init"); 475var parseResult = initCommand.Parse("init"); 526var parseResult = initCommand.Parse("init"); 564var parseResult = initCommand.Parse("init --source https://example.test/v3/index.json --version 13.0.0 --channel daily --suppress-agent-init"); 622var parseResult = command.Parse($"init --file-based{languageArgs}"); 666var parseResult = initCommand.Parse($"init{additionalArgs}"); 700var parseResult = initCommand.Parse("init --language go --suppress-agent-init"); 740var parseResult = initCommand.Parse("init --suppress-agent-init"); 769var parseResult = initCommand.Parse($"init --language typescript{additionalArgs}"); 819var parseResult = initCommand.Parse($"init --language typescript{additionalArgs}"); 862var exitCode = await command.Parse("init --language go --non-interactive --suppress-agent-init") 905var parseResult = initCommand.Parse("init --language typescript"); 938var parseResult = initCommand.Parse("init --language typescript --skills aspire"); 974var parseResult = initCommand.Parse("init --language typescript --skills none"); 1037var result = provider.GetRequiredService<InitCommand>().Parse( 1058var parseResult = command.Parse("init --non-interactive --skills none"); 1080var parseResult = command.Parse("init --non-interactive --agents none"); 1102var parseResult = command.Parse($"init --non-interactive --agents copilot --scope {scope} --skills aspire"); 1138var parseResult = command.Parse($"init --non-interactive --agents copilot --scope project --skills aspire{option}"); 1160var parseResult = initCommand.Parse("init"); 1208var parseResult = initCommand.Parse("init"); 1232var parseResult = initCommand.Parse("init"); 1278var parseResult = initCommand.Parse($"init{additionalArgs}"); 1320var parseResult = initCommand.Parse("init"); 1408var parseResult = initCommand.Parse("init"); 1461var parseResult = initCommand.Parse("init"); 1516var parseResult = initCommand.Parse("init"); 1565var parseResult = initCommand.Parse("init"); 1601var parseResult = initCommand.Parse("init"); 1636var parseResult = initCommand.Parse("init"); 1672var parseResult = initCommand.Parse("init"); 1714var parseResult = initCommand.Parse("init"); 1745var parseResult = initCommand.Parse("init"); 1789var parseResult = initCommand.Parse("init"); 1841var parseResult = initCommand.Parse("init"); 1889var parseResult = initCommand.Parse("init"); 1943var parseResult = initCommand.Parse("init"); 1995var parseResult = initCommand.Parse("init"); 2066var parseResult = initCommand.Parse("init"); 2151var parseResult = initCommand.Parse("init"); 2219var parseResult = initCommand.Parse("init"); 2269var parseResult = initCommand.Parse("init"); 2315var parseResult = initCommand.Parse("init"); 2352var parseResult = initCommand.Parse("init"); 2401var parseResult = initCommand.Parse("init"); 2463var parseResult = initCommand.Parse("init"); 2514var parseResult = initCommand.Parse("init"); 2576var parseResult = initCommand.Parse("init"); 2623var parseResult = initCommand.Parse("init");
Commands\LogsCommandTests.cs (39)
27var result = command.Parse("logs --help"); 129var result = command.Parse($"logs --tail {tailValue}"); 150var result = command.Parse($"logs --tail {tailValue} --help"); 167var result = command.Parse("logs myresource"); 187var result = command.Parse($"logs --format {format} --help"); 205var result = command.Parse($"logs --format {format} --help"); 220var result = command.Parse("logs --format invalid"); 236var result = command.Parse("logs --follow --tail 50 --help"); 251var result = command.Parse("logs myresource --follow --tail 100 --format json --help"); 267var result = command.Parse("logs -f -n 10 --help"); 381var result = command.Parse("logs --format json"); 411var result = command.Parse("logs"); 438var result = command.Parse($"logs {resourceName} --format json"); 460var result = command.Parse("logs --format json --timestamps"); 498var result = command.Parse("logs --format json"); 537var result = command.Parse("logs --timestamps"); 559var result = command.Parse("logs"); 595var result = command.Parse("logs"); 627var result = command.Parse("logs --format json"); 649var result = command.Parse("logs --format json"); 674var result = command.Parse("logs --format json --include-hidden"); 699var result = command.Parse("logs aspire-dashboard --format json"); 784var result = command.Parse("logs --format json"); 893var result = command.Parse("logs --follow"); 915var result = command.Parse("logs --follow --format json"); 938var result = command.Parse("logs --follow --format json"); 960var result = command.Parse("logs --follow --format json"); 1050var result = command.Parse("logs redis --search timeout --format json"); 1081var result = command.Parse("logs redis --search Ready --format json"); 1110var result = command.Parse("logs redis --search nonexistent --format json"); 1141var result = command.Parse("logs redis --search \"Connection timeout\" --format json"); 1173var result = command.Parse("logs redis --search level:error --format json"); 1208var result = command.Parse("logs redis --search Ready --tail 2 --format json"); 1256var result = command.Parse("logs redis --search Ready --tail 2 --format json"); 1292var result = command.Parse("logs redis --search timeout --tail 1 --format json"); 1337var result = command.Parse("logs --search timeout --tail 1 --format json"); 1386var result = command.Parse("logs --follow --search timeout"); 1415var result = command.Parse("logs redis --follow --tail 10 --search timeout"); 1460var result = command.Parse("logs redis --follow --tail 10 --search timeout");
Commands\LsCommandTests.cs (22)
33var result = command.Parse("ls --help"); 48var result = command.Parse("ls"); 66var result = command.Parse($"ls --format {format}"); 81var result = command.Parse("ls --format invalid"); 112var result = command.Parse("ls --format json"); 152var result = command.Parse("ls --format json"); 193var result = command.Parse("ls --format json"); 234var result = command.Parse("ls --format json"); 266var result = command.Parse("ls --format json"); 307var result = command.Parse("ls --format json --stream"); 349var result = command.Parse("ls --format json --stream"); 394var result = command.Parse("ls --format json --stream"); 441var result = command.Parse("ls --format json --stream"); 485var result = command.Parse("ls --format json --stream"); 507var result = command.Parse("ls --stream"); 539var result = command.Parse("ls"); 578var result = command.Parse("ls"); 646var result = command.Parse("ls"); 689var result = command.Parse("ls"); 719var result = command.Parse("ls"); 748var result = command.Parse("ls --all"); 786var result = command.Parse("ls --format json --all");
Commands\McpCommandTests.cs (7)
21var result = command.Parse("mcp"); 36var result = command.Parse("mcp --help"); 50var result = command.Parse("mcp start --help"); 108var result = command.Parse("agent"); 123var result = command.Parse("agent --help"); 137var result = command.Parse("agent mcp --help"); 151var result = command.Parse("agent init --help");
Commands\NewCommandChannelResolutionTests.cs (2)
112var parseResult = newCommand.Parse("new aspire-starter --name TestApp --output ./output --use-redis-cache --test-framework None"); 606var parseResult = newCommand.Parse($"new fake-template --name TestApp --output ./captured{channelArg}{versionArg}{sourceArg}");
Commands\NewCommandLocalTemplateTests.ConfiguredGitSourceObjects.cs (1)
112.Parse("new --name Demo --output out --suppress-agent-init").InvokeAsync().DefaultTimeout();
Commands\NewCommandLocalTemplateTests.ConfiguredGitSources.cs (10)
65.Parse("new --name Demo --output out --suppress-agent-init").InvokeAsync().DefaultTimeout(); 117.Parse("new --name Demo --output out --suppress-agent-init").InvokeAsync().DefaultTimeout(); 149.Parse($"new --name Demo --output out{invocation} --suppress-agent-init").InvokeAsync().DefaultTimeout(); 230.Parse("new --name Demo --output out --suppress-agent-init").InvokeAsync().DefaultTimeout(); 274var command = provider.GetRequiredService<RootCommand>().Parse("new --name Demo --output out --suppress-agent-init"); 457.Parse(commandLine).InvokeAsync(cancellationToken: cancellation.Token).DefaultTimeout(); 488.Parse("new --template-path template --name Demo --output out --suppress-agent-init").InvokeAsync().DefaultTimeout(); 534.Parse("new --name Demo --output out --suppress-agent-init").InvokeAsync().DefaultTimeout(); 584.Parse("new --name Demo --output out --suppress-agent-init").InvokeAsync().DefaultTimeout(); 638var result = await provider.GetRequiredService<RootCommand>().Parse("new --name Demo --output out")
Commands\NewCommandLocalTemplateTests.ConfiguredSources.cs (10)
48.Parse("new --name Demo --output out --suppress-agent-init").InvokeAsync().DefaultTimeout(); 371.Parse("new --name Demo --output out --suppress-agent-init").InvokeAsync().DefaultTimeout(); 415.Parse("new --name Demo --output out --suppress-agent-init").InvokeAsync().DefaultTimeout(); 442.Parse("new --name Demo --output out --suppress-agent-init").InvokeAsync().DefaultTimeout(); 486.Parse("new --name Demo --output out --suppress-agent-init").InvokeAsync(cancellationToken: cancellation.Token).DefaultTimeout(); 506Assert.Equal(CliExitCodes.Success, await command.Parse("new --help").InvokeAsync().DefaultTimeout()); 543var result = await provider.GetRequiredService<RootCommand>().Parse("new") 573var result = await provider.GetRequiredService<RootCommand>().Parse("new").InvokeAsync().DefaultTimeout(); 644var result = await provider.GetRequiredService<RootCommand>().Parse("new --language unknown").InvokeAsync().DefaultTimeout(); 674var result = await provider.GetRequiredService<RootCommand>().Parse("new")
Commands\NewCommandLocalTemplateTests.cs (42)
54.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 115.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 160var exitCode = await command.Parse("new --template-path template --name Demo --output out --suppress-agent-init").InvokeAsync().DefaultTimeout(); 193.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 204.Parse("new --template-path template --name Demo --output non-interactive-out --suppress-agent-init") 235.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 287.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 314.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 348.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 371.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 425.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 467.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 489.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 527.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 564.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 637var exitCode = await command.Parse("new --template-path template --name Demo --output out --suppress-agent-init").InvokeAsync().DefaultTimeout(); 669.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 737var exitCode = await command.Parse("new --template-path template --name Demo --output out --suppress-agent-init").InvokeAsync().DefaultTimeout(); 778var exitCode = await command.Parse("new --template-path template --name Demo --output out --suppress-agent-init").InvokeAsync().DefaultTimeout(); 814.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 861.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 947.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 1002.Parse("new --template-repository https://example.test/templates.git --name Demo --output out --suppress-agent-init") 1040.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 1080.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 1119var exitCode = await command.Parse("new --template-path template --name Demo --output out --suppress-agent-init").InvokeAsync().DefaultTimeout(); 1148var exitCode = await command.Parse("new --template-path template --name Demo --output out --suppress-agent-init").InvokeAsync().DefaultTimeout(); 1179var exitCode = await command.Parse("new --template-path template --name Demo --output out --suppress-agent-init").InvokeAsync().DefaultTimeout(); 1195var exitCode = await command.Parse("new --template-path template --name Demo --output out --suppress-agent-init").InvokeAsync().DefaultTimeout(); 1227var exitCode = await command.Parse("new --template-path template --name Demo --output out --suppress-agent-init").InvokeAsync().DefaultTimeout(); 1246var exitCode = await command.Parse($"new {options} --template-path template --suppress-agent-init").InvokeAsync().DefaultTimeout(); 1263var exitCode = await command.Parse("new --template-path template --name Demo --output out --suppress-agent-init").InvokeAsync().DefaultTimeout(); 1291var exitCode = await command.Parse("new --template-path templates --name Demo --output out --suppress-agent-init").InvokeAsync().DefaultTimeout(); 1315var exitCode = await command.Parse("new --template-path missing --help").InvokeAsync().DefaultTimeout(); 1505.Parse("new --template-repository https://example.test/templates.git --template-path template --name Demo --output out --suppress-agent-init") 1580.Parse("new --template-repository https://example.test/templates.git --template-path template --name Demo --output out --suppress-agent-init") 1664var parseResult = command.Parse("new --template-repository=-repository --template-path template --name Demo --output out --suppress-agent-init"); 1904var exitCode = await provider.GetRequiredService<RootCommand>().Parse($"new {options} --suppress-agent-init").InvokeAsync().DefaultTimeout(); 1925.Parse($"new {options} --name Demo --output out --suppress-agent-init").InvokeAsync().DefaultTimeout(); 1944.Parse($"new {options} --template-repository https://example.test/templates.git --suppress-agent-init").InvokeAsync().DefaultTimeout(); 1960var result = provider.GetRequiredService<RootCommand>().Parse($"new aspire-starter {option} template-value"); 1977.Parse("new --template-repository https://example.test/templates.git --help").InvokeAsync().DefaultTimeout();
Commands\NewCommandLocalTemplateTests.HostConfiguration.cs (11)
72.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 111.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 168.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 201.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 234.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 256.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 284.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 327.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 371.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 424.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 490.Parse("new --template-path template --name Demo --output out --suppress-agent-init")
Commands\NewCommandLocalTemplateTests.InitConfig.cs (6)
66.Parse("new --name Demo --output out --suppress-agent-init") 89var result = await provider.GetRequiredService<RootCommand>().Parse(commandLine).InvokeAsync().DefaultTimeout(); 110.Parse("template source list --format json --use-config-source true").InvokeAsync().DefaultTimeout(); 213.Parse("new --use-config-source --name Demo --output out --suppress-agent-init") 264.Parse($"new {(consent is false ? "--use-config-source false " : "")}--name Demo --output out --suppress-agent-init") 292.Parse("template source list --format json --use-config-source").InvokeAsync().DefaultTimeout();
Commands\NewCommandLocalTemplateTests.NuGetValues.cs (13)
56.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 132.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 160.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 194.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 228.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 255.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 284.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 329.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 372.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 404.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 431var parseResult = provider.GetRequiredService<RootCommand>().Parse("new --template-path template"); 461.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 508.Parse("new --template-path template --name Demo --output out --suppress-agent-init")
Commands\NewCommandLocalTemplateTests.PromptDefaults.cs (6)
29.Parse($"new --template-path template --name \"{name}\" --output out --suppress-agent-init") 62.Parse("new --template-path template --name Demo.App --output out --suppress-agent-init") 88.Parse("new --template-path template --output out --suppress-agent-init") 218.Parse("new --template-path template --name Demo --output out --suppress-agent-init") 245.Parse($"new --template-path template {options} --suppress-agent-init") 270.Parse("new --template-path template --name Demo.App --output out --suppress-agent-init")
Commands\NewCommandLocalTemplateTests.SourceList.cs (15)
55.Parse(json ? "template source list --format json" : "template source list").InvokeAsync().DefaultTimeout(); 103.Parse("template source list --format json").InvokeAsync().DefaultTimeout(); 123.Parse($"template source list{options}").InvokeAsync().DefaultTimeout(); 145.Parse("template source list --format json").InvokeAsync().DefaultTimeout(); 163.Parse("template source list --format json").InvokeAsync().DefaultTimeout(); 177var parseResult = provider.GetRequiredService<RootCommand>().Parse("template source list --format yaml"); 245.Parse($"template source list{options}").InvokeAsync().DefaultTimeout(); 314.Parse($"template source list --format json{(useSource is false ? " --use-config-source false" : "")}") 353.Parse($"template source list{options}").InvokeAsync().DefaultTimeout(); 420.Parse($"template source list{options}").InvokeAsync().DefaultTimeout(); 448var omitted = root.Parse(command); 453var explicitValue = root.Parse($"{command} --use-config-source {value.ToString().ToLowerInvariant()}"); 457var bareFlag = root.Parse($"{command} --use-config-source"); 484var parsed = root.Parse($"{command} {option} {followingOption} --non-interactive"); 504var parsed = root.Parse($"{command} --use-config-source {value} --non-interactive");
Commands\NewCommandLocalTemplateTests.SourceListGit.cs (4)
70.Parse("template source list --format json --use-config-source").InvokeAsync().DefaultTimeout()); 113.Parse($"template source list{options}").InvokeAsync().DefaultTimeout(); 218.Parse("template source list --format json --use-config-source").InvokeAsync().DefaultTimeout()); 264.Parse($"new {(consent is null ? "" : $"--use-config-source {consent.Value.ToString().ToLowerInvariant()} ")}--name Demo --output out --suppress-agent-init")
Commands\NewCommandLocalTemplateTests.SourceManagement.cs (16)
128.Parse($"template source add company --repository https://example.test/templates --non-interactive {yesOption}"); 287Assert.Equal(CliExitCodes.InvalidCommand, await root.Parse("template source add company --repository https://example.test/replacement --yes").InvokeAsync().DefaultTimeout()); 289Assert.Equal(CliExitCodes.ConfigNotFound, await root.Parse("template source remove missing").InvokeAsync().DefaultTimeout()); 308Assert.Equal(CliExitCodes.InvalidCommand, await root.Parse("template source add company --repository https://example.test/templates --yes").InvokeAsync().DefaultTimeout()); 310Assert.Equal(CliExitCodes.InvalidCommand, await root.Parse("template source remove company").InvokeAsync().DefaultTimeout()); 349Assert.Equal(CliExitCodes.InvalidCommand, await root.Parse("template source add COMPANY --repository https://example.test/duplicate --yes").InvokeAsync().DefaultTimeout()); 351Assert.Equal(CliExitCodes.Success, await root.Parse("config set templateSources.company.path templates/api --global").InvokeAsync().DefaultTimeout()); 352Assert.Equal(CliExitCodes.Success, await root.Parse("config set TEMPLATESOURCES.COMPANY.repository https://example.test/repo --global").InvokeAsync().DefaultTimeout()); 353Assert.Equal(CliExitCodes.Success, await root.Parse("config set templateSources.company.ref main --global").InvokeAsync().DefaultTimeout()); 363Assert.Equal(CliExitCodes.Success, await root.Parse("template source add other --repository https://example.test/other --yes").InvokeAsync().DefaultTimeout()); 364Assert.Equal(CliExitCodes.Success, await root.Parse("template source remove company").InvokeAsync().DefaultTimeout()); 366Assert.Equal(CliExitCodes.Success, await root.Parse("template source remove OTHER").InvokeAsync().DefaultTimeout()); 400.Parse("config set templateSources.company.path templates/api --global").InvokeAsync().DefaultTimeout(); 444.Parse("config set templateSources.company.path ../escape --global").InvokeAsync().DefaultTimeout(); 467var result = await provider.GetRequiredService<RootCommand>().Parse(command).InvokeAsync().DefaultTimeout(); 492Assert.Equal(CliExitCodes.Success, await root.Parse("template source remove broken").InvokeAsync().DefaultTimeout());
Commands\NewCommandTemplateConfigPersistenceTests.cs (2)
323var parseResult = newCommand.Parse(string.Join(" ", commandArguments)); 477var parseResult = newCommand.Parse(
Commands\NewCommandTests.cs (81)
41var result = command.Parse("new --help"); 65var result = command.Parse( 146var configResult = configCommand.Parse($"config set -g overrideStagingFeed {stagingFeed}"); 175var result = command.Parse($"new {KnownTemplateId.CSharpEmptyAppHost} --language csharp --name TemplateOut --output ./TemplateOut --localhost-tld false"); 203var result = command.Parse("new aspire-starter --use-redis-cache --test-framework None"); 227var result = command.Parse($"new aspire-starter --use-redis-cache --test-framework {testFramework}"); 283var result = command.Parse("new aspire-starter --use-redis-cache --test-framework None"); 316var result = command.Parse("new aspire-starter --name MyApp --output ./output --use-redis-cache --test-framework None"); 348var result = command.Parse("new aspire-starter --output notsrc --use-redis-cache --test-framework None"); 426var result = command.Parse("new aspire-starter --channel stable --use-redis-cache --test-framework None"); 503var result = command.Parse("new aspire-starter --channel stable --use-redis-cache --test-framework None"); 580var result = command.Parse("new aspire-starter --channel pr-12345 --name TestApp --output ./output --use-redis-cache --test-framework None"); 619var result = command.Parse("new aspire-starter --name MyApp --output ./output --use-redis-cache --test-framework None"); 651var result = command.Parse("new aspire-starter --name MyApp --output ./output --use-redis-cache --test-framework None --version 9.2.0"); 687var result = command.Parse("new"); 728var result = command.Parse("new aspire-starter --use-redis-cache --test-framework None"); 825var result = command.Parse("new aspire-starter --name TestApp --output ./output"); 888var result = command.Parse($"new aspire-starter --use-redis-cache --test-framework None"); 947var result = command.Parse("new --name TestApp --output ./output"); 1004var result = command.Parse("new --name TestApp --output ./output"); 1069var result = command.Parse("new --name TestApp --output ./output"); 1104var result = command.Parse("new aspire-empty --name TestApp --output ./output"); 1165var result = command.Parse("new aspire-empty --name TestApp --output ./output"); 1228var result = command.Parse("new aspire-empty --name TestApp --output ./output"); 1256var result = command.Parse("new aspire-empty --name TestApp --output ./output --language typescript --localhost-tld false --suppress-agent-init"); 1326var result = command.Parse($"new aspire-empty --name TestApp --output ./output --language csharp --localhost-tld false --suppress-agent-init --channel staging --source {sourceOverride}"); 1371var result = command.Parse("new aspire-empty --name TestApp --output ./output --language csharp --localhost-tld false --suppress-agent-init --channel staging --source relative-feed"); 1424var result = command.Parse($"new aspire-empty --name TestApp --output ./output --language {language} --localhost-tld false --suppress-agent-init --source \"{sourceOverride}\""); 1450var result = command.Parse($"new aspire-empty --name TestApp --output ./output --language csharp --localhost-tld false --suppress-agent-init --source \"{sourceOverride}\""); 1485var result = command.Parse($"new aspire-empty --name TestApp --output ./output --language typescript --localhost-tld false --suppress-agent-init --source {sourceOverride}"); 1519var result = command.Parse("new aspire-empty --name TestApp --output ./output --language typescript --localhost-tld false --suppress-agent-init --source nuget.org"); 1553var result = command.Parse("new aspire-empty --name TestApp --output ./output --language typescript --localhost-tld false --suppress-agent-init"); 1592var result = command.Parse("new aspire-java-empty --name TestApp --output ./output --localhost-tld false"); 1628var result = command.Parse("new aspire-py-empty --name TestApp --output ./output --localhost-tld false"); 1656var result = command.Parse("new aspire-go-empty --name TestApp --output ./output --localhost-tld false"); 1673var result = command.Parse("new aspire-empty --name TestApp --output ./output --localhost-tld false"); 1702var result = command.Parse("new aspire-empty --name TestApp --output ./output --localhost-tld false --suppress-agent-init"); 1740var result = command.Parse($"new aspire-empty --name TestApp --output ./output --version {version} --localhost-tld false --suppress-agent-init"); 1774var result = command.Parse("new aspire-empty --name TestApp --output ./output --localhost-tld false --suppress-agent-init"); 1808var result = command.Parse("new aspire-empty --name TestApp --output ./output --localhost-tld --suppress-agent-init"); 1882var result = command.Parse("new aspire-empty --name TestApp --output ./output"); 1923var result = command.Parse("new aspire-ts-empty --name TestApp --output ./output --localhost-tld false"); 1971var result = command.Parse("new aspire-ts-empty --name TestApp --output ./output --channel stable --localhost-tld false"); 2012var result = command.Parse("new aspire-ts-empty --name TestApp --localhost-tld false"); 2090var result = command.Parse("new aspire-ts-empty --name TestApp --output ./output"); 2169var result = command.Parse("new aspire-ts-starter --name TestApp --output ./output --channel daily --localhost-tld false"); 2234var result = command.Parse("new aspire-ts-starter --name TestApp --output ./output --channel daily --localhost-tld false"); 2293var result = command.Parse($"new aspire-ts-starter --name TestApp --output ./output --channel daily --localhost-tld false --source \"{sourceOverride}\""); 2349var result = command.Parse($"new aspire-starter --name TestApp --output ./output --source {sourceOverride} --use-redis-cache --test-framework None"); 2405var result = command.Parse($"new aspire-ts-starter --name TestApp --output ./output --channel daily --localhost-tld false --source {sourceOverride}"); 2433var result = command.Parse("new aspire-empty --name TestApp --output ./output"); 2458var result = command.Parse("new aspire-empty --name TestApp --output ./output --agents none"); 2483var result = command.Parse("new aspire-empty --name TestApp --output ./output --agents copilot --skills aspire"); 2519var result = command.Parse($"new aspire-empty --name TestApp --output ./output --agents copilot --scope global --skills aspire{option}"); 2561var result = command.Parse("new"); 2609var result = command.Parse("new aspire-starter --use-redis-cache --test-framework None"); 2653var result = command.Parse($"new aspire-starter --name MyProject --output {Path.Combine(workspace.WorkspaceRoot.FullName, "my-project")} --use-redis-cache --test-framework None"); 2697var result = command.Parse($"new aspire-starter --name MyProject --output {outputDir} --use-redis-cache --test-framework None --suppress-agent-init"); 2744var result = command.Parse("new aspire-starter --use-redis-cache --test-framework None"); 2783var result = command.Parse("new aspire-ts-empty --name TestApp --output ./output"); 2838var result = command.Parse("new aspire-starter --use-redis-cache --test-framework None --suppress-agent-init"); 2897var result = command.Parse("new aspire-starter --use-redis-cache --test-framework None --suppress-agent-init"); 2954var result = command.Parse("new aspire-starter --use-redis-cache --test-framework None"); 3016var result = command.Parse("new aspire-starter --use-redis-cache --test-framework None --suppress-agent-init"); 3078var result = command.Parse($"new {KnownTemplateId.TypeScriptEmptyAppHost} --name {projectName} --version 9.2.0 --localhost-tld false --suppress-agent-init"); 3141var result = command.Parse($"new {KnownTemplateId.TypeScriptEmptyAppHost} --name {projectName} --version 9.2.0 --localhost-tld false --suppress-agent-init"); 3219var result = command.Parse( 3294var result = command.Parse($"new {KnownTemplateId.TypeScriptEmptyAppHost} --name {projectName} --version 9.2.0 --localhost-tld false --suppress-agent-init"); 3363var result = command.Parse($"new {KnownTemplateId.TypeScriptEmptyAppHost} --name {projectName} --version 9.2.0 --localhost-tld false --suppress-agent-init"); 3417var result = command.Parse($"new {KnownTemplateId.TypeScriptEmptyAppHost} --name {projectName} --version 9.2.0 --localhost-tld false --suppress-agent-init"); 3455var result = command.Parse("new aspire-empty --name TestApp --output ./output --localhost-tld false"); 3485var result = command.Parse("new aspire-empty --name TestApp --output ./output --suppress-agent-init"); 3512var result = command.Parse("new aspire-empty --name TestApp --output ./output --suppress-agent-init=false"); 3541var result = command.Parse("new aspire-empty --name TestApp --output ./output"); 3568var result = provider.GetRequiredService<NewCommand>().Parse( 3604var result = command.Parse($"new aspire-starter --name TestApp --output {existingDir.FullName} --use-redis-cache --test-framework None"); 3626var result = command.Parse($"new aspire-starter --name TestApp --output {emptyDir.FullName} --use-redis-cache --test-framework None"); 3661var result = command.Parse("new aspire-starter --use-redis-cache --test-framework None"); 3686var result = command.Parse($"new aspire-starter --name TestApp --output {invalidPath} --use-redis-cache --test-framework None"); 3732var result = command.Parse("new aspire-starter --name TestApp --output . --use-redis-cache --test-framework None"); 3791var result = command.Parse("new aspire-starter");
Commands\OptionWithLegacyTests.cs (2)
19var result = command.Parse("test --new-name primary-value --old-name legacy-value"); 34var result = command.Parse("test --old-name legacy-value");
Commands\PsCommandTests.cs (22)
42var result = command.Parse("ps --help"); 57var result = command.Parse("ps"); 76var result = command.Parse($"ps --format {format}"); 94var result = command.Parse($"ps --format {format}"); 109var result = command.Parse("ps --format invalid"); 161var result = command.Parse($"ps --format json {outputOption}"); 213var result = command.Parse("ps --format json"); 251var result = command.Parse("ps --format json"); 297var result = command.Parse("ps --format json"); 339var result = command.Parse("ps --format json"); 385var result = command.Parse("ps"); 418var result = command.Parse("ps"); 459var result = command.Parse("ps"); 482var result = command.Parse("ps --format json"); 518var result = command.Parse("ps --format json"); 558var result = command.Parse("ps --format json --follow"); 601var exitCode = await command.Parse("ps --format json --follow") 644var result = command.Parse("ps --follow"); 692var result = command.Parse("ps --format json --follow"); 736var result = command.Parse("ps --format json"); 783var result = command.Parse("ps --format json"); 822var result = command.Parse("ps --format json");
Commands\PublishCommandPromptingIntegrationTests.cs (20)
47var result = command.Parse("publish"); 93var result = command.Parse("publish"); 145var result = command.Parse("publish"); 192var result = command.Parse("publish"); 238var result = command.Parse("publish"); 287var result = command.Parse("publish"); 322var result = command.Parse("publish"); 370var result = command.Parse("publish"); 449var result = command.Parse("publish"); 517var result = command.Parse("publish"); 569var result = command.Parse("publish"); 624var result = command.Parse("publish"); 695var result = command.Parse("publish --debug"); 739var result = command.Parse("publish"); 782var result = command.Parse("publish"); 831var result = command.Parse("publish"); 877var result = command.Parse("publish"); 917var result = command.Parse("publish"); 963var result = command.Parse("publish"); 997var result = command.Parse("publish");
Commands\PublishCommandTests.cs (6)
24var result = command.Parse("publish --help"); 52var result = command.Parse("publish --apphost invalid.csproj"); 83var result = command.Parse("publish --apphost valid.csproj"); 114var result = command.Parse("publish --apphost valid.csproj"); 157var result = command.Parse("publish --apphost valid.csproj"); 226var result = command.Parse("publish");
Commands\ResourceCommandHelpParserTests.cs (4)
18command.Parse("resource web wait-for-browser --help"), 35command.Parse("resource web wait-for-browser --apphost ./AppHost/AppHost.csproj --help"), 53command.Parse("resource web wait-for-browser --project ./AppHost/AppHost.csproj --help"), 79command.Parse(commandLine),
Commands\ResourceCommandTests.cs (73)
30var result = command.Parse("resource --help"); 62var result = command.Parse("resource web --non-interactive --help"); 93var result = command.Parse("resource web --help"); 118var result = command.Parse("resource web --help"); 141var result = command.Parse("resource web --help"); 182var result = command.Parse($"""resource web --apphost "{appHostDirectory.FullName}" --help"""); 229var result = command.Parse($"""resource web --apphost "{appHostProjectFile.FullName}" --help"""); 272var result = command.Parse($"""resource web --apphost "{symlinkedAppHostPath}" --help"""); 301var result = command.Parse("resource hidden-worker --include-hidden --help"); 317var result = command.Parse("resource"); 336var result = command.Parse($"""resource {arguments}"""); 353var result = command.Parse("resource myresource"); 373var result = command.Parse($"""resource myresource {arguments}"""); 390var result = command.Parse("resource myresource my-command --help"); 404var result = command.Parse("resource myresource my-command --apphost /path/to/project.csproj --help"); 426var result = command.Parse($"resource myresource {commandName} --help"); 458var result = command.Parse($"resource myresource {commandName}"); 497var result = command.Parse("resource myresource my-command"); 522var result = command.Parse("resource myresource start --apphost /path/to/project.csproj --help"); 545var result = command.Parse("resource myresource Start"); 582var result = command.Parse("""resource web-browser-automation fill-browser "#name" Aspire"""); 609var result = command.Parse("""resource web-browser-automation click-browser"""); 646var result = command.Parse("""resource web-browser-automation wait-for-browser "--text=Submitted Aspire!" --timeoutMilliseconds=500"""); 684var result = command.Parse("resource mydb configure -- --AppHost primary"); 719var result = command.Parse("resource greeting parameter-set --value \"Hello world\""); 779var result = command.Parse("""resource web-browser-automation navigate-browser "https://example.com/?q=aspire" """); 806var result = command.Parse("""resource web-browser-automation click-browser "#submit" extra"""); 833var result = command.Parse("""resource web-browser-automation click-browser --selector "#submit" --count 2"""); 860var result = command.Parse("""resource web-browser-automation configure --verbose"""); 880var result = command.Parse("""resource web-browser-automation configure -- --selector "#submit" """); 916var result = command.Parse("""resource web-browser-automation wait-for-browser --timeout-milliseconds 500"""); 944var result = command.Parse("""resource web-browser-automation Configure --message hello"""); 980var result = command.Parse("""resource web-browser-automation configure --timeout-milliseconds=500 --proxy"""); 1011var result = command.Parse($"""resource web-browser-automation configure {arguments}"""); 1046var result = command.Parse("""resource web-browser-automation configure --flavor chocolate"""); 1082var result = command.Parse("""resource web-browser-automation configure --flavor strawberry"""); 1112var result = command.Parse("""resource web-browser-automation configure --unknown value"""); 1138var result = command.Parse("""resource web-browser-automation configure --mm ss"""); 1165var result = command.Parse("""resource web-browser-automation configure --proxy maybe"""); 1194var result = command.Parse("""resource web-browser-automation configure --save-to-user-secrets true"""); 1234var result = command.Parse("""resource web-browser-automation configure --timeout-seconds 0"""); 1269var result = command.Parse("resource myresource my-command"); 1302var result = command.Parse("""resource web configure"""); 1338var result = command.Parse("""resource web-browser-automation configure --flavor strawberry"""); 1368var result = command.Parse("""resource web-browser-automation configure"""); 1401var result = command.Parse($"""resource web-browser-automation configure {arguments}"""); 1430var result = command.Parse("""resource web-browser-automation configure --timeoutMilliseconds 1 --timeout-milliseconds 2"""); 1459var result = command.Parse("""resource web-browser-automation configure --message first --message second"""); 1489var result = command.Parse("""resource web-browser-automation wait-for-browser --timeout-milliseconds 500"""); 1521var result = command.Parse("""resource web-browser-automation wait-for-browser"""); 1559var result = command.Parse("""resource web-browser-automation wait-for-browser --timeout-milliseconds not-a-number"""); 1595var result = command.Parse("""resource web-browser-automation fill-browser --selector "#name" Aspire"""); 1630var result = command.Parse("""resource web-browser-automation configure -- --log-level Debug"""); 1659var result = command.Parse("""resource web-browser-automation configure -- --message "from delimiter" --timeout-milliseconds 10"""); 1688var result = command.Parse("resource hidden-worker configure --include-hidden -- --message \"from hidden resource\""); 1717var result = command.Parse("""resource web-browser-automation configure --log-level Debug"""); 1752var result = command.Parse("""resource web-browser-automation configure --no-proxy localhost"""); 1796var result = command.Parse("""resource web-browser-automation configure --load-arguments -- --browser Chrome"""); 1840var result = command.Parse("""resource web-browser-automation configure --load-arguments -- --browser Chrome"""); 1876var result = command.Parse("""resource web-browser-automation configure --load-arguments -- --browser Chrome"""); 1915var result = command.Parse("""resource argument-commands dependent-arguments --load-arguments -- --category fruit"""); 1949var result = command.Parse("""resource argument-commands dependent-arguments -- --category=fruit --item=banana --quantity=2 --priority=express"""); 1989var result = command.Parse("""resource web-browser-automation configure --no-proxy"""); 2006var result = command.Parse("""resource myresource --help"""); 2045var result = command.Parse("""resource web-browser-automation wait-for-browser --help"""); 2079var result = command.Parse("""resource web-browser-automation wait-for-browser --help -- --selector #main"""); 2109var result = command.Parse("""resource web-browser-automation custom-command -- --help"""); 2147var result = command.Parse("""resource web-browser-automation configure --help"""); 2177var result = command.Parse("""resource web-browser-automation configure --help"""); 2214var result = command.Parse("""resource web-browser-automation configure --help"""); 2235var result = command.Parse("""resource web-browser-automation configure --help"""); 2261var result = command.Parse("""resource web-browser-automation configure --help"""); 2312var result = command.Parse("""resource argument-commands all-argument-types --help""");
Commands\RestoreCommandTests.cs (2)
40var result = command.Parse($"restore --apphost {appHostFile.FullName}"); 78var result = command.Parse($"restore --apphost {appHostFile.FullName}");
Commands\RootCommandTests.cs (11)
36Assert.Equal(expected, command.Parse("test --help").Errors.Count == 0); 37Assert.Empty(command.Parse("run --help").Errors); 56var result = command.Parse("--version"); 79var result = command.Parse("-v"); 104var result = command.Parse("--version"); 155var result = command.Parse("--version"); 213var result = command.Parse("--help"); 227var result = command.Parse("--nologo --help"); 246var result = command.Parse("--help"); 266var result = command.Parse("run --capture-profile --capture-profile-output profile.zip --capture-profile-delay 1"); 347var result = command.Parse("--help");
Commands\RunCommandTests.cs (66)
52var result = command.Parse("run --help"); 91var pendingRun = command.Parse($"run --apphost \"{appHostFile.FullName}\" {arguments}") 344var result = command.Parse("run"); 387var result = command.Parse($"run --apphost {appHostFile.FullName}"); 428var result = command.Parse($"run --apphost {appHostFile.FullName}"); 476var result = command.Parse($"run --apphost {appHostFile.FullName}"); 543var result = command.Parse($"run --apphost {appHostFile.FullName}"); 635var result = command.Parse($"run --apphost {appHostFile.FullName}"); 703var result = command.Parse($"run --apphost {appHostFile.FullName}"); 756var result = command.Parse("run"); 839var pendingCommand = command.Parse($"run --apphost {appHostFile.FullName}") 933var result = command.Parse($"run --apphost {appHostFile.FullName}"); 1040var result = command.Parse($"run --apphost {appHostFile.FullName}"); 1138var result = command.Parse($"run --apphost {appHostFile.FullName}"); 1218var result = command.Parse("run"); 1245var result = command.Parse("run"); 1275var result = command.Parse("run"); 1293var result = command.Parse("run"); 1310var result = command.Parse("run --apphost /tmp/doesnotexist.csproj"); 1374var result = command.Parse($"run --apphost {appHostProjectFile.FullName}"); 1404var result = command.Parse("run"); 1434var result = command.Parse("run"); 1466var result = command.Parse($"run --apphost {appHostProjectFile.FullName}"); 1526var result = command.Parse($"run --apphost {appHostProjectFile.FullName}"); 1549var result = command.Parse("run --detach"); 1579var parentResult = parentCommand.Parse($"run --detach --apphost {appHostFile.FullName}"); 1618var childResult = childCommand.Parse("run"); 1694var result = command.Parse("run"); 1800var result = command.Parse($"run --apphost {appHostFile.FullName}"); 1870var result = command.Parse($"run --apphost {appHostFile.FullName}"); 1938var result = command.Parse($"run --apphost {appHostFile.FullName}"); 1995var result = command.Parse($"run --apphost {appHostFile.FullName}"); 2054var result = command.Parse($"run --apphost {appHostFile.FullName}"); 2125var result = command.Parse($"run --apphost {appHostFile.FullName}"); 2235var pendingCommand = command.Parse($"run --apphost {appHostFile.FullName}") 2318var result = command.Parse($"run --apphost {appHostFile.FullName}"); 2379var result = command.Parse($"run --apphost {appHostFile.FullName}"); 2431var result = command.Parse($"run --apphost {appHostFile.FullName}"); 2503var result = command.Parse($"run --apphost {appHostFile.FullName}"); 2660var result = command.Parse("run"); 2728var result = command.Parse("run"); 2859var result = command.Parse("run"); 2917var result = command.Parse("run"); 2965var result = command.Parse("run --capture-profile"); 3008var result = command.Parse("run --capture-profile"); 3059var result = command.Parse("run --capture-profile"); 3110var result = command.Parse("run"); 3221var result = command.Parse("run"); 3327var result = command.Parse("run"); 3397var result = command.Parse("run"); 3466var result = command.Parse("run --start-debug-session"); 3526var result = command.Parse("run"); 3590var result = command.Parse("run"); 3657var result = command.Parse("run"); 3716var result = command.Parse("run"); 3771var result = command.Parse("run"); 3828var result = command.Parse("run"); 3887var result = command.Parse("run"); 4294var result = command.Parse("run --no-build"); 4375var result = command.Parse("run --isolated"); 4436var result = command.Parse("run --no-build"); 4452var result = command.Parse("run -- --custom-arg value --launch-profile E2E"); 5081var result = command.Parse(explicitAppHost ? $"run --apphost \"{appHostFile.FullName}\"" : "run"); 5302var result = command.Parse("run --non-interactive"); 5375var result = command.Parse("run --no-build"); 5430var result = command.Parse(args);
Commands\Sdk\SdkExportCommandTests.cs (1)
374return await command.Parse(commandLine).InvokeAsync().DefaultTimeout();
Commands\SdkCommandTests.cs (2)
99var result = command.Parse("sdk"); 114var result = command.Parse("sdk --help");
Commands\SdkDumpCommandTests.cs (15)
34var result = command.Parse("sdk dump --help"); 56var result = command.Parse($"sdk dump --format {format}"); 69var result = command.Parse("sdk dump /nonexistent/path/to/integration.csproj"); 84var result = command.Parse("sdk dump @13.2.0"); 99var result = command.Parse("sdk dump Aspire.Hosting.Redis@"); 114var result = command.Parse("sdk dump Aspire.Hosting.Redis@not-a-version!!!"); 129var result = command.Parse("sdk dump some-random-string"); 144var result = command.Parse("sdk dump Aspire.Hosting.Redis@13.2.0"); 157var result = command.Parse("sdk dump Aspire.Hosting.Redis@13.2.0 Aspire.Hosting.PostgreSQL@13.2.0"); 170var result = command.Parse("sdk dump --format ci --output-directory ./ats Aspire.Hosting.Redis@13.2.0"); 183var result = command.Parse("sdk dump --format ci --output ./all.ats.txt --output-directory ./ats Aspire.Hosting.Redis@13.2.0"); 198var result = command.Parse("sdk dump --output-directory ./ats Aspire.Hosting.Redis@13.2.0"); 213var result = command.Parse("sdk dump --format ci --output-directory ./ats"); 228var result = command.Parse("sdk dump Aspire.Hosting.Redis@13.2.0-preview.1"); 243var result = command.Parse("sdk dump Aspire.Hosting.Redis@@13.2.0");
Commands\SdkInstallerTests.cs (6)
46var result = command.Parse("run"); 71var result = command.Parse("add redis"); 94var result = command.Parse("new aspire-starter"); 133var result = command.Parse("publish"); 171var result = command.Parse("deploy"); 193var result = command.Parse("run");
Commands\SecretCommandTests.cs (40)
76var exitCode = await command.Parse($"secret {arguments} {environmentOption} --apphost \"{appHostFile.FullName}\"") 122var exitCode = await command.Parse($"secret delete ConnectionStrings:db --apphost \"{appHostFile.FullName}\"") 167Assert.Equal(CliExitCodes.Success, await command.Parse(arguments).InvokeAsync().DefaultTimeout()); 175Assert.Equal(CliExitCodes.Success, await command.Parse(arguments).InvokeAsync().DefaultTimeout()); 201Assert.Equal(CliExitCodes.Success, await command.Parse($"secret path --apphost \"{appHostFile.FullName}\"").InvokeAsync().DefaultTimeout()); 226Assert.Equal(CliExitCodes.Success, await command.Parse($"secret get ConnectionStrings:db {options}").InvokeAsync().DefaultTimeout()); 228Assert.Equal(CliExitCodes.Success, await command.Parse($"secret set Parameters:other synthetic {options}").InvokeAsync().DefaultTimeout()); 233Assert.Equal(CliExitCodes.Success, await command.Parse($"secret list --format json {options}").InvokeAsync().DefaultTimeout()); 237Assert.Equal(CliExitCodes.Success, await command.Parse($"secret delete ConnectionStrings:db {options}").InvokeAsync().DefaultTimeout()); 567var result = provider.GetRequiredService<RootCommand>().Parse("secret set --help"); 594var result = command.Parse($"secret path --apphost \"{appHostFile.FullName}\""); 620var result = command.Parse($"secret path --apphost \"{appHostFile.FullName}\""); 647var setResult = command.Parse($"secret set --environment Production Parameters:api_key prod-secret --apphost \"{appHostFile.FullName}\""); 655var getResult = command.Parse($"secret get --environment Production Parameters:api_key --apphost \"{appHostFile.FullName}\""); 662var listResult = command.Parse($"secret list --environment Production --format json --apphost \"{appHostFile.FullName}\""); 668var defaultGetResult = command.Parse($"secret get Parameters:api_key --apphost \"{appHostFile.FullName}\""); 673var deleteResult = command.Parse($"secret delete --environment Production Parameters:api_key --apphost \"{appHostFile.FullName}\""); 678var deletedGetResult = command.Parse($"secret get --environment Production Parameters:api_key --apphost \"{appHostFile.FullName}\""); 699Assert.Equal(CliExitCodes.Success, await command.Parse($"secret set --environment Production Parameters:key prod-secret {projectOption}").InvokeAsync().DefaultTimeout()); 703Assert.Equal(CliExitCodes.Success, await command.Parse($"secret set Parameters:key dev-secret {projectOption}").InvokeAsync().DefaultTimeout()); 709Assert.Equal(CliExitCodes.Success, await command.Parse($"secret get --environment Production Parameters:key {projectOption}").InvokeAsync().DefaultTimeout()); 713Assert.Equal(CliExitCodes.Success, await command.Parse($"secret list --all --format json {projectOption}").InvokeAsync().DefaultTimeout()); 717Assert.Equal(CliExitCodes.Success, await command.Parse($"secret delete --environment Production Parameters:key {projectOption}").InvokeAsync().DefaultTimeout()); 718Assert.Equal(CliExitCodes.ConfigNotFound, await command.Parse($"secret get --environment Production Parameters:key {projectOption}").InvokeAsync().DefaultTimeout()); 733Assert.Equal(CliExitCodes.Success, await command.Parse( 737Assert.Equal(CliExitCodes.Success, await command.Parse( 763var setDevelopmentResult = command.Parse($"secret set Parameters:api_key dev-secret --apphost \"{appHostFile.FullName}\""); 770var setProductionResult = command.Parse($"secret set --environment Production Azure:SubscriptionId prod-subscription --apphost \"{appHostFile.FullName}\""); 776var listAllResult = command.Parse($"secret list --all --format json --apphost \"{appHostFile.FullName}\""); 816var getLegacyResult = command.Parse($"secret get Legacy:Value --apphost \"{appHostFile.FullName}\""); 822var setResult = command.Parse($"secret set New:Value new --apphost \"{appHostFile.FullName}\""); 860var result = command.Parse($"secret {arguments} --environment \"{environment}\""); 882Assert.Equal(CliExitCodes.Success, await command.Parse($"secret set Parameters:key initial -e {originalEnvironment} {projectOption}").InvokeAsync().DefaultTimeout()); 883Assert.Equal(CliExitCodes.Success, await command.Parse($"secret set Parameters:key updated -e {alternateEnvironment} {projectOption}").InvokeAsync().DefaultTimeout()); 886Assert.Equal(CliExitCodes.Success, await command.Parse($"secret get Parameters:key -e {alternateEnvironment} {projectOption}").InvokeAsync().DefaultTimeout()); 890Assert.Equal(CliExitCodes.Success, await command.Parse($"secret list --all --format json {projectOption}").InvokeAsync().DefaultTimeout()); 896Assert.Equal(CliExitCodes.Success, await command.Parse($"secret path -e {alternateEnvironment} {projectOption}").InvokeAsync().DefaultTimeout()); 899Assert.Equal(CliExitCodes.Success, await command.Parse($"secret delete Parameters:key -e {alternateEnvironment} {projectOption}").InvokeAsync().DefaultTimeout()); 900Assert.Equal(CliExitCodes.ConfigNotFound, await command.Parse($"secret get Parameters:key -e {originalEnvironment} {projectOption}").InvokeAsync().DefaultTimeout()); 930var exitCode = await command.Parse($"secret {arguments} -e Production --apphost \"{appHostFile.FullName}\"")
Commands\StartCommandTests.cs (30)
49var result = command.Parse("start"); 67var result = command.Parse("start --help"); 87var result = command.Parse("start --help"); 104var result = command.Parse("start --no-build --help"); 118var result = command.Parse("start --format json --help"); 132var result = command.Parse("start --isolated --help"); 215var result = command.Parse("start"); 233var result = command.Parse("start -- --custom-arg value --launch-profile E2E"); 319var result = command.Parse("start"); 349var result = command.Parse("start --format json"); 394var result = command.Parse($"start --apphost {appHostFile.FullName}"); 510var result = command.Parse("start"); 539var result = command.Parse($"start --apphost {appHostFile.FullName} --start-debug-session"); 564var result = provider.GetRequiredService<RootCommand>().Parse($"start --apphost {appHostFile.FullName}"); 602var result = command.Parse($"start --apphost {appHostFile.FullName}"); 638var result = command.Parse(string.Format(CultureInfo.InvariantCulture, commandTemplate, appHostFile.FullName)); 660Assert.False(AppHostLauncher.ResolveIsolated(command.Parse("start"), appHostFile, new TestFeatures())); 661Assert.True(AppHostLauncher.ResolveIsolated(command.Parse("start"), appHostFile, features)); 662Assert.True(AppHostLauncher.ResolveIsolated(command.Parse("start --isolated"), appHostFile, features)); 663Assert.False(AppHostLauncher.ResolveIsolated(command.Parse("start --isolated false"), appHostFile, features)); 664Assert.True(AppHostLauncher.ResolveIsolated(command.Parse("run"), appHostFile, features)); 665Assert.True(AppHostLauncher.ResolveIsolated(command.Parse("run --isolated"), appHostFile, features)); 666Assert.False(AppHostLauncher.ResolveIsolated(command.Parse("run --isolated false"), appHostFile, features)); 680Assert.Equal(expected, AppHostLauncher.GetExplicitIsolated(command.Parse(commandLine))); 695Assert.False(AppHostLauncher.ResolveIsolated(command.Parse("start"), appHostFile, features)); 696Assert.True(AppHostLauncher.ResolveIsolated(command.Parse("start --isolated"), appHostFile, features)); 697Assert.False(AppHostLauncher.ResolveIsolated(command.Parse("start --isolated false"), appHostFile, features)); 698Assert.False(AppHostLauncher.ResolveIsolated(command.Parse("run"), appHostFile, features)); 699Assert.True(AppHostLauncher.ResolveIsolated(command.Parse("run --isolated"), appHostFile, features)); 700Assert.False(AppHostLauncher.ResolveIsolated(command.Parse("run --isolated false"), appHostFile, features));
Commands\StopCommandTests.cs (47)
38var result = command.Parse("stop --help"); 53var result = command.Parse("stop myresource"); 198var exitCode = await command.Parse(commandLine).InvokeAsync().DefaultTimeout(); 217var result = provider.GetRequiredService<RootCommand>().Parse(commandLine); 245var result = provider.GetRequiredService<RootCommand>().Parse($"stop --pid {int.MaxValue - 1}"); 285.Parse($"stop --pid {int.MaxValue - 1}").InvokeAsync().DefaultTimeout(); 315var exitCode = await provider.GetRequiredService<RootCommand>().Parse(commandLine).InvokeAsync().DefaultTimeout(); 339var result = command.Parse("stop --apphost missing-directory"); 370var result = command.Parse($"stop --apphost \"{appHostDirectory.FullName}\""); 404var result = command.Parse("stop --all"); 440var result = command.Parse("stop --all"); 476var result = command.Parse("stop"); 529var result = command.Parse("stop"); 563var result = command.Parse($"stop --apphost \"{appHostFile.FullName}\""); 604var result = command.Parse("stop"); 643var result = command.Parse("stop"); 685var result = command.Parse("stop --all"); 726var result = command.Parse(commandLine); 762var result = command.Parse($"stop --force{volumesOption} --apphost \"{appHostFile.FullName}\""); 796var result = command.Parse($"stop --force --apphost \"{appHostFile.FullName}\""); 842var result = command.Parse("stop --force"); 880var result = command.Parse($"stop --force --apphost \"{appHostFile.FullName}\""); 914var result = command.Parse("stop --force"); 953var result = command.Parse("stop --force"); 990var result = command.Parse($"stop --force --apphost \"{appHostFile.FullName}\""); 1033var result = command.Parse($"stop --force{volumesOption} --apphost \"{appHostFile.FullName}\""); 1073var result = command.Parse($"stop --force --apphost \"{appHostFile.FullName}\""); 1112var result = command.Parse($"stop --force --apphost \"{appHostFile.FullName}\""); 1156var result = command.Parse($"stop --force --apphost \"{appHostFile.FullName}\""); 1198var result = command.Parse($"stop --force --apphost \"{appHostFile.FullName}\""); 1240var result = command.Parse($"stop --force --apphost \"{appHostFile.FullName}\""); 1278var result = command.Parse($"stop --force --apphost \"{appHostFile.FullName}\""); 1316var result = command.Parse($"stop --force --apphost \"{appHostFile.FullName}\""); 1350var result = command.Parse($"stop --force --apphost \"{appHostFile.FullName}\""); 1387var result = command.Parse("stop --force"); 1425var result = command.Parse("stop --force"); 1445var result = command.Parse("stop --force --all"); 1467var result = command.Parse("stop --volumes"); 1506var result = command.Parse("stop"); 1533var exitCode = await command.Parse("stop --all").InvokeAsync().DefaultTimeout(); 1570var exitCode = await command.Parse("stop --all --non-interactive").InvokeAsync().DefaultTimeout(); 1611var exitCode = await command.Parse("stop --all --wait --non-interactive").InvokeAsync().DefaultTimeout(); 1646var exitCode = await command.Parse(commandLine).InvokeAsync().DefaultTimeout(); 1699var exitCode = await command.Parse(commandLine).InvokeAsync().DefaultTimeout(); 1730var exitCode = await command.Parse(commandLine).InvokeAsync().DefaultTimeout(); 1760var exitCode = await command.Parse("stop --wait --non-interactive").InvokeAsync().DefaultTimeout(); 1796var exitCode = await command.Parse("stop --force --wait").InvokeAsync().DefaultTimeout();
Commands\TelemetryCommandTests.cs (3)
32var result = command.Parse("otel"); 297var result = command.Parse($"otel {otelCommand} --dashboard-url http://localhost:18888"); 383var result = command.Parse(
Commands\TelemetryFollowTests.cs (1)
276var parsed = command.Parse($"otel {commandName} --format Json{(follow ? " --follow" : "")}{(standalone ? " --dashboard-url http://localhost:18888" : "")}");
Commands\TelemetryLogsCommandTests.cs (16)
30var result = command.Parse("otel logs"); 48var result = command.Parse($"telemetry logs --limit {limitValue}"); 74var result = command.Parse("otel logs"); 109var result = command.Parse("otel logs"); 139var result = command.Parse("otel logs"); 219var result = command.Parse("otel logs --dashboard-url http://localhost:18888"); 271var result = command.Parse("otel logs --dashboard-url http://localhost:18888 --api-key my-secret-key"); 293var result = command.Parse("otel logs --dashboard-url http://localhost:18888 --apphost TestAppHost.csproj"); 359var result = command.Parse("otel logs --dashboard-url http://localhost:18888"); 402var result = command.Parse("otel logs --dashboard-url http://localhost:18888"); 441var result = command.Parse("otel logs --dashboard-url http://localhost:18888"); 471var result = command.Parse("otel logs --dashboard-url http://localhost:18888/login?t=sometoken"); 511var result = command.Parse("otel logs --dashboard-url http://localhost:18888"); 567var result = command.Parse("otel logs --dashboard-url http://localhost:18888/login?t=abc123"); 649var result = command.Parse("otel logs --format json --dashboard-url http://localhost:18888"); 715var result = command.Parse("otel logs --dashboard-url http://localhost:18888 --search timeout");
Commands\TelemetrySpansCommandTests.cs (12)
29var result = command.Parse("otel spans"); 47var result = command.Parse($"telemetry spans --limit {limitValue}"); 73var result = command.Parse("otel spans"); 104var result = command.Parse("otel spans"); 137var result = command.Parse("otel spans"); 221var result = command.Parse("otel spans --dashboard-url http://localhost:18888"); 245var result = command.Parse("otel spans --dashboard-url http://localhost:18888 --apphost TestAppHost.csproj"); 283var result = command.Parse("otel spans --dashboard-url http://localhost:18888"); 323var result = command.Parse("otel spans --dashboard-url http://localhost:18888"); 407var result = command.Parse("otel spans --format json --dashboard-url http://localhost:18888"); 478var result = command.Parse("otel spans --dashboard-url http://localhost:18888 --search \"GET /index\""); 525var result = command.Parse("otel spans --dashboard-url http://localhost:18888 --search \"duration:>=50.5\"");
Commands\TelemetryTracesCommandTests.cs (16)
32var result = command.Parse("otel traces"); 130var result = command.Parse("otel traces --format json -n 5"); 216var result = command.Parse("otel traces --format json -n 5 --dashboard-url http://dashboard.dev.localhost:18888"); 245var result = command.Parse($"telemetry traces --limit {limitValue}"); 271var result = command.Parse("otel traces"); 322var result = command.Parse("otel traces"); 369var result = command.Parse("otel traces"); 535var result = command.Parse("otel traces --trace-id abc1234567890def"); 702var result = command.Parse("otel traces --trace-id abc1234567890def"); 756var result = command.Parse("otel traces --dashboard-url http://localhost:18888"); 780var result = command.Parse("otel traces --dashboard-url http://localhost:18888 --apphost TestAppHost.csproj"); 818var result = command.Parse("otel traces --dashboard-url http://localhost:18888"); 901var result = command.Parse("otel traces --format json --dashboard-url http://localhost:18888"); 985var result = command.Parse("otel traces --trace-id abc1234567890def --format json --dashboard-url http://localhost:18888"); 1034var result = command.Parse("otel traces --dashboard-url http://localhost:18888 --search frontend"); 1081var result = command.Parse("otel traces --dashboard-url http://localhost:18888 --search \"duration:>=50.5\"");
Commands\TerminalCommandTests.cs (21)
26var result = command.Parse("terminal --help"); 42var result = command.Parse("terminal"); 56var result = command.Parse("terminal attach"); 70var result = command.Parse("terminal attach myresource"); 90var result = command.Parse("terminal attach myresource"); 110var result = command.Parse("terminal attach does-not-exist"); 135var result = command.Parse("terminal attach myresource"); 160var result = command.Parse("terminal attach myresource"); 178var result = provider.GetRequiredService<RootCommand>().Parse(arguments); 215var result = provider.GetRequiredService<RootCommand>().Parse( 256var result = command.Parse("terminal attach myresource"); 311var result = command.Parse("terminal attach myresource" + options); 329var result = command.Parse("terminal ps"); 352var result = command.Parse("terminal ps"); 376var result = command.Parse("terminal ps"); 423var result = command.Parse("terminal ps"); 458var result = command.Parse("terminal ps --format json"); 581var result = command.Parse("terminal ps --format json --verbose"); 692var result = command.Parse("terminal ps --format json"); 764var result = command.Parse("terminal ps --format json"); 804var result = command.Parse("terminal ps --format json");
Commands\TerminalCommandViewerOptionTests.cs (3)
26var result = command.Parse("terminal attach --help"); 54var result = command.Parse("terminal attach myresource"); 69var result = command.Parse("terminal attach myresource --viewer");
Commands\TerminalTapePlayCommandTests.cs (14)
32var result = provider.GetRequiredService<RootCommand>().Parse(arguments); 44var result = provider.GetRequiredService<RootCommand>().Parse("terminal tape play shell --tape-file probe.tape"); 104var result = provider.GetRequiredService<RootCommand>().Parse("terminal tape play shell --tape-file probe.tape"); 177var result = provider.GetRequiredService<RootCommand>().Parse( 244var result = provider.GetRequiredService<RootCommand>().Parse( 290var result = provider.GetRequiredService<RootCommand>().Parse( 344var result = provider.GetRequiredService<RootCommand>().Parse( 451var invalid = command.Parse("terminal tape play shell --tape-file play.tape"); 458var valid = command.Parse("terminal tape play shell --tape-file play.tape"); 476var result = provider.GetRequiredService<RootCommand>().Parse("terminal tape play shell --tape-file wait.tape"); 494var result = provider.GetRequiredService<RootCommand>().Parse("terminal tape play shell --tape-file wait.tape --timeout 5"); 513var result = provider.GetRequiredService<RootCommand>().Parse("terminal tape play shell --tape-file wait.tape"); 532var result = provider.GetRequiredService<RootCommand>().Parse("terminal tape play shell --tape-file wait.tape"); 550var result = provider.GetRequiredService<RootCommand>().Parse("terminal tape play shell --tape-file probe.tape");
Commands\TestCommandTests.cs (6)
435await provider.GetRequiredService<RootCommand>().Parse($"test {options}").InvokeAsync().DefaultTimeout()); 899Assert.Equal(0, await provider.GetRequiredService<RootCommand>().Parse("test --help").InvokeAsync().DefaultTimeout()); 1129var execution = provider.GetRequiredService<RootCommand>().Parse("test") 1382var result = await provider.GetRequiredService<RootCommand>().Parse("test --timeout-seconds 10") 1423var execution = provider.GetRequiredService<RootCommand>().Parse("test --timeout-seconds 1 --format json") 1474var execution = provider.GetRequiredService<RootCommand>().Parse("test --timeout-seconds 1")
Commands\TrayCommandTests.cs (22)
38.Parse($"tray {action} --non-interactive --nologo").InvokeAsync().DefaultTimeout()); 64.Parse("tray start --non-interactive --nologo").InvokeAsync().DefaultTimeout()); 82.Parse("tray start --non-interactive --nologo").InvokeAsync().DefaultTimeout()); 115.Parse("tray start --non-interactive --nologo").InvokeAsync().DefaultTimeout()); 138.Parse("tray start --non-interactive --nologo").InvokeAsync().DefaultTimeout()); 152.Parse("tray start --non-interactive --nologo").InvokeAsync().DefaultTimeout()); 168.Parse("tray start --non-interactive --nologo").InvokeAsync().DefaultTimeout()); 213.Parse($"tray {action} --non-interactive --nologo").InvokeAsync(); 254Assert.Equal(CliExitCodes.Success, await command.Parse("tray start --non-interactive --nologo").InvokeAsync().DefaultTimeout()); 294.Parse($"tray {action}").InvokeAsync().DefaultTimeout()); 328.Parse("tray start").InvokeAsync().DefaultTimeout()); 368.Parse($"tray {action}").InvokeAsync().DefaultTimeout()); 400.Parse($"tray {action}").InvokeAsync().DefaultTimeout()); 430.Parse($"tray {action}").InvokeAsync().DefaultTimeout()); 468.Parse($"tray {action}").InvokeAsync(cancellationToken: cancellation.Token); 521.Parse("tray start").InvokeAsync(cancellationToken: cancellation.Token); 559.Parse($"tray {action}").InvokeAsync(cancellationToken: cancellation.Token).DefaultTimeout(); 574var result = provider.GetRequiredService<RootCommand>().Parse(arguments); 595Assert.Equal(CliExitCodes.Success, await command.Parse("tray --help").InvokeAsync().DefaultTimeout()); 658.Parse($"tray {action}").InvokeAsync().DefaultTimeout()); 679.Parse(start ? "tray start" : "tray stop").InvokeAsync().DefaultTimeout()); 723.Parse($"tray {action}").InvokeAsync().DefaultTimeout());
Commands\TrayProtocolCommandTests.cs (6)
38var result = command.Parse($"ps {outputOption} --follow --format json --non-interactive --nologo"); 72.Parse("ps --output snapshot --follow --format json --non-interactive --nologo") 95var result = provider.GetRequiredService<RootCommand>().Parse(arguments); 118var exitCode = await provider.GetRequiredService<RootCommand>().Parse(arguments).InvokeAsync().DefaultTimeout(); 240var result = provider.GetRequiredService<RootCommand>().Parse($"stop {options} --apphost \"{path}\""); 288var result = provider.GetRequiredService<RootCommand>().Parse(
Commands\UpdateCommandRepositoryToolsTests.cs (8)
60.Parse("update --channel stable --dry-run --non-interactive").InvokeAsync().DefaultTimeout(); 107.Parse("update --channel stable --yes --non-interactive").InvokeAsync().DefaultTimeout(); 204.Parse("update --channel stable --yes --non-interactive").InvokeAsync().DefaultTimeout(); 255.Parse("update --channel stable --yes --non-interactive").InvokeAsync().DefaultTimeout(); 320.Parse("update --channel stable").InvokeAsync().DefaultTimeout(); 384.Parse("update --self --yes --non-interactive").InvokeAsync().DefaultTimeout(); 423.Parse("update --channel stable --yes --non-interactive").InvokeAsync().DefaultTimeout(); 584.Parse(dryRun ? "update --channel daily --dry-run --non-interactive" : "update --channel daily")
Commands\UpdateCommandTests.cs (55)
40var result = command.Parse("update --help"); 73var result = command.Parse(commandLine); 125var result = command.Parse($"update --apphost {appHostProjectFile.FullName}"); 174var result = command.Parse($"update --apphost AppHost.csproj"); 287var result = command.Parse("update"); 364var result = command.Parse("update --apphost AppHost.csproj --channel stable"); 414var exitCode = await command.Parse("update --apphost apphost.ts --channel stable --migrate --yes") 478var result = command.Parse("update --apphost apphost.ts"); 537var result = command.Parse("update --apphost apphost.ts"); 592var result = command.Parse("update --apphost apphost.ts"); 669var result = command.Parse("update --apphost AppHost.csproj --channel stable"); 748var result = command.Parse("update --apphost AppHost.csproj --channel stable"); 825var result = command.Parse("update --apphost AppHost.csproj --channel stable"); 868var result = command.Parse("update --apphost AppHost.csproj"); 911var result = command.Parse("update --apphost AppHost.csproj --yes"); 985var result = command.Parse("update --apphost AppHost.csproj --channel pr-12658"); 1058var result = command.Parse("update --apphost AppHost.csproj --channel pr-12658"); 1092var result = command.Parse("update --apphost AppHost.csproj --migrate --yes"); 1128var result = command.Parse("update --apphost AppHost.csproj --migrate"); 1155var result = command.Parse("update --apphost AppHost.csproj --migrate --yes"); 1185var result = command.Parse("update --apphost AppHost.csproj --migrate --yes"); 1269var result = command.Parse("update --self"); 1301var result = command.Parse("update --self"); 1336var result = command.Parse("update --self"); 1460var result = command.Parse(commandLine); 1491var result = command.Parse("update --self"); 1529var result = command.Parse("update"); 1573var result = command.Parse("update --self --channel daily"); 1600var result = command.Parse($"update --self --channel {requestedChannel}"); 1636var result = command.Parse("update --self --channel staging"); 1680var result = command.Parse("update --self --channel staging"); 1725var result = command.Parse("update --self --quality daily"); 1766var result = command.Parse("update --self --channel daily"); 1829var result = command.Parse("update --channel daily"); 1894var result = command.Parse("update --quality daily"); 1948var result = command.Parse("update --quality invalid"); 2015var result = command.Parse("update --channel stable --quality daily"); 2079var result = command.Parse("update"); 2141var result = command.Parse("update"); 2299var result = command.Parse("update"); 2366var result = command.Parse(channelFromConfig ? "update" : "update --channel staging"); 2601var result = command.Parse("update"); 2675var result = command.Parse("update"); 2760var result = command.Parse("update"); 2816var result = command.Parse($"update --apphost \"{appHostFile.FullName}\""); 3003var result = provider.GetRequiredService<RootCommand>().Parse(arguments); 3301var result = command.Parse(updateArgs); 3339var result = command.Parse("update --self"); 3380var result = command.Parse("update --self"); 3425var result = command.Parse("update --self"); 3470var result = command.Parse("update --self"); 3504var result = command.Parse("update --self --channel stable"); 3570var result = command.Parse("update --yes --channel stable --non-interactive"); 3690var result = command.Parse(updateArgs); 3856var result = command.Parse(commandLine);
Commands\WaitCommandTests.cs (15)
26var result = command.Parse("wait --help"); 41var result = command.Parse("wait"); 56var result = command.Parse("wait myresource --help"); 70var result = command.Parse("wait myresource --apphost /path/to/project.csproj --help"); 84var result = command.Parse("wait myresource --status up --help"); 98var result = command.Parse("wait myresource --timeout 60 --help"); 115var result = command.Parse($"wait myresource --status {status} --help"); 132var result = command.Parse($"wait myresource --status {status} --help"); 164var result = command.Parse("wait nonexistent --timeout 5"); 206var result = command.Parse("wait myapp --status up --timeout 5"); 242var result = command.Parse("wait mydb --status healthy --timeout 5"); 274var result = command.Parse("wait mydb --status healthy --timeout 2"); 310var result = command.Parse("wait worker --status down --timeout 5"); 342var result = command.Parse("wait myapp --status up --timeout 5"); 384var result = command.Parse("wait myapp --status down --timeout 5");
Configuration\ConfigSourceServiceTests.cs (1)
2244return command.Parse(accepted switch
Interaction\ConsoleInteractionServiceTests.cs (27)
254var source = await service.ResolveAndAcquireConfigSourceAsync(command.Parse("--use-config-source false"), ConfigSourceStrings.NewUseSourcePrompt, CancellationToken.None); 292var source = await service.ResolveAndAcquireConfigSourceAsync(command.Parse("--use-config-source"), ConfigSourceStrings.NewUseSourcePrompt, CancellationToken.None); 329var source = await service.ResolveAndAcquireConfigSourceAsync(command.Parse("--use-config-source false"), ConfigSourceStrings.NewUseSourcePrompt, CancellationToken.None); 591var binding = PromptBinding.Create(new RootCommand { option }.Parse("--template second"), option); 2071var parseResult = command.Parse("--value bad-value"); 2154var parseResult = command.Parse(""); 2184var parseResult = command.Parse(""); 2201var parseResult = command.Parse(""); 2283var parseResult = command.Parse(""); 2295var parseResult = command.Parse(""); 2311var parseResult = command.Parse(""); 2341var parseResult = command.Parse("--choice invalid"); 2363var parseResult = command.Parse("--items invalid"); 2390var parseResult = command.Parse("--items invalid"); 2416var parseResult = command.Parse("--items invalid"); 2448var parseResult = command.Parse("--items invalid"); 2474var parseResult = command.Parse(""); 2492var parseResult = command.Parse("--choice option1"); 2510var parseResult = command.Parse("--items alpha,gamma"); 2525var parseResult = command.Parse("--yes"); 2537var parseResult = command.Parse("--include"); 2599var parseResult = command.Parse(""); 2616var parseResult = command.Parse("--choice option1"); 2635var parseResult = command.Parse("--items alpha,gamma"); 2654var parseResult = command.Parse(""); 2673var parseResult = command.Parse(""); 2690var binding = PromptBinding.Create(command.Parse(""), option, "copilot,claude,opencode");
NuGet\NuGetPackagePrefetcherTests.cs (4)
57command.SelectForExecution(command.Parse("ls")); 77command.SelectForExecution(command.Parse("ls")); 296var parseResult = newCommand.Parse(commandLine); 517command.SelectForExecution(parseResult ?? command.Parse(commandLine));
Templating\JavaStarterScaffoldTests.cs (1)
147var parseResult = newCommand.Parse(
dotnet-aot (1)
parent\dotnet\Parser.cs (1)
473public static ParseResult Parse(string commandLineUnsplit) => RootCommand.Parse(commandLineUnsplit, ParserConfiguration);
dotnet-watch (1)
CommandLine\CommandLineOptions.cs (1)
137.Where(arg => !msbuildCommandDefinition.Parse(arg).HasOption(msbuildCommandDefinition.TargetOption))
Infrastructure.Tests (1)
TemplateManifest\TemplateManifestCommandTests.cs (1)
94var exitCode = await command.Parse("--help").InvokeAsync(new InvocationConfiguration { Output = help, Error = errors });
Microsoft.TemplateEngine.Cli (1)
Commands\create\InstantiateCommand.TabCompletion.cs (1)
67ParseResult parseResult = parser.Parse(context.CommandLineText, ParserFactory.ParserConfiguration);
System.CommandLine (1)
Completions\CompletionAction.cs (1)
29var completionParseResult = parseResult.RootCommandResult.Command.Parse(commandLineToComplete, parseResult.Configuration);