4 overrides of GetValue
System.Text.Json (4)
System\Text\Json\Nodes\JsonValueOfJsonPrimitive.cs (3)
56public override T GetValue<T>() 140public override T GetValue<T>() 187public override T GetValue<T>()
System\Text\Json\Nodes\JsonValueOfT.cs (1)
23public override T GetValue<T>()
1040 references to GetValue
aspire (23)
Agents\DeprecatedMcpCommandScanner.cs (5)
137args[0]?.GetValue<string>() == "mcp" && 138args[1]?.GetValue<string>() == "start") 169command[0]?.GetValue<string>() == "aspire" && 170command[1]?.GetValue<string>() == "mcp" && 171command[2]?.GetValue<string>() == "start")
Commands\InitCommand.cs (6)
739if (!TryParseHostPort(https["applicationUrl"]?.GetValue<string>(), "https", out var dashboardHttps) 740|| !TryParseHostPort(http["applicationUrl"]?.GetValue<string>(), "http", out var dashboardHttp) 741|| !TryParseHostPort(httpsEnv[KnownConfigNames.DashboardOtlpGrpcEndpointUrl]?.GetValue<string>(), "https", out var otlpHttps) 742|| !TryParseHostPort(httpEnv[KnownConfigNames.DashboardOtlpGrpcEndpointUrl]?.GetValue<string>(), "http", out var otlpHttp) 743|| !TryParseHostPort(httpsEnv[KnownConfigNames.ResourceServiceEndpointUrl]?.GetValue<string>(), "https", out var resourceServiceHttps) 744|| !TryParseHostPort(httpEnv[KnownConfigNames.ResourceServiceEndpointUrl]?.GetValue<string>(), "http", out var resourceServiceHttp))
Migrations\TypeScriptAppHostMigration.cs (3)
208var currentPath = pathValue.GetValue<string>(); 260rewritten.Add((JsonNode?)JsonValue.Create(LegacyTypeScriptAppHost.RewriteTsConfigIncludeEntry(value.GetValue<string>()))); 299var current = value.GetValue<string>();
Npm\SigstoreNpmProvenanceChecker.cs (1)
220predicateType = predicateTypeValue.GetValue<string>();
Projects\RepositoryToolUpdater.cs (3)
283var isRoot = !isNpm && content["isRoot"]?.GetValue<bool>() == true; 291references.Add(new(dependencies, NpmPackageId, version.GetValue<string>())); 301references.Add(new(properties, "version", properties["version"]?.GetValue<string>() ?? throw new JsonException("Missing tool version.")));
Utils\EnvironmentChecker\DeprecatedAgentConfigCheck.cs (5)
124args[0]?.GetValue<string>() == "mcp" && 125args[1]?.GetValue<string>() == "start") 156command[0]?.GetValue<string>() == "aspire" && 157command[1]?.GetValue<string>() == "mcp" && 158command[2]?.GetValue<string>() == "start")
Aspire.Cli.EndToEnd.Tests (24)
CSharpInitTests.cs (3)
128Assert.Equal("apphost.cs", config["appHost"]?["path"]?.GetValue<string>()); 201var path = appHostNode!["path"]?.GetValue<string>(); 204var language = appHostNode["language"]?.GetValue<string>();
SelfUpdateChannelPersistenceTests.cs (1)
113Assert.Equal("staging", updatedConfig["channel"]?.GetValue<string>());
SingleFileAppHostInitDotnetRunTests.cs (4)
91Assert.Equal("Project", httpsProfile["commandName"]?.GetValue<string>()); 92Assert.False(string.IsNullOrWhiteSpace(httpsProfile["applicationUrl"]?.GetValue<string>())); 95Assert.False(string.IsNullOrWhiteSpace(httpsEnv["ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL"]?.GetValue<string>())); 96Assert.False(string.IsNullOrWhiteSpace(httpsEnv["ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL"]?.GetValue<string>()));
TypeScriptMigrateAppHostTests.cs (1)
216var includes = tsconfig["include"]!.AsArray().Select(n => n!.GetValue<string>()).ToArray();
TypeScriptPolyglotTests.cs (15)
450originalDevScript = scripts["dev"]?.GetValue<string>(); 451originalBuildScript = scripts["build"]?.GetValue<string>(); 452originalPreviewScript = scripts["preview"]?.GetValue<string>(); 453originalPackageType = packageJson["type"]?.GetValue<string>(); 482Assert.Equal(originalDevScript, scripts["dev"]?.GetValue<string>()); 483Assert.Equal(originalBuildScript, scripts["build"]?.GetValue<string>()); 484Assert.Equal(originalPreviewScript, scripts["preview"]?.GetValue<string>()); 485Assert.Equal("custom-apphost-start", scripts["aspire:start"]?.GetValue<string>()); 486Assert.Equal("npm --prefix aspire-apphost run aspire:build", scripts["aspire:build"]?.GetValue<string>()); 487Assert.Equal("npm --prefix aspire-apphost run aspire:dev", scripts["aspire:dev"]?.GetValue<string>()); 488Assert.Equal(originalPackageType, packageJson["type"]?.GetValue<string>()); 508Assert.Equal("module", appHostPackageJson["type"]?.GetValue<string>()); 509Assert.Equal("aspire-apphost", appHostPackageJson["name"]?.GetValue<string>()); 510Assert.Equal("aspire run", appHostScripts["aspire:start"]?.GetValue<string>()); 522Assert.Equal("aspire-apphost/apphost.mts", appHost["path"]?.GetValue<string>());
Aspire.Cli.Tests (237)
Agents\CopilotAgentEnvironmentScannerTests.cs (6)
68Assert.Equal("local", aspireServer["type"]?.GetValue<string>()); 69Assert.Equal("aspire", aspireServer["command"]?.GetValue<string>()); 74Assert.Equal("agent", args[0]?.GetValue<string>()); 75Assert.Equal("mcp", args[1]?.GetValue<string>()); 81Assert.Equal("${DOTNET_ROOT}", env["DOTNET_ROOT"]?.GetValue<string>()); 87Assert.Equal("*", tools[0]?.GetValue<string>());
Agents\VsCodeAgentEnvironmentScannerTests.cs (6)
152Assert.Equal("stdio", aspireServer["type"]?.GetValue<string>()); 153Assert.Equal("aspire", aspireServer["command"]?.GetValue<string>()); 158Assert.Equal("agent", args[0]?.GetValue<string>()); 159Assert.Equal("mcp", args[1]?.GetValue<string>()); 243Assert.Equal("stdio", aspireServer["type"]?.GetValue<string>()); 244Assert.Equal("aspire", aspireServer["command"]?.GetValue<string>());
Backchannel\ResourceSnapshotMapperTests.cs (3)
31Assert.Equal(12345, pid.GetValue<int>()); 354value => Assert.Equal("one", value?.GetValue<string>()), 355value => Assert.Equal("two", value?.GetValue<string>()));
Commands\ConfigCommandTests.cs (1)
812Assert.Equal("true", feature.Value?.GetValue<string>());
Commands\InitCommandTests.cs (32)
226Assert.Equal("apphost.cs", config["appHost"]!["path"]!.GetValue<string>()); 269Assert.Equal("apphost.cs", appHost["path"]!.GetValue<string>()); 299Assert.Equal("Project", https["commandName"]!.GetValue<string>()); 300Assert.True(https["dotnetRunMessages"]!.GetValue<bool>()); 301var httpsUrls = https["applicationUrl"]!.GetValue<string>(); 304Assert.Equal("Development", httpsEnv[KnownAspNetCoreConfigNames.Environment]!.GetValue<string>()); 305Assert.Equal("Development", httpsEnv[KnownAspNetCoreConfigNames.DotNetEnvironment]!.GetValue<string>()); 306Assert.StartsWith("https://localhost:", httpsEnv["ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL"]!.GetValue<string>()); 307Assert.StartsWith("https://localhost:", httpsEnv["ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL"]!.GetValue<string>()); 310Assert.Equal("Project", http["commandName"]!.GetValue<string>()); 312Assert.Equal("Development", httpEnv[KnownAspNetCoreConfigNames.Environment]!.GetValue<string>()); 313Assert.StartsWith("http://localhost:", httpEnv["ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL"]!.GetValue<string>()); 314Assert.StartsWith("http://localhost:", httpEnv["ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL"]!.GetValue<string>()); 315Assert.Equal("true", httpEnv["ASPIRE_ALLOW_UNSECURED_TRANSPORT"]!.GetValue<string>()); 322aspireProfiles["https"]!["applicationUrl"]!.GetValue<string>(), 325aspireProfiles["http"]!["applicationUrl"]!.GetValue<string>(), 326http["applicationUrl"]!.GetValue<string>()); 378Assert.Equal("https://localhost:18000;http://localhost:18001", https["applicationUrl"]!.GetValue<string>()); 379Assert.Equal("https://localhost:18002", https["environmentVariables"]!["ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL"]!.GetValue<string>()); 380Assert.Equal("https://localhost:18003", https["environmentVariables"]!["ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL"]!.GetValue<string>()); 381Assert.Equal("http://localhost:18001", http["applicationUrl"]!.GetValue<string>()); 382Assert.Equal("http://localhost:18005", http["environmentVariables"]!["ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL"]!.GetValue<string>()); 383Assert.Equal("http://localhost:18006", http["environmentVariables"]!["ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL"]!.GetValue<string>()); 430Assert.Equal("https://localhost:18000", preservedHttps["applicationUrl"]!.GetValue<string>()); 432Assert.Equal("custom-value", preservedEnv["MY_CUSTOM_VAR"]!.GetValue<string>()); 567Assert.Equal("apphost.mts", appHost["path"]!.GetValue<string>()); 568Assert.Equal("typescript/nodejs", appHost["language"]!.GetValue<string>()); 868Assert.Equal("apphost.cs", merged["appHost"]!.AsObject()["path"]!.GetValue<string>()); 870Assert.Equal("stable", merged["channel"]!.GetValue<string>()); 871Assert.True(merged["features"]!.AsObject()["polyglotSupportEnabled"]!.GetValue<bool>()); 1321Assert.Equal(contextChannel, config["channel"]!.GetValue<string>()); 1354Assert.Equal("pr-99999", config["channel"]!.GetValue<string>());
Commands\OperatingSystemCheckTests.cs (8)
28Assert.Equal("Linux", result.Metadata["osType"]!.GetValue<string>()); 29Assert.Equal("Linux Ubuntu", result.Metadata["displayName"]!.GetValue<string>()); 30Assert.Equal("24.04", result.Metadata["version"]!.GetValue<string>()); 31Assert.Equal("Ubuntu 24.04.2 LTS", result.Metadata["description"]!.GetValue<string>()); 50Assert.Equal("unknown", result.Metadata["osType"]!.GetValue<string>()); 51Assert.Equal("unknown", result.Metadata["displayName"]!.GetValue<string>()); 52Assert.Equal("1.2.3", result.Metadata["version"]!.GetValue<string>()); 53Assert.Equal("Unknown OS description", result.Metadata["description"]!.GetValue<string>());
Commands\ResourceCommandHelperTests.cs (1)
143Assert.Equal("#submit", connection.ExecuteResourceCommandArguments["selector"]!.GetValue<string>());
Commands\ResourceCommandTests.cs (5)
1808Assert.Equal("browser", argumentInputs[0]!["name"]!.GetValue<string>()); 1809Assert.Equal("Chrome", argumentInputs[0]!["value"]!.GetValue<string>()); 1810Assert.Equal("profile", argumentInputs[1]!["name"]!.GetValue<string>()); 1811Assert.Equal("Default", argumentInputs[1]!["options"]!["Default"]!.GetValue<string>()); 2337Assert.Equal(value, actualElement.GetValue<string>());
Commands\TelemetryTracesCommandTests.cs (3)
141Assert.Equal("abc1234567890def", item["traceId"]!.GetValue<string>()); 143var dashboardUrl = item["dashboardUrl"]!.GetValue<string>(); 229var dashboardUrl = items[0]!["dashboardUrl"]!.GetValue<string>();
Commands\UpdateCommandRepositoryToolsTests.cs (10)
54Assert.Equal("^13.4.0", packageJson["devDependencies"]![RepositoryToolUpdater.NpmPackageId]!.GetValue<string>()); 67Assert.Equal("13.5.4", JsonNode.Parse(await File.ReadAllTextAsync(dotnetManifest))!["tools"]!["aspire.cli"]!["version"]!.GetValue<string>()); 68Assert.Equal("^13.5.4", JsonNode.Parse(await File.ReadAllTextAsync(npmManifest))!["devDependencies"]![RepositoryToolUpdater.NpmPackageId]!.GetValue<string>()); 174Assert.Equal("99.0.0", JsonNode.Parse(await File.ReadAllTextAsync(dotnetManifest))!["tools"]!["aspire.cli"]!["version"]!.GetValue<string>()); 175Assert.Equal("^99.0.0", JsonNode.Parse(await File.ReadAllTextAsync(npmManifest))!["devDependencies"]![RepositoryToolUpdater.NpmPackageId]!.GetValue<string>()); 321Assert.Equal("13.5.4", JsonNode.Parse(await File.ReadAllTextAsync(selectedManifest))!["tools"]!["aspire.cli"]!["version"]!.GetValue<string>()); 539Assert.Equal(targetVersion, JsonNode.Parse(File.ReadAllText(dotnetManifest))!["tools"]!["aspire.cli"]!["version"]!.GetValue<string>()); 540Assert.Equal("^" + targetVersion, JsonNode.Parse(File.ReadAllText(npmManifest))!["devDependencies"]![RepositoryToolUpdater.NpmPackageId]!.GetValue<string>()); 546Assert.Equal(targetVersion, config["sdk"]!["version"]!.GetValue<string>()); 547Assert.Equal("daily", config["channel"]!.GetValue<string>());
Commands\VsCodeExtensionCheckTests.cs (6)
51Assert.True(result.Metadata["vsCodeInstalled"]!.GetValue<bool>()); 52Assert.False(result.Metadata["extensionInstalled"]!.GetValue<bool>()); 53Assert.Equal(VsCodeExtensionCheck.ExtensionId, result.Metadata["extensionId"]!.GetValue<string>()); 80Assert.True(result.Metadata["vsCodeInstalled"]!.GetValue<bool>()); 81Assert.True(result.Metadata["extensionInstalled"]!.GetValue<bool>()); 82Assert.Equal(VsCodeExtensionCheck.ExtensionId, result.Metadata["extensionId"]!.GetValue<string>());
Configuration\ConfigurationServiceTests.cs (3)
340Assert.Equal("true", node.GetValue<string>()); 363Assert.Equal("true", node.GetValue<string>()); 383Assert.Equal("daily", node.GetValue<string>());
Mcp\ExecuteResourceCommandToolTests.cs (4)
92Assert.Equal("#submit", connection.ExecuteResourceCommandArguments["selector"]!.GetValue<string>()); 113Assert.Equal("3", connection.ExecuteResourceCommandArguments["count"]!.GetValue<string>()); 114Assert.Equal("true", connection.ExecuteResourceCommandArguments["urgent"]!.GetValue<string>()); 115Assert.Equal("1.5", connection.ExecuteResourceCommandArguments["ratio"]!.GetValue<string>());
Mcp\ListStructuredLogsToolTests.cs (9)
311Assert.Equal("api-service-instance-1", firstLog["resourceName"]?.GetValue<string>()); 312Assert.Equal(42, firstLog["logId"]?.GetValue<long>()); 319Assert.Equal("http://localhost:18888/structuredlogs?logEntryId=42", firstLog["dashboardUrl"]?.GetValue<string>()); 324Assert.Equal("api-service-instance-2", secondLog["resourceName"]?.GetValue<string>()); 325Assert.Equal(43, secondLog["logId"]?.GetValue<long>()); 330Assert.Equal("http://localhost:18888/structuredlogs?logEntryId=43", secondLog["dashboardUrl"]?.GetValue<string>()); 335Assert.Equal("worker-service", thirdLog["resourceName"]?.GetValue<string>()); 336Assert.Equal(44, thirdLog["logId"]?.GetValue<long>()); 338Assert.Equal("http://localhost:18888/structuredlogs?logEntryId=44", thirdLog["dashboardUrl"]?.GetValue<string>());
Mcp\ListTracesToolTests.cs (11)
236Assert.Equal("abc123def456789012345678901234567890", firstTrace["traceId"]?.GetValue<string>()); 244Assert.Equal("http://localhost:18888/traces/detail/abc123def456789012345678901234567890", firstTrace["dashboardUrl"]?.GetValue<string>()); 247var serverSpan = spans.FirstOrDefault(s => s?["kind"]?.GetValue<string>() == "Server")?.AsObject(); 249Assert.Equal("api-service-instance-1", serverSpan["source"]?.GetValue<string>()); 253var clientSpan = spans.FirstOrDefault(s => s?["kind"]?.GetValue<string>() == "Client")?.AsObject(); 255Assert.Equal("api-service-instance-2", clientSpan["source"]?.GetValue<string>()); 256Assert.Equal("catalog-service", clientSpan["destination"]?.GetValue<string>()); 261Assert.Equal("xyz789abc123456789012345678901234567890", secondTrace["traceId"]?.GetValue<string>()); 263Assert.Equal("http://localhost:18888/traces/detail/xyz789abc123456789012345678901234567890", secondTrace["dashboardUrl"]?.GetValue<string>()); 273Assert.Equal("Internal", internalSpan["kind"]?.GetValue<string>()); 274Assert.Equal("worker-service", internalSpan["source"]?.GetValue<string>());
Migrations\TypeScriptAppHostMigrationTests.cs (7)
62Assert.Equal(KnownLanguageId.TypeScript, descriptor.Metadata["language"]!.GetValue<string>()); 63Assert.Equal(appHostPath, descriptor.Metadata["appHostPath"]!.GetValue<string>()); 113Assert.Equal(appHostPath, descriptor.Metadata!["appHostPath"]!.GetValue<string>()); 190Assert.Equal("apphost.mts", config["appHost"]!["path"]!.GetValue<string>()); 193var includes = tsconfig["include"]!.AsArray().Select(n => n!.GetValue<string>()).ToArray(); 198Assert.Equal("tsc -p tsconfig.apphost.json", scripts["aspire:build"]!.GetValue<string>()); 199Assert.Equal("eslint apphost.mts", scripts["aspire:lint"]!.GetValue<string>());
Scaffolding\PackageJsonMergerTests.cs (97)
22ParseJson(mergedJson)["scripts"]![scriptName]?.GetValue<string>()!; 28ParseJson(mergedJson)[section]?[packageName]?.GetValue<string>(); 57Assert.Equal("vite", scripts["dev"]?.GetValue<string>()); 58Assert.Equal("vite build", scripts["build"]?.GetValue<string>()); 61Assert.Equal("aspire run", scripts["aspire:dev"]?.GetValue<string>()); 62Assert.Equal("tsc -p tsconfig.apphost.json", scripts["aspire:build"]?.GetValue<string>()); 65Assert.Equal("eslint apphost.ts", scripts["lint"]?.GetValue<string>()); 94Assert.Equal("jest", scripts["test"]?.GetValue<string>()); 97Assert.Equal("aspire run", scripts["dev"]?.GetValue<string>()); 98Assert.Equal("tsc -p tsconfig.apphost.json", scripts["build"]?.GetValue<string>()); 99Assert.Equal("eslint apphost.ts", scripts["lint"]?.GetValue<string>()); 131Assert.Equal("vite", scripts["dev"]?.GetValue<string>()); 132Assert.Equal("vite build", scripts["build"]?.GetValue<string>()); 135Assert.Equal("custom start", scripts["aspire:start"]?.GetValue<string>()); 136Assert.Equal("tsc -p tsconfig.apphost.json", scripts["aspire:build"]?.GetValue<string>()); 137Assert.Equal("tsc --watch -p tsconfig.apphost.json", scripts["aspire:dev"]?.GetValue<string>()); 138Assert.Equal("eslint apphost.ts", scripts["aspire:lint"]?.GetValue<string>()); 169Assert.Equal("npm run aspire:start", scripts["start"]?.GetValue<string>()); 170Assert.Equal("npm run aspire:lint", scripts["lint"]?.GetValue<string>()); 173Assert.Equal("vite", scripts["dev"]?.GetValue<string>()); 174Assert.Equal("vite build", scripts["build"]?.GetValue<string>()); 201Assert.Equal("yarn run aspire:start", scripts["start"]?.GetValue<string>()); 226Assert.Equal("deno task aspire:start", scripts["start"]?.GetValue<string>()); 227Assert.Equal("deno task aspire:dev", scripts["dev"]?.GetValue<string>()); 259Assert.Equal("node server.js", scripts["start"]?.GetValue<string>()); 260Assert.Equal("prettier --check .", scripts["lint"]?.GetValue<string>()); 261Assert.Equal("vite", scripts["dev"]?.GetValue<string>()); 262Assert.Equal("vite build", scripts["build"]?.GetValue<string>()); 265Assert.Equal("aspire run", scripts["aspire:start"]?.GetValue<string>()); 266Assert.Equal("eslint apphost.ts", scripts["aspire:lint"]?.GetValue<string>()); 267Assert.Equal("tsc -p tsconfig.apphost.json", scripts["aspire:build"]?.GetValue<string>()); 271Assert.Equal("node server.js", scripts["start"]?.GetValue<string>()); 272Assert.Equal("prettier --check .", scripts["lint"]?.GetValue<string>()); 302Assert.Equal("vite", scripts["dev"]?.GetValue<string>()); 303Assert.Equal("jest", scripts["test"]?.GetValue<string>()); 306Assert.Equal("aspire run", scripts["aspire:dev"]?.GetValue<string>()); 309Assert.Equal("tsc -p tsconfig.apphost.json", scripts["build"]?.GetValue<string>()); 312Assert.Equal("eslint apphost.ts", scripts["aspire:lint"]?.GetValue<string>()); 313Assert.Equal("npm run aspire:lint", scripts["lint"]?.GetValue<string>()); 395Assert.Equal("my-existing-app", json["name"]?.GetValue<string>()); 396Assert.Equal("3.0.0", json["version"]?.GetValue<string>()); 397Assert.Equal("My cool app", json["description"]?.GetValue<string>()); 398Assert.True(json["private"]?.GetValue<bool>()); 399Assert.Equal("module", json["type"]?.GetValue<string>()); 402Assert.Equal("^20.19.0 || ^22.13.0 || >=24", json["engines"]?["node"]?.GetValue<string>()); 470Assert.Equal("my-app", json["name"]?.GetValue<string>()); 544Assert.Equal("aspire run", scripts["dev"]?.GetValue<string>()); 545Assert.Equal("tsc -p tsconfig.apphost.json", scripts["build"]?.GetValue<string>()); 546Assert.Equal("eslint apphost.ts", scripts["lint"]?.GetValue<string>()); 602Assert.Equal("vite-project", json["name"]?.GetValue<string>()); 603Assert.Equal("1.0.0", json["version"]?.GetValue<string>()); 606Assert.Equal("vite", scripts["dev"]?.GetValue<string>()); 607Assert.Equal("vite build", scripts["build"]?.GetValue<string>()); 608Assert.Equal("eslint . --ext .ts,.tsx", scripts["lint"]?.GetValue<string>()); 609Assert.Equal("vite preview", scripts["preview"]?.GetValue<string>()); 612Assert.Equal("aspire run", scripts["aspire:dev"]?.GetValue<string>()); 613Assert.Equal("tsc -p tsconfig.apphost.json", scripts["aspire:build"]?.GetValue<string>()); 614Assert.Equal("eslint apphost.ts", scripts["aspire:lint"]?.GetValue<string>()); 617Assert.Equal("tsc --watch -p tsconfig.apphost.json", scripts["watch"]?.GetValue<string>()); 660Assert.Equal("vite", scripts["dev"]?.GetValue<string>()); 661Assert.Equal("vite build", scripts["build"]?.GetValue<string>()); 664Assert.Equal("aspire run", scripts["aspire:start"]?.GetValue<string>()); 665Assert.Equal("tsc -p tsconfig.apphost.json", scripts["aspire:build"]?.GetValue<string>()); 666Assert.Equal("tsc --watch -p tsconfig.apphost.json", scripts["aspire:dev"]?.GetValue<string>()); 667Assert.Equal("eslint apphost.ts", scripts["aspire:lint"]?.GetValue<string>()); 670Assert.Equal("npm run aspire:start", scripts["start"]?.GetValue<string>()); 671Assert.Equal("npm run aspire:lint", scripts["lint"]?.GetValue<string>()); 674Assert.Equal("vite", scripts["dev"]?.GetValue<string>()); 675Assert.Equal("vite build", scripts["build"]?.GetValue<string>()); 724Assert.Equal("tsc && vite build", scripts["build"]?.GetValue<string>()); 725Assert.Equal("concurrently \"tsc -w\" \"vite\"", scripts["dev"]?.GetValue<string>()); 726Assert.Equal("vitest run && echo 'done'", scripts["test"]?.GetValue<string>()); 727Assert.Equal("eslint . --ext .ts,.tsx && prettier --check .", scripts["lint"]?.GetValue<string>()); 728Assert.Equal("rm -rf dist && rm -rf node_modules/.cache", scripts["clean"]?.GetValue<string>()); 729Assert.Equal("node server.js | tee output.log", scripts["start"]?.GetValue<string>()); 1044Assert.Equal("scaffold", ParseJson(result)["name"]?.GetValue<string>()); 1173Assert.Equal("^20.19.0 || ^22.13.0 || >=24", engines["node"]?.GetValue<string>()); 1201Assert.Equal("^20.19.0 || ^22.13.0 || >=24", engines["node"]?.GetValue<string>()); 1203Assert.Equal(">=8", engines["npm"]?.GetValue<string>()); 1226Assert.Equal("^20.19.0 || ^22.13.0 || >=24", engines["node"]?.GetValue<string>()); 1252Assert.Equal("web", keywords[0]!.GetValue<string>()); 1253Assert.Equal("api", keywords[1]!.GetValue<string>()); 1257Assert.Equal("dist/**", files[0]!.GetValue<string>()); 1304Assert.Equal("my-project", doc["name"]!.GetValue<string>()); 1305Assert.Equal("ISC", doc["license"]!.GetValue<string>()); 1322Assert.Contains(">=24", doc["engines"]?["node"]?.GetValue<string>()); 1489Assert.Equal("vite-brownfield", doc["name"]!.GetValue<string>()); 1490Assert.Equal("2.0.0", doc["version"]!.GetValue<string>()); 1491Assert.Equal("module", doc["type"]!.GetValue<string>()); 1495Assert.Equal("vite", scripts["dev"]?.GetValue<string>()); 1496Assert.Equal("vite build", scripts["build"]?.GetValue<string>()); 1497Assert.Equal("vite preview", scripts["preview"]?.GetValue<string>()); 1500Assert.Equal("aspire run", scripts["aspire:start"]?.GetValue<string>()); 1501Assert.Equal("tsc -p tsconfig.apphost.json", scripts["aspire:build"]?.GetValue<string>()); 1502Assert.Equal("tsc --watch -p tsconfig.apphost.json", scripts["aspire:dev"]?.GetValue<string>()); 1503Assert.Equal("eslint apphost.ts", scripts["aspire:lint"]?.GetValue<string>()); 1518Assert.Contains(">=24", doc["engines"]?["node"]?.GetValue<string>());
Scaffolding\ScaffoldingServiceTests.cs (19)
127Assert.Equal("vitest", scripts["test"]?.GetValue<string>()); 128Assert.Equal("pnpm --dir apps/web/aspire-apphost run aspire:start", scripts["aspire:start"]?.GetValue<string>()); 129Assert.Equal("pnpm --dir apps/web/aspire-apphost run aspire:build", scripts["aspire:build"]?.GetValue<string>()); 130Assert.Equal("pnpm --dir apps/web/aspire-apphost run aspire:dev", scripts["aspire:dev"]?.GetValue<string>()); 144Assert.Equal("deno task --cwd apps/web/aspire-apphost aspire:start", scripts["aspire:start"]?.GetValue<string>()); 145Assert.Equal("deno task --cwd apps/web/aspire-apphost aspire:build", scripts["aspire:build"]?.GetValue<string>()); 146Assert.Equal("deno task --cwd apps/web/aspire-apphost aspire:dev", scripts["aspire:dev"]?.GetValue<string>()); 169Assert.Equal("pnpm --dir aspire-apphost run aspire:start", scripts["aspire:start"]?.GetValue<string>()); 170Assert.Equal("pnpm --dir aspire-apphost run aspire:build", scripts["aspire:build"]?.GetValue<string>()); 171Assert.Equal("pnpm --dir aspire-apphost run aspire:dev", scripts["aspire:dev"]?.GetValue<string>()); 195Assert.Equal("custom-start", scripts["aspire:start"]?.GetValue<string>()); 196Assert.Equal("npm --prefix aspire-apphost run aspire:build", scripts["aspire:build"]?.GetValue<string>()); 197Assert.Equal("npm --prefix aspire-apphost run aspire:dev", scripts["aspire:dev"]?.GetValue<string>()); 324Assert.True(merged["editor.formatOnSave"]!.GetValue<bool>()); 326Assert.Equal("automatic", merged["java.compile.nullAnalysis.mode"]!.GetValue<string>()); 327Assert.Equal([".", ".aspire/modules"], merged["java.project.sourcePaths"]!.AsArray().Select(v => v!.GetValue<string>())); 349merged["java.project.sourcePaths"]!.AsArray().Select(v => v!.GetValue<string>())); 371Assert.Equal(4, merged["editor.tabSize"]!.GetValue<int>()); 372Assert.Equal(["."], merged["java.project.sourcePaths"]!.AsArray().Select(v => v!.GetValue<string>()));
Telemetry\ReportedLogExportTests.cs (1)
90switch (data["baseType"]!.GetValue<string>())
Utils\DevCertsCheckTests.cs (3)
309Assert.Equal("AAAA1111BBBB2222", certNode["thumbprint"]!.GetValue<string>()); 310Assert.Equal(MinVersion, certNode["version"]!.GetValue<int>()); 311Assert.Equal("full", certNode["trustLevel"]!.GetValue<string>());
Utils\EnvironmentCheckerTests.cs (2)
61Assert.Equal(nameof(TestEnvironmentCheck), timeoutResult.Metadata!["checkType"]!.GetValue<string>()); 62Assert.Equal(0.1, timeoutResult.Metadata["timeoutSeconds"]!.GetValue<double>());
Aspire.Dashboard (10)
Model\GenAI\GenAIItemPartViewModel.cs (2)
90? toolCallResponsePart.Response.GetValue<string>() 126? serverToolCallResponsePart.ServerToolCallResponse.GetValue<string>()
Model\GenAI\GenAIMessageParsingHelper.cs (1)
147if (node?.GetValueKind() == JsonValueKind.String && node.GetValue<string>() is { } json)
Model\GenAI\GenAISchemaHelpers.cs (4)
23Description = schemaObj["description"]?.GetValue<string>() 53schema.Required.Add(item.GetValue<string>()); 96var typeValue = item.GetValue<string>(); 112var typeString = typeNode.GetValue<string>();
Model\GenAI\GenAIVisualizerDialogViewModel.cs (3)
104Type = obj["type"]?.GetValue<string>() ?? "function", 105Name = obj["name"]?.GetValue<string>(), 106Description = obj["description"]?.GetValue<string>()
Aspire.Dashboard.Tests (15)
Model\GenAIMessageParsingHelperTests.cs (6)
138Assert.Equal("Seattle", toolCallPart.Arguments["location"]!.GetValue<string>()); 153Assert.Equal("Seattle", toolCallPart.Arguments["location"]!.GetValue<string>()); 168Assert.Equal(72, objectResponse.Response!["temperature"]!.GetValue<int>()); 172Assert.Equal("plain text result", stringResponse.Response!.GetValue<string>()); 246Assert.Equal("latest news", serverToolCallPart.ServerToolCall["query"]!.GetValue<string>()); 261Assert.Equal("web_search", serverToolCallResponsePart.ServerToolCallResponse["type"]!.GetValue<string>());
Model\GenAIVisualizerDialogViewModelTests.cs (2)
1194Assert.Equal("celsius", unitProp.Enum[0]!.GetValue<string>()); 1195Assert.Equal("fahrenheit", unitProp.Enum[1]!.GetValue<string>());
Model\TelemetryExportServiceTests.cs (7)
1434Assert.Equal("dependency-resource", waitingForPropertyValue?.GetValue<string>()); 1436Assert.Equal("localhost", connectionPropertiesObject["Host"]?.GetValue<string>()); 1437Assert.Equal("catalogdb", connectionPropertiesObject["DatabaseName"]?.GetValue<string>()); 1568Assert.Equal(6379, portsArray[0]!.GetValue<double>()); 1569Assert.Equal(6380, portsArray[1]!.GetValue<double>()); 1572var exitCode = deserialized.Properties["resource.exitCode"]!.GetValue<double>(); 1576var enabled = deserialized.Properties["resource.enabled"]!.GetValue<bool>();
Aspire.Hosting (10)
Backchannel\AuxiliaryBackchannelRpcTarget.cs (1)
418JsonValueKind.String => value.GetValue<string>(),
Pipelines\Internal\DeploymentStateManagerBase.cs (1)
198value = jsonValue.GetValue<string>();
Pipelines\Internal\FileDeploymentStateManager.cs (3)
745var legacyFallbackDisabled = migrationState[LegacyFallbackDisabledProperty]?.GetValue<bool>() ?? false; 761JsonValue stateValue => JsonNode.Parse(stateValue.GetValue<string>())?.AsObject() 772claimedSectionsValue.GetValue<string>());
Publishing\ContainerRuntimeBase.cs (5)
197root["WorkingDir"]?.GetValue<string>()); 220if (item?.GetValue<string>() is { } value) 308var actualOperatingSystem = platform?["os"]?.GetValue<string>(); 309var actualArchitecture = platform?["architecture"]?.GetValue<string>(); 310var digest = descriptor["digest"]?.GetValue<string>();
Aspire.Hosting.Azure (53)
AzureProvisioningController.cs (27)
1854var subscriptionId = section.Data["SubscriptionId"]?.GetValue<string>(); 1855var resourceGroupName = section.Data["ResourceGroup"]?.GetValue<string>(); 2496deployment.TryGetPropertyValue("resourceId", out var resourceIdNode) ? resourceIdNode?.GetValue<string>() : null, 2507var deploymentId = section.Data["Id"]?.GetValue<string>(); 2511var outputs = ParseDeploymentStateJson(resource.Name, "Outputs", section.Data["Outputs"]?.GetValue<string>()); 2521["locationOverride"] = section.Data[LocationOverrideKey]?.GetValue<string>(), 2522["checksum"] = section.Data["CheckSum"]?.GetValue<string>(), 2524["scope"] = ParseDeploymentStateJson(resource.Name, "Scope", section.Data["Scope"]?.GetValue<string>()) 2530if (section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>() is { Length: > 0 } provisioningState) 2742if (section.Data[LocationOverrideKey]?.GetValue<string>() is { Length: > 0 } locationOverride) 2761if (section.Data[LocationOverrideKey]?.GetValue<string>() is { Length: > 0 } locationOverride) 3089=> section.Data["Id"]?.GetValue<string>() is { Length: > 0 } deploymentId ? deploymentId : null; 3093section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>(), 3154if (section.Data["Parameters"]?.GetValue<string>() is not { Length: > 0 } parametersJson) 3161var persistedLocation = AzureProvisioningJsonHelpers.ParseDeploymentStateJson(parametersJson)?[AzureBicepResource.KnownParameters.Location]?["value"]?.GetValue<string>(); 3185=> section.Data[LocationOverrideKey]?.GetValue<string>() is { Length: > 0 } locationOverride ? locationOverride : null; 3368section.Data["SubscriptionId"]?.GetValue<string>() ?? provisionerOptions.Value.SubscriptionId ?? configuration["Azure:SubscriptionId"], 3369section.Data["ResourceGroup"]?.GetValue<string>() ?? provisionerOptions.Value.ResourceGroup ?? configuration["Azure:ResourceGroup"], 3370section.Data["Location"]?.GetValue<string>() ?? provisionerOptions.Value.Location ?? configuration["Azure:Location"], 3371section.Data["TenantId"]?.GetValue<string>() ?? provisionerOptions.Value.TenantId ?? configuration["Azure:TenantId"], 3372section.Data["Tenant"]?.GetValue<string>()); 3390if (section.Data["Outputs"]?.GetValue<string>() is not { Length: > 0 } outputsJson) 3399return AzureProvisioningJsonHelpers.ParseDeploymentStateJson(outputsJson)?["id"]?["value"]?.GetValue<string>(); 3509if (section.Data[LocationOverrideKey]?.GetValue<string>() is { Length: > 0 } locationOverride) 3516if (section.Data["Parameters"]?.GetValue<string>() is not { Length: > 0 } parametersJson) 3523return AzureProvisioningJsonHelpers.ParseDeploymentStateJson(parametersJson)?[AzureBicepResource.KnownParameters.Location]?["value"]?.GetValue<string>(); 3812section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>(),
Provisioning\BicepUtilities.cs (2)
125if (section.Data[DeploymentStateParametersKey]?.GetValue<string>() is not { Length: > 0 } jsonString) 133var scope = section.Data[DeploymentStateScopeKey]?.GetValue<string>() is { Length: > 0 } scopeString
Provisioning\Internal\RunModeProvisioningContextProvider.cs (5)
235if (data["Location"]?.GetValue<string>() is { Length: > 0 } location) 240if (data["SubscriptionId"]?.GetValue<string>() is { Length: > 0 } subscriptionId) 245if (data["ResourceGroup"]?.GetValue<string>() is { Length: > 0 } resourceGroup) 250if (data["TenantId"]?.GetValue<string>() is { Length: > 0 } tenantId) 267JsonValueKind.String when bool.TryParse(value.GetValue<string>(), out var parsedValue) => parsedValue,
Provisioning\Provisioners\BicepProvisioner.cs (19)
56if (stateSection.Data[DeploymentStateProvisioningStateKey]?.GetValue<string>() is { Length: > 0 } provisioningState && 64var configCheckSum = stateSection.Data[BicepUtilities.DeploymentStateChecksumKey]?.GetValue<string>(); 80if (stateSection.Data[BicepUtilities.DeploymentStateOutputsKey]?.GetValue<string>() is { Length: > 0 } outputJson) 115if (stateSection.Data[BicepUtilities.DeploymentStateIdKey]?.GetValue<string>() is { Length: > 0 } configuredDeploymentId && 183stateSection.Data[BicepUtilities.DeploymentStateIdKey]?.GetValue<string>() is not { Length: > 0 } deploymentId || 354stateSection.Data[BicepUtilities.DeploymentStateChecksumKey]?.GetValue<string>() is not { Length: > 0 } checksum) 371var locationOverride = stateSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>(); 451var locationOverride = stateSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>(); 472if (stateSection.Data[key]?.GetValue<string>() is not { Length: > 0 } json) 491stateSection.Data[DeploymentStateProvisioningStateKey]?.GetValue<string>(), 618var canceledLocationOverride = canceledStateSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>(); 675locationOverride = stateSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>(); 793locationOverride = stateSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>(); 851var cachedDeploymentId = stateSection.Data[BicepUtilities.DeploymentStateIdKey]?.GetValue<string>(); 852var cachedChecksum = stateSection.Data[BicepUtilities.DeploymentStateChecksumKey]?.GetValue<string>(); 1483section.Data[key]?.GetValue<string>() is { Length: > 0 } value ? value : null; 1487if (section.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>() is { Length: > 0 } locationOverride) 1492if (section.Data[BicepUtilities.DeploymentStateParametersKey]?.GetValue<string>() is { Length: > 0 } parametersJson) 1496if (JsonNode.Parse(parametersJson)?[AzureBicepResource.KnownParameters.Location]?["value"]?.GetValue<string>() is { Length: > 0 } configuredLocation)
Aspire.Hosting.Azure.Kubernetes (6)
AzureKubernetesEnvironmentResource.AksPipeline.cs (5)
413var scopeJson = deploymentStateSection.Data["Scope"]!.GetValue<string>(); 416scopedSubscription = scope["subscription"]?.GetValue<string>(); 417scopedResourceGroup = scope["resourceGroup"]?.GetValue<string>(); 464var outputsJson = deploymentState["Outputs"]?.GetValue<string>(); 470var resourceId = JsonNode.Parse(outputsJson)?["id"]?["value"]?.GetValue<string>();
AzureKubernetesEnvironmentResource.cs (1)
199return !string.IsNullOrEmpty(deploymentState["ReleaseName"]?.GetValue<string>());
Aspire.Hosting.Azure.Sandboxes (31)
AzureSandboxContainerDeployment.cs (28)
265var previousOwnerId = previousStateSection.Data["OwnerId"]?.GetValue<string>(); 390var pendingSecurityCleanup = previousStateSection.Data["PendingSecurityCleanup"]?.GetValue<bool>() == true; 494if (portStates.FirstOrDefault() is JsonObject firstPort && firstPort["Url"]?.GetValue<string>() is { } publicUrl) 1320var ownerId = stateSection.Data["OwnerId"]?.GetValue<string>(); 1436if (stateSection.Data["OwnerId"]?.GetValue<string>() is { Length: > 0 } ownerId && 1452stateSection.Data["OwnerId"]?.GetValue<string>())) 1592var sandboxId = stateSection.Data["SandboxId"]?.GetValue<string>(); 1605var diskImageId = stateSection.Data["DiskImageId"]?.GetValue<string>(); 1870if (stateSection.Data["ResourceName"]?.GetValue<string>() is { Length: > 0 } resourceName) 1933if (stateSection.Data["OwnerId"]?.GetValue<string>() is { Length: > 0 } previousOwnerId && 1967if (stateSection.Data["OwnerId"]?.GetValue<string>() is { Length: > 0 } previousOwnerId && 2070previousStateSection.Data["HasRuntimeEnvironmentConfiguration"]?.GetValue<bool>() == true || 2072previousStateSection.Data["HasRuntimeCommandConfiguration"]?.GetValue<bool>() == true) 2077if (previousStateSection.Data["PendingSecurityCleanup"]?.GetValue<bool>() == true) 2082var previousFingerprint = previousStateSection.Data["EndpointSecurityFingerprint"]?.GetValue<string>(); 2111var subscriptionId = stateSection.Data["SubscriptionId"]?.GetValue<string>(); 2112var resourceGroup = stateSection.Data["ResourceGroup"]?.GetValue<string>(); 2113var location = stateSection.Data["Location"]?.GetValue<string>(); 2114var sandboxGroup = stateSection.Data["SandboxGroup"]?.GetValue<string>(); 2135!string.IsNullOrWhiteSpace(stateSection.Data["OwnerId"]?.GetValue<string>()) || 2136!string.IsNullOrWhiteSpace(stateSection.Data["SandboxId"]?.GetValue<string>()) || 2137!string.IsNullOrWhiteSpace(stateSection.Data["DiskImageId"]?.GetValue<string>()); 2159if (port["Url"]?.GetValue<string>() is { Length: > 0 } url) 2175if (previousStateSection.Data["DeployId"]?.GetValue<string>() is { Length: > 0 } previousDeployId) 2190if (previousStateSection.Data[stateKey]?.GetValue<string>() is { Length: > 0 } previousId) 2204if (port["Port"]?.GetValue<int>() is { } portNumber) 2213if (stateSection.Data["Port"]?.GetValue<int>() is { } legacyPort) 2302var value = section.Data[name]?.GetValue<string>();
AzureSandboxEndpointPropertyValueProvider.cs (3)
135if (port["Port"]?.GetValue<int>() == sandboxEndpoint.TargetPort) 140if (string.Equals(port["Name"]?.GetValue<string>(), sandboxEndpoint.Name, StringComparison.Ordinal)) 151url = port["Url"]?.GetValue<string>();
Aspire.Hosting.Azure.Tests (155)
AzureBicepProvisionerTests.cs (18)
1018Assert.Equal("westus3", section.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>()); 1080Assert.Equal("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/test-rg/providers/Microsoft.Resources/deployments/storage2", section.Data["Id"]?.GetValue<string>()); 1081Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateRunning, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1335Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateCanceled, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1368Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateCanceled, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1400Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateCanceled, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1435Assert.Equal(deploymentId, section.Data[BicepUtilities.DeploymentStateIdKey]?.GetValue<string>()); 1493Assert.Equal(ResourcesProvisioningState.Failed.ToString(), section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1595Assert.Equal(deploymentId, section.Data[BicepUtilities.DeploymentStateIdKey]?.GetValue<string>()); 1596var outputs = JsonNode.Parse(section.Data[BicepUtilities.DeploymentStateOutputsKey]!.GetValue<string>())!.AsObject(); 1597Assert.Equal("https://storage.blob.core.windows.net/", outputs["blobEndpoint"]?["value"]?.GetValue<string>()); 1675Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateRunning, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1676Assert.Equal(deploymentId, section.Data[BicepUtilities.DeploymentStateIdKey]?.GetValue<string>()); 1704Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateRunning, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1705Assert.Equal(deploymentId, section.Data[BicepUtilities.DeploymentStateIdKey]?.GetValue<string>()); 1730Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateFailed, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1755Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateCanceled, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1789Assert.Equal(deploymentId, section.Data[BicepUtilities.DeploymentStateIdKey]?.GetValue<string>());
AzureDeployerTests.cs (1)
720Assert.Equal("salmonisland-e9e6a567.westus3.azurecontainerapps.io", parameters[reference.Key]!["value"]!.GetValue<string>());
AzureEnvironmentResourceExtensionsTests.cs (126)
365Assert.Contains("orphaned", resultData["warning"]?.GetValue<string>(), StringComparison.Ordinal); 367Assert.Contains(recommendedActions, action => action?["code"]?.GetValue<string>() == "delete-live-resources"); 759Assert.Equal(1, data["resourceCount"]?.GetValue<int>()); 839Assert.Equal(AzureProvisioningController.GetAzureResourceCommandName, data["command"]?.GetValue<string>()); 840Assert.Equal("storage", data["resourceName"]?.GetValue<string>()); 841Assert.Equal("westus2", data["azureLocation"]?.GetValue<string>()); 842Assert.Equal("westus3", data["location"]?.GetValue<string>()); 843Assert.Equal("westus3", data["effectiveLocation"]?.GetValue<string>()); 848Assert.Equal(subscriptionId, azureContext["subscriptionId"]?.GetValue<string>()); 849Assert.Equal(tenantId, azureContext["tenantId"]?.GetValue<string>()); 850Assert.Equal(resourceGroup, azureContext["resourceGroup"]?.GetValue<string>()); 851Assert.Equal("westus2", azureContext["location"]?.GetValue<string>()); 854Assert.True(deployment["hasState"]?.GetValue<bool>()); 855Assert.Equal(deploymentId, deployment["deploymentId"]?.GetValue<string>()); 856Assert.Equal(resourceId, deployment["resourceId"]?.GetValue<string>()); 857Assert.Equal("westus3", deployment["locationOverride"]?.GetValue<string>()); 858Assert.Equal("checksum", deployment["checksum"]?.GetValue<string>()); 859Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateRunning, deployment["provisioningState"]?.GetValue<string>()); 860Assert.Contains("/DeploymentDetailsBlade/", deployment["deploymentPortalUrl"]?.GetValue<string>()); 861Assert.Contains("/resource/subscriptions/", deployment["resourcePortalUrl"]?.GetValue<string>()); 864Assert.Equal("https://storage.blob.core.windows.net/", outputs["blobEndpoint"]?["value"]?.GetValue<string>()); 867Assert.Equal(resourceGroup, scope["resourceGroup"]?.GetValue<string>()); 870Assert.True(live["checked"]?.GetValue<bool>()); 871Assert.True(live["exists"]?.GetValue<bool>()); 923Assert.True(live["checked"]?.GetValue<bool>()); 924Assert.False(live["exists"]?.GetValue<bool>()); 925Assert.Equal("missing-live-resource", live["reason"]?.GetValue<string>()); 926Assert.Equal("azure", live["source"]?.GetValue<string>()); 927Assert.Equal("missing-live-resource", live["code"]?.GetValue<string>()); 928Assert.Contains("resource was not found in Azure", live["message"]?.GetValue<string>(), StringComparison.Ordinal); 930Assert.Contains(recommendedActions, action => action?["code"]?.GetValue<string>() == "reprovision-or-forget-state"); 984Assert.Equal("Microsoft.Storage/storageAccounts", json["resourceType"]?.GetValue<string>()); 985Assert.Equal("storage", json["resourceName"]?.GetValue<string>()); 986Assert.Equal(targetResourceId, json["targetResourceId"]?.GetValue<string>()); 1193Assert.True(deployment["hasState"]?.GetValue<bool>()); 1197Assert.False(live["checked"]?.GetValue<bool>()); 1199Assert.Equal("missing-resource-id", live["reason"]?.GetValue<string>()); 1200Assert.Equal("aspire", live["source"]?.GetValue<string>()); 1201Assert.Equal("missing-resource-id", live["code"]?.GetValue<string>()); 1202Assert.Contains("cached deployment state does not contain a resource ID", live["message"]?.GetValue<string>(), StringComparison.Ordinal); 1204Assert.Contains(recommendedActions, action => action?["code"]?.GetValue<string>() == "reprovision-or-change-context"); 1256Assert.True(live["checked"]?.GetValue<bool>()); 1258Assert.Equal("request-failed", live["reason"]?.GetValue<string>()); 1259Assert.Equal("azure", live["source"]?.GetValue<string>()); 1260Assert.Equal(403, live["status"]?.GetValue<int>()); 1261Assert.Equal("Azure", live["provider"]?.GetValue<string>()); 1262Assert.Equal(403, live["httpStatus"]?.GetValue<int>()); 1263Assert.Equal("AuthorizationFailed", live["errorCode"]?.GetValue<string>()); 1264Assert.Equal("live-resource-check", live["operation"]?.GetValue<string>()); 1265Assert.Contains("Forbidden", live["message"]?.GetValue<string>(), StringComparison.Ordinal); 1317Assert.True(live["checked"]?.GetValue<bool>()); 1319Assert.Equal("credential-unavailable", live["reason"]?.GetValue<string>()); 1320Assert.Contains("Credential unavailable", live["message"]?.GetValue<string>(), StringComparison.Ordinal); 1380Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateCanceled, storageSection.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1514Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateCanceled, storageSection.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1718Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateSucceeded, storageSection.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1808Assert.Equal(2, resultData["deletedResourceCount"]?.GetValue<int>()); 1810Assert.Equal(deletedResourceIds, resultResourceIds.Select(static resourceId => resourceId!.GetValue<string>())); 1813Assert.Equal("westus3", storageSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>()); 1818Assert.Equal("storage2-deployment", storage2Section.Data["Id"]?.GetValue<string>()); 1899Assert.Equal(1, resultData["deletedResourceCount"]?.GetValue<int>()); 2127Assert.Equal("storage2-deployment", storage2Section.Data["Id"]?.GetValue<string>()); 2192Assert.Equal("storage2-deployment", storage2Section.Data["Id"]?.GetValue<string>()); 2801Assert.Equal("westus2", storageSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>()); 2848Assert.Equal("westus3", storageSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>()); 2851Assert.Equal(1, data["schemaVersion"]?.GetValue<int>()); 2852Assert.Equal(AzureProvisioningController.ChangeResourceLocationCommandName, data["command"]?.GetValue<string>()); 2853Assert.Equal("storage", data["resourceName"]?.GetValue<string>()); 2854Assert.Equal("westus3", data["location"]?.GetValue<string>()); 2855Assert.Equal("westus3", data["effectiveLocation"]?.GetValue<string>()); 2856Assert.Equal("eastus", data["azureLocation"]?.GetValue<string>()); 2858Assert.Equal("eastus", azureContext["location"]?.GetValue<string>()); 2906Assert.Equal("westus3", bicepSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>()); 3232Assert.Equal("westus3", storageSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>()); 3294Assert.Equal("westus3", storageSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>()); 3359Assert.Equal("westus3", storageSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>()); 3413Assert.Equal("12345678-1234-1234-1234-123456789012", azureSection.Data["SubscriptionId"]?.GetValue<string>()); 3414Assert.Equal("westus2", azureSection.Data["Location"]?.GetValue<string>()); 3415Assert.Equal("test-rg", azureSection.Data["ResourceGroup"]?.GetValue<string>()); 3416Assert.Equal("87654321-4321-4321-4321-210987654321", azureSection.Data["TenantId"]?.GetValue<string>()); 3459Assert.Equal("12345678-1234-1234-1234-123456789012", azureSection.Data["SubscriptionId"]?.GetValue<string>()); 3460Assert.Equal("westus3", azureSection.Data["Location"]?.GetValue<string>()); 3461Assert.Equal("cli-rg-é", azureSection.Data["ResourceGroup"]?.GetValue<string>()); 3462Assert.Equal("87654321-4321-4321-4321-210987654321", azureSection.Data["TenantId"]?.GetValue<string>()); 3465Assert.Equal(1, data["schemaVersion"]?.GetValue<int>()); 3466Assert.Equal(AzureProvisioningController.ChangeAzureContextCommandName, data["command"]?.GetValue<string>()); 3467Assert.Equal("12345678-1234-1234-1234-123456789012", data["subscriptionId"]?.GetValue<string>()); 3468Assert.Equal("87654321-4321-4321-4321-210987654321", data["tenantId"]?.GetValue<string>()); 3469Assert.Equal("cli-rg-é", data["resourceGroup"]?.GetValue<string>()); 3470Assert.Equal("westus3", data["azureLocation"]?.GetValue<string>()); 3472Assert.Equal("12345678-1234-1234-1234-123456789012", azureContext["subscriptionId"]?.GetValue<string>()); 3473Assert.Equal("87654321-4321-4321-4321-210987654321", azureContext["tenantId"]?.GetValue<string>()); 3474Assert.Equal("cli-rg-é", azureContext["resourceGroup"]?.GetValue<string>()); 3475Assert.Equal("westus3", azureContext["location"]?.GetValue<string>()); 3479Assert.Equal(1, data["resourceCount"]?.GetValue<int>()); 3580Assert.Equal("westus2", azureSection.Data["Location"]?.GetValue<string>()); 3675Assert.Equal("westus3", storage2Section.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>()); 3721Assert.Equal("westus3", storage2Section.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>()); 3780Assert.Equal("westus3", storage2Section.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>()); 4023Assert.False(data["success"]?.GetValue<bool>()); 4026Assert.Equal("Microsoft.KeyVault", diagnostic["provider"]?.GetValue<string>()); 4027Assert.Equal("Microsoft.KeyVault/vaults", diagnostic["resourceType"]?.GetValue<string>()); 4028Assert.Equal("kv-test", diagnostic["resourceName"]?.GetValue<string>()); 4029Assert.Equal(keyVaultResourceId, diagnostic["targetResourceId"]?.GetValue<string>()); 4030Assert.Equal(AzureProvisioningFailureDetails.KeyVaultDeletedStateTombstoneNotFoundReason, diagnostic["errorCode"]?.GetValue<string>()); 4031Assert.Equal(409, diagnostic["httpStatus"]?.GetValue<int>()); 4032Assert.Contains("deleted vault was not found", diagnostic["errorMessage"]?.GetValue<string>(), StringComparison.Ordinal); 4034Assert.Contains(recommendedActions, action => action?["code"]?.GetValue<string>() == "retry-reprovision"); 4230Assert.False(data["success"]?.GetValue<bool>()); 4231Assert.Equal("failed", data["status"]?.GetValue<string>()); 4234Assert.Equal("azure", diagnostic["source"]?.GetValue<string>()); 4235Assert.Equal("Microsoft.ManagedIdentity", diagnostic["provider"]?.GetValue<string>()); 4236Assert.Equal("Microsoft.ManagedIdentity/userAssignedIdentities", diagnostic["resourceType"]?.GetValue<string>()); 4237Assert.Equal(400, diagnostic["httpStatus"]?.GetValue<int>()); 4238Assert.Equal("LocationNotAvailableForResourceType", diagnostic["errorCode"]?.GetValue<string>()); 4239Assert.Equal("provision", diagnostic["operation"]?.GetValue<string>()); 4241Assert.Contains(resultRecommendedActions, action => action?["code"]?.GetValue<string>() == "change-location"); 4536Assert.Equal("12345678-1234-1234-1234-123456789012", azureSection.Data["SubscriptionId"]?.GetValue<string>()); 4537Assert.Equal("westus2", azureSection.Data["Location"]?.GetValue<string>()); 4538Assert.Equal("test-rg", azureSection.Data["ResourceGroup"]?.GetValue<string>()); 4539Assert.Equal("87654321-4321-4321-4321-210987654321", azureSection.Data["TenantId"]?.GetValue<string>()); 4685Assert.Equal("storage-deployment", storageSection.Data["Id"]?.GetValue<string>()); 5564azureSection.Data["SubscriptionId"]?.GetValue<string>(), 5565azureSection.Data["ResourceGroup"]?.GetValue<string>(), 5566azureSection.Data["Location"]?.GetValue<string>(), 5567azureSection.Data["TenantId"]?.GetValue<string>());
AzureSandboxesTests.cs (3)
438Assert.Equal("existing-rg", rolesManifest["scope"]?["resourceGroup"]?.GetValue<string>()); 925Assert.Equal("production-sandbox", directCleanupState?["SandboxId"]?.GetValue<string>()); 926Assert.Equal("production-disk", directCleanupState?["DiskImageId"]?.GetValue<string>());
BicepUtilitiesTests.cs (5)
64Assert.Equal(20, parameters["age"]?["value"]?.GetValue<int>()); 120Assert.Equal("context-value", parameters["value"]?["value"]?.GetValue<string>()); 121Assert.Equal("context-value", parameters["deferred"]?["value"]?.GetValue<string>()); 122Assert.Equal("context-value/suffix", parameters["expression"]?["value"]?.GetValue<string>()); 455Assert.Null(scope["resourceGroup"]?.AsValue().GetValue<object>());
DefaultArmClientProviderTests.cs (1)
158Assert.Equal("https://storage.blob.core.windows.net/", deployment.Outputs?["blobEndpoint"]?["value"]?.GetValue<string>());
JsonExtensionsTests.cs (1)
23Assert.Equal("TestValue", retrievedNode["TestProperty"]!.GetValue<string>());
Aspire.Hosting.CodeGeneration.TypeScript.Tests (42)
AtsTypeScriptCodeGeneratorTests.cs (2)
45Assert.Equal("aspire-host", packageJson["name"]?.GetValue<string>()); 46Assert.Equal("module", packageJson["type"]?.GetValue<string>());
TypeScriptLanguageSupportTests.cs (40)
36Assert.Equal("brownfieldapp", packageJson["name"]?.GetValue<string>()); 37Assert.Equal("1.0.0", packageJson["version"]?.GetValue<string>()); 38Assert.True(packageJson["private"]?.GetValue<bool>()); 39Assert.Equal("module", packageJson["type"]?.GetValue<string>()); 40Assert.Equal("aspire run", scripts["aspire:start"]?.GetValue<string>()); 41Assert.Equal("tsc -p tsconfig.apphost.json", scripts["aspire:build"]?.GetValue<string>()); 42Assert.Equal("tsc --watch -p tsconfig.apphost.json", scripts["aspire:dev"]?.GetValue<string>()); 43Assert.Equal("eslint apphost.mts", scripts["aspire:lint"]?.GetValue<string>()); 44Assert.Equal("eslint apphost.mts", scripts["lint"]?.GetValue<string>()); 45Assert.Equal("eslint apphost.mts && aspire run", scripts["dev"]?.GetValue<string>()); 46Assert.Equal("eslint apphost.mts && tsc -p tsconfig.apphost.json", scripts["build"]?.GetValue<string>()); 47Assert.Equal("tsc --watch -p tsconfig.apphost.json", scripts["watch"]?.GetValue<string>()); 48Assert.Equal("^4.21.0", devDependencies["tsx"]?.GetValue<string>()); 49Assert.Equal("^5.9.3", devDependencies["typescript"]?.GetValue<string>()); 50Assert.Equal("^10.0.3", devDependencies["eslint"]?.GetValue<string>()); 51Assert.Equal("^8.57.1", devDependencies["typescript-eslint"]?.GetValue<string>()); 54Assert.Equal("^20.19.0 || ^22.13.0 || >=24", engines["node"]?.GetValue<string>()); 63Assert.Equal("./dist/apphost", tsConfig["compilerOptions"]?["outDir"]?.GetValue<string>()); 111Assert.Equal("aspire run", scripts["aspire:start"]?.GetValue<string>()); 112Assert.Equal("tsc -p tsconfig.apphost.json", scripts["aspire:build"]?.GetValue<string>()); 113Assert.Equal("tsc --watch -p tsconfig.apphost.json", scripts["aspire:dev"]?.GetValue<string>()); 114Assert.Equal("eslint apphost.mts", scripts["aspire:lint"]?.GetValue<string>()); 120Assert.Equal("^8.2.0", dependencies["vscode-jsonrpc"]?.GetValue<string>()); 121Assert.Equal("^4.21.0", devDependencies["tsx"]?.GetValue<string>()); 122Assert.Equal("^22.0.0", devDependencies["@types/node"]?.GetValue<string>()); 123Assert.Equal("^3.1.14", devDependencies["nodemon"]?.GetValue<string>()); 124Assert.Equal("^5.9.3", devDependencies["typescript"]?.GetValue<string>()); 129Assert.Equal("^20.19.0 || ^22.13.0 || >=24", engines["node"]?.GetValue<string>()); 147Assert.Equal("aspire-apphost", packageJson["name"]?.GetValue<string>()); 148Assert.Equal("1.0.0", packageJson["version"]?.GetValue<string>()); 149Assert.True(packageJson["private"]?.GetValue<bool>()); 150Assert.Equal("module", packageJson["type"]?.GetValue<string>()); 184Assert.Equal("^8.2.0", dependencies["vscode-jsonrpc"]?.GetValue<string>()); 185Assert.Equal("^22.0.0", devDependencies["@types/node"]?.GetValue<string>()); 186Assert.Equal("^3.1.14", devDependencies["nodemon"]?.GetValue<string>()); 187Assert.Equal("^4.21.0", devDependencies["tsx"]?.GetValue<string>()); 188Assert.Equal("^5.9.3", devDependencies["typescript"]?.GetValue<string>()); 236var applicationUrls = httpsProfile["applicationUrl"]!.GetValue<string>().Split(';', StringSplitOptions.RemoveEmptyEntries); 243var otlpHttpsPort = GetPort(environmentVariables["ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL"]!.GetValue<string>()); 244var resourceServiceHttpsPort = GetPort(environmentVariables["ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL"]!.GetValue<string>());
Aspire.Hosting.Dotnet.Tests (2)
DotnetProjectResourceTests.cs (2)
182Assert.Equal("project.v0", manifest["type"]?.GetValue<string>()); 183Assert.Equal(expectedPath, manifest["path"]?.GetValue<string>());
Aspire.Hosting.Foundry.Tests (4)
HostedAgentConfigurationTests.cs (3)
92Assert.Equal(ProjectsAgentProtocol.Responses.ToString(), protocolVersion!["protocol"]!.GetValue<string>()); 93Assert.Equal("2.0.0", protocolVersion["version"]!.GetValue<string>()); 94Assert.Equal("myregistry.azurecr.io/myagent:v1", definition["container_configuration"]!["image"]!.GetValue<string>());
HostedAgentExtensionTests.cs (1)
188Assert.Equal("hello from dashboard", JsonNode.Parse(fakeHandler.RequestContent!)?["message"]?.GetValue<string>());
Aspire.Hosting.JavaScript.Tests (1)
AddDenoAppTests.cs (1)
1092Assert.Equal(8000, manifest["bindings"]!["http"]!["targetPort"]!.GetValue<int>());
Aspire.Hosting.Redis.Tests (30)
AddRedisTests.cs (26)
156Assert.Equal("container.v0", manifest["type"]!.GetValue<string>()); 157var connectionString = manifest["connectionString"]!.GetValue<string>(); 162Assert.Equal($"{RedisContainerImageTags.Registry}/{RedisContainerImageTags.Image}:{RedisContainerImageTags.Tag}", manifest["image"]!.GetValue<string>()); 163Assert.Equal("/bin/sh", manifest["entrypoint"]!.GetValue<string>()); 164Assert.Equal("{redis-password.value}", manifest["env"]!["REDIS_PASSWORD"]!.GetValue<string>()); 165Assert.Equal("redis", manifest["bindings"]!["tcp"]!["scheme"]!.GetValue<string>()); 166Assert.Equal(6379, manifest["bindings"]!["tcp"]!["targetPort"]!.GetValue<int>()); 181Assert.Equal("container.v0", manifest["type"]!.GetValue<string>()); 182var connectionString = manifest["connectionString"]!.GetValue<string>(); 187Assert.Equal($"{RedisContainerImageTags.Registry}/{RedisContainerImageTags.Image}:{RedisContainerImageTags.Tag}", manifest["image"]!.GetValue<string>()); 188Assert.Equal("/bin/sh", manifest["entrypoint"]!.GetValue<string>()); 189Assert.Equal("redis", manifest["bindings"]!["tcp"]!["scheme"]!.GetValue<string>()); 190Assert.Equal(6379, manifest["bindings"]!["tcp"]!["targetPort"]!.GetValue<int>()); 210Assert.Equal("container.v0", manifest["type"]!.GetValue<string>()); 211var connectionString = manifest["connectionString"]!.GetValue<string>(); 216Assert.Equal($"{RedisContainerImageTags.Registry}/{RedisContainerImageTags.Image}:{RedisContainerImageTags.Tag}", manifest["image"]!.GetValue<string>()); 217Assert.Equal("{pass.value}", manifest["env"]!["REDIS_PASSWORD"]!.GetValue<string>()); 218Assert.Equal("redis", manifest["bindings"]!["tcp"]!["scheme"]!.GetValue<string>()); 219Assert.Equal(6379, manifest["bindings"]!["tcp"]!["targetPort"]!.GetValue<int>()); 236Assert.Equal("container.v0", manifest["type"]!.GetValue<string>()); 237var connectionString = manifest["connectionString"]!.GetValue<string>(); 242Assert.Equal($"{RedisContainerImageTags.Registry}/{RedisContainerImageTags.Image}:{RedisContainerImageTags.Tag}", manifest["image"]!.GetValue<string>()); 243Assert.Equal("{pass.value}", manifest["env"]!["REDIS_PASSWORD"]!.GetValue<string>()); 244Assert.Equal("redis", manifest["bindings"]!["tcp"]!["scheme"]!.GetValue<string>()); 245Assert.Equal(6379, manifest["bindings"]!["tcp"]!["targetPort"]!.GetValue<int>()); 1090Assert.Equal("value.v0", creEntry["type"]!.GetValue<string>());
RedisFunctionalTests.cs (4)
719Assert.False(agreements["analytics"]!.GetValue<bool>()); 720Assert.False(agreements["notifications"]!.GetValue<bool>()); 721Assert.False(agreements["encryption"]!.GetValue<bool>()); 722Assert.True(agreements["eula"]!.GetValue<bool>());
Aspire.Hosting.RemoteHost (8)
Ats\AtsMarshaller.cs (4)
881return value.GetValue<string>(); 886return value.GetValue<bool>(); 931return value.GetValue<double>(); 936return value.TryGetValue<float>(out var floatValue) ? floatValue : (float)value.GetValue<double>();
Ats\CapabilityDispatcher.cs (3)
1062return value.GetValue<string>() ?? 1073return value.GetValue<string>(); 1085return value.GetValue<int>();
Ats\HandleRegistry.cs (1)
199var handleId = handleNode?.GetValue<string>();
Aspire.Hosting.RemoteHost.Tests (138)
AtsMarshallerTests.cs (31)
137Assert.Equal("hello", result.GetValue<string>()); 148Assert.Equal(42, result.GetValue<int>()); 159Assert.True(result.GetValue<bool>()); 205Assert.Equal("test/IResource", result["$type"]!.GetValue<string>()); 206Assert.True(registry.TryGet(result["$handle"]!.GetValue<string>(), out var retrieved, out _)); 238Assert.Equal("ValueB", result.GetValue<string>()); 249Assert.Equal(1500.0, result.GetValue<double>()); 264Assert.Equal(1, jsonArray[0]!.GetValue<int>()); 265Assert.Equal(2, jsonArray[1]!.GetValue<int>()); 266Assert.Equal(3, jsonArray[2]!.GetValue<int>()); 279var tokenId = tokenValue.GetValue<string>(); 300var tokenId = tokenValue.GetValue<string>(); 529Assert.Equal("2024-06-15", result.GetValue<string>()); 552Assert.Contains("14:30:45", result.GetValue<string>()); 573Assert.Equal(9223372036854775807L, result.GetValue<long>()); 584Assert.Equal(3.14159, result.GetValue<double>()); 613var typeId = jsonObj["$type"]!.GetValue<string>(); 632var typeId = jsonObj["$type"]!.GetValue<string>(); 844Assert.Equal("test", jsonObj["name"]?.GetValue<string>()); 845Assert.Equal(10, jsonObj["count"]?.GetValue<int>()); 897Assert.Equal(1500, json["required"]?.GetValue<double>()); 898Assert.Equal(90_000, json["optional"]?.GetValue<double>()); 991Assert.Equal("root", obj["name"]!.GetValue<string>()); 1007Assert.Equal("parent", obj["label"]!.GetValue<string>()); 1009Assert.Equal("child", childObj["label"]!.GetValue<string>()); 1027Assert.Equal("typed", obj["name"]!.GetValue<string>()); 1043Assert.Equal("parent", obj["label"]!.GetValue<string>()); 1045Assert.Equal("child", childObj["label"]!.GetValue<string>()); 1332var handleId = json["$handle"]!.GetValue<string>(); 1350var handleId = json!["$handle"]!.GetValue<string>(); 1369var handleId = json!["$handle"]!.GetValue<string>();
CallbackProxyTests.cs (10)
171Assert.Equal("hello-world", args["p0"]?.GetValue<string>()); 188Assert.Equal("test-name", args["p0"]?.GetValue<string>()); 189Assert.Equal(42, args["p1"]?.GetValue<int>()); 213Assert.NotNull(handle["$handle"]?.GetValue<string>()); 214Assert.Equal(AtsTypeMapping.DeriveTypeId(typeof(ITestCallbackHandle)), handle["$type"]?.GetValue<string>()); 244Assert.Equal("test", args["p0"]?.GetValue<string>()); 245var tokenId = args["p1"]?.GetValue<string>(); 248Assert.Equal(tokenId, args["$cancellationToken"]?.GetValue<string>()); 265var tokenId = args["p0"]?.GetValue<string>(); 267Assert.Equal(tokenId, args["$cancellationToken"]?.GetValue<string>());
CapabilityDispatcherTests.cs (76)
69receivedName = args?["name"]?.GetValue<string>(); 87Assert.Equal(42, result.GetValue<int>()); 189Assert.Equal("HELLO", result.GetValue<string>()); 201Assert.Equal("test:default", result.GetValue<string>()); 213Assert.Equal("test:custom", result.GetValue<string>()); 269Assert.Equal("test-name", nameResult.GetValue<string>()); 271Assert.Equal(100, countResult.GetValue<int>()); 330Assert.True(result.GetValue<bool>()); 390var nestedHandleId = handleRef["$handle"]!.GetValue<string>(); 391var nestedTypeId = handleRef["$type"]!.GetValue<string>(); 401Assert.Equal("Publish", operationResult.GetValue<string>()); 576Assert.Equal(12, result.GetValue<int>()); 596Assert.Equal("TEST", result.GetValue<string>()); 616Assert.Equal("VALUE-TASK", result.GetValue<string>()); 628Assert.Equal("VALUE-TASK", result.GetValue<string>()); 675Assert.Equal("PROCESSED: test-input", result.GetValue<string>()); 719Assert.Equal("hello from C#", callbackArgs["p0"]?.GetValue<string>()); 739Assert.Equal(42, result.GetValue<int>()); 751Assert.Equal(callerThreadId, result.GetValue<int>()); 763Assert.NotEqual(callerThreadId, result.GetValue<int>()); 775Assert.NotEqual(callerThreadId, result.GetValue<int>()); 800Assert.NotEqual(callerThreadId, result.GetValue<int>()); 917Assert.Equal("HELLO", result.GetValue<string>()); 946Assert.Equal(15, result.GetValue<int>()); 961Assert.Equal("item0", resultArray[0]?.GetValue<string>()); 962Assert.Equal("item1", resultArray[1]?.GetValue<string>()); 963Assert.Equal("item2", resultArray[2]?.GetValue<string>()); 978Assert.Equal(60, result.GetValue<int>()); 991Assert.Equal("hello", result.GetValue<string>()); 1003Assert.Equal("42", result.GetValue<string>()); 1021Assert.Equal("dto-value", result.GetValue<string>()); 1033Assert.Equal("enum:ValueB", result.GetValue<string>()); 1045Assert.Equal("string:/usr/local/lib/redis/modules/redisearch.so", result.GetValue<string>()); 1086Assert.Equal("union-resource", result.GetValue<string>()); 1152var listHandle = (listResult as JsonObject)?["$handle"]?.GetValue<string>(); 1165Assert.Equal("second", result.GetValue<string>()); 1175var listHandle = (listResult as JsonObject)?["$handle"]?.GetValue<string>(); 1187Assert.Equal(20, result.GetValue<int>()); 1198var listHandle = (listResult as JsonObject)?["$handle"]?.GetValue<string>(); 1210Assert.True(removeResult.GetValue<bool>()); 1220Assert.Equal(2, lengthResult.GetValue<int>()); 1231var listHandle = (listResult as JsonObject)?["$handle"]?.GetValue<string>(); 1242Assert.Equal(3, result.GetValue<int>()); 1253var listHandle = (listResult as JsonObject)?["$handle"]?.GetValue<string>(); 1271Assert.Equal(0, lengthResult.GetValue<int>()); 1298var dictHandle = (dictResult as JsonObject)?["$handle"]?.GetValue<string>(); 1311Assert.Equal("value1", result.GetValue<string>()); 1321var dictHandle = (dictResult as JsonObject)?["$handle"]?.GetValue<string>(); 1333Assert.Equal(10, result.GetValue<int>()); 1343var dictHandle = (dictResult as JsonObject)?["$handle"]?.GetValue<string>(); 1355Assert.Equal("one", result.GetValue<string>()); 1366var dictHandle = (dictResult as JsonObject)?["$handle"]?.GetValue<string>(); 1378Assert.True(removeResult.GetValue<bool>()); 1388Assert.Equal(1, countResult.GetValue<int>()); 1399var dictHandle = (dictResult as JsonObject)?["$handle"]?.GetValue<string>(); 1411Assert.True(hasResult.GetValue<bool>()); 1422Assert.False(hasResult2.GetValue<bool>()); 1433var dictHandle = (dictResult as JsonObject)?["$handle"]?.GetValue<string>(); 1447Assert.Contains("key1", keysArray.Select(k => k?.GetValue<string>())); 1448Assert.Contains("key2", keysArray.Select(k => k?.GetValue<string>())); 1458var dictHandle = (dictResult as JsonObject)?["$handle"]?.GetValue<string>(); 1471Assert.Contains(1, keysArray.Select(k => k?.GetValue<int>())); 1472Assert.Contains(2, keysArray.Select(k => k?.GetValue<int>())); 1482var dictHandle = (dictResult as JsonObject)?["$handle"]?.GetValue<string>(); 1502var dictHandle = (dictResult as JsonObject)?["$handle"]?.GetValue<string>(); 1513Assert.Equal(2, result.GetValue<int>()); 1530Assert.Equal("Received: ValueB", result.GetValue<string>()); 1547Assert.Equal("Received: ValueC", result.GetValue<string>()); 1564Assert.Equal("ValueA", result.GetValue<string>()); 1581Assert.Equal("Received: ValueB", result.GetValue<string>()); 1593Assert.Equal("No value", result.GetValue<string>()); 1682Assert.Equal("blue", result.GetValue<string>()); 1723Assert.Equal("hello, test-resource!", result.GetValue<string>()); 1740Assert.Equal("yellow", result.GetValue<string>()); 1757Assert.Equal("my-resource", result.GetValue<string>()); 2100Assert.Equal("Host", result.GetValue<string>());
ExternalCapabilityRegistryTests.cs (18)
29relayId = args!["configure"]!.GetValue<string>(); 113Assert.Equal("configured", (await registry.TryInvokeAsync("test.external/value", null)).Result!.GetValue<string>()); 188relayId = args!["configure"]!.GetValue<string>(); 194return Task.FromResult<JsonNode?>(JsonValue.Create($"deferred-{args!["p0"]!.GetValue<string>()}")); 203Assert.Equal("deferred-configured", result!.GetValue<string>()); 299relayId = args!["configure"]!.GetValue<string>(); 323Assert.Equal("completed", result!.GetValue<string>()); 356relayId = args!["configure"]!.GetValue<string>(); 512Assert.Equal("replacement", (await registry.TryInvokeAsync("test.external/value", null)).Result!.GetValue<string>()); 513Assert.Equal("other", (await registry.TryInvokeAsync("test.external/other", null)).Result!.GetValue<string>()); 619Assert.Equal("first-replacement", (await registry.TryInvokeAsync("test.external/first", null)).Result!.GetValue<string>()); 620Assert.Equal("second-replacement", (await registry.TryInvokeAsync("test.external/second", null)).Result!.GetValue<string>()); 631request.TrySetResult(args!["configure"]!.GetValue<string>()); 664var isFirst = args!["name"]!.GetValue<string>() == "first"; 665(isFirst ? firstRequest : secondRequest).TrySetResult(args["configure"]!.GetValue<string>()); 685Assert.Equal("guest_callback", firstArgs["configure"]!.GetValue<string>()); 686Assert.Equal("guest_callback", secondArgs["configure"]!.GetValue<string>()); 716relayId = args!["configure"]!.GetValue<string>();
HandleRegistryTests.cs (2)
171Assert.Equal("aspire/TestObject", json["$type"]!.GetValue<string>()); 173var handleId = json["$handle"]!.GetValue<string>();
JsonRpcCallbackInvokerTests.cs (1)
82Assert.Equal("responsive", result.GetValue<string>());
Aspire.Hosting.Tests (95)
Backchannel\AuxiliaryBackchannelRpcTargetTests.cs (13)
326Assert.Equal("normal-value", normalJsonValue.GetValue<string>()); 1278Assert.Equal("42", Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["number"]).GetValue<string>()); 1279Assert.Equal(bool.TrueString, Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["flag"]).GetValue<string>()); 1280Assert.Equal("one,two", Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["list"]).GetValue<string>()); 1325Assert.Equal(42, Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["number"]).GetValue<int>()); 1326Assert.True(Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["flag"]).GetValue<bool>()); 1330value => Assert.Equal("one", value?.GetValue<string>()), 1331value => Assert.Equal("two", value?.GetValue<string>())); 1333Assert.Equal("localhost", nameValueObject["Host"]?.GetValue<string>()); 1334Assert.Equal("catalogdb", nameValueObject["DatabaseName"]?.GetValue<string>()); 1370Assert.Equal("true", Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["terminal.enabled"]).GetValue<string>()); 1371Assert.Equal("0", Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["terminal.replicaIndex"]).GetValue<string>()); 1372Assert.Equal("1", Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["terminal.replicaCount"]).GetValue<string>());
DotnetProgramPublishingTests.cs (3)
165Assert.Equal("project.v0", manifest["type"]?.GetValue<string>()); 166Assert.Equal("program.csproj", manifest["path"]?.GetValue<string>()); 169manifest["args"]?.AsArray().Select(static value => value!.GetValue<string>()));
Orchestrator\ParameterProcessorTests.cs (12)
1314Assert.Equal("firstValue", savedValueNode?.GetValue<string>()); 1320Assert.Equal("secondValue", savedValueNode?.GetValue<string>()); 1347Assert.Equal("newValue", savedValueNode?.GetValue<string>()); 1503Assert.Equal("saved-value", stateManager.State[parameter.ConfigurationKey]?.GetValue<string>()); 1532Assert.Equal("form-value", stateManager.State[secondParameter.ConfigurationKey]?.GetValue<string>()); 1729Assert.Equal("Server=localhost;Database=mydb", valueNode?.GetValue<string>()); 1770Assert.Equal("myvalue", valueNode?.GetValue<string>()); 1814Assert.Equal("customvalue", valueNode?.GetValue<string>()); 1853Assert.Equal("savedValue", savedValueNode?.GetValue<string>()); 1871Assert.Equal("savedValue", savedValueNode?.GetValue<string>()); 1939Assert.Equal("programmaticValue", savedValueNode?.GetValue<string>()); 2093Assert.Equal("old-value", stateManager.State[configurationKey]?.GetValue<string>());
Publishing\DeploymentStateManagerTests.cs (67)
48Assert.Equal("value1", section2.Data["key1"]?.GetValue<string>()); 117Assert.Equal("value1", parametersCheck.Data["param1"]?.GetValue<string>()); 118Assert.Equal("azure-value1", azureCheck.Data["resource1"]?.GetValue<string>()); 146Assert.Equal($"value{i}", section.Data[$"key{i}"]?.GetValue<string>()); 165Assert.Equal("value1", section2.Data["key1"]?.GetValue<string>()); 186Assert.Equal("value1", section2.Data["key1"]?.GetValue<string>()); 199Assert.Equal("value1", section3.Data["key1"]?.GetValue<string>()); 200Assert.Equal("value2", section3.Data["key2"]?.GetValue<string>()); 238Assert.Equal("value1", parametersSection.Data["param1"]?.GetValue<string>()); 239Assert.Equal("azure-value1", azureSection.Data["resource1"]?.GetValue<string>()); 240Assert.Equal("value1", restartedParametersSection.Data["param1"]?.GetValue<string>()); 257Assert.Equal("value1", retrievedSection.Data["key1"]?.GetValue<string>()); 274Assert.Equal("nestedValue", verifySection.Data["nestedKey"]?.GetValue<string>()); 294Assert.Equal("value1", verify1.Data["key1"]?.GetValue<string>()); 295Assert.Equal("value2", verify2.Data["key2"]?.GetValue<string>()); 311Assert.Equal("value1", verify.Data[""]?.GetValue<string>()); 371Assert.Equal("topValue", verifyTop.Data["topKey"]?.GetValue<string>()); 372Assert.Equal("nestedValue", verifyNested.Data["nestedKey"]?.GetValue<string>()); 478Assert.True(migratedSection.Data["legacy"]?.GetValue<bool>()); 490Assert.True(currentSection.Data["legacy"]?.GetValue<bool>()); 491Assert.True(currentSection.Data["current"]?.GetValue<bool>()); 533Assert.Equal("legacy", legacyAfterRestart.Data["Value"]?.GetValue<string>()); 534Assert.Equal("current", replacementAfterRestart.Data["Value"]?.GetValue<string>()); 556Assert.Equal("committed", restartedSection.Data["Value"]?.GetValue<string>()); 594Assert.Equal("legacy", parameterSection.Data[""]?.GetValue<string>()); 621Assert.Equal("existing", section.Data[""]?.GetValue<string>()); 627Assert.Equal("existing", restartedSection.Data[""]?.GetValue<string>()); 658Assert.Equal("updated", restartedSection.Data[""]?.GetValue<string>()); 690Assert.Equal("updated", restartedSection.Data["Leaf"]?.GetValue<string>()); 720Assert.True(features["A"]?.GetValue<bool>()); 721Assert.True(features["B"]?.GetValue<bool>()); 754Assert.Equal("first-sandbox", migratedFirstSection.Data["SandboxId"]?.GetValue<string>()); 755Assert.True(migratedFirstSection.Data["Migrated"]?.GetValue<bool>()); 767Assert.True(restartedFirstSection.Data["Migrated"]?.GetValue<bool>()); 768Assert.Equal("second-sandbox", restartedSecondSection.Data["SandboxId"]?.GetValue<string>()); 773Assert.Equal("second-sandbox", secondSection.Data["SandboxId"]?.GetValue<string>()); 783Assert.Equal("first-sandbox", clearedFirstLegacySection.Data["SandboxId"]?.GetValue<string>()); 784Assert.Equal("second-sandbox", preservedSecondLegacySection.Data["SandboxId"]?.GetValue<string>()); 808Assert.Equal("current-subscription", currentAzureSection.Data["SubscriptionId"]?.GetValue<string>()); 813Assert.Equal("current-subscription", restartedAzureSection.Data["SubscriptionId"]?.GetValue<string>()); 814Assert.Equal("first-sandbox", restartedAzureSection.Data["Sandboxes"]?["first"]?["SandboxId"]?.GetValue<string>()); 815Assert.Equal("second-sandbox", restartedAzureSection.Data["Sandboxes"]?["second"]?["SandboxId"]?.GetValue<string>()); 851restartedAzureSection.Data["Sandboxes"]?["new"]?["SandboxId"]?.GetValue<string>()); 896restartedSandboxesSection.Data["first"]?["new"]?["SandboxId"]?.GetValue<string>()); 899restartedSandboxesSection.Data["second"]?["SandboxId"]?.GetValue<string>()); 935Assert.Equal("first-sandbox", restartedFirstSection.Data["SandboxId"]?.GetValue<string>()); 936Assert.True(restartedFirstSection.Data["Updated"]?.GetValue<bool>()); 937Assert.Equal("second-sandbox", restartedSecondSection.Data["SandboxId"]?.GetValue<string>()); 938Assert.True(restartedSecondSection.Data["Updated"]?.GetValue<bool>()); 968Assert.Equal("current-subscription", restartedAzureSection.Data["SubscriptionId"]?.GetValue<string>()); 969Assert.Equal("current-location", restartedAzureSection.Data["Location"]?.GetValue<string>()); 972Assert.Equal("current-subscription", currentAzureSection.Data["SubscriptionId"]?.GetValue<string>()); 973Assert.Equal("current-location", currentAzureSection.Data["Location"]?.GetValue<string>()); 1003Assert.Equal("sub", preservedLegacySection.Data["SubscriptionId"]?.GetValue<string>()); 1033Assert.Equal("current-sub", asyncEffectiveState["Azure"]?["SubscriptionId"]?.GetValue<string>()); 1034Assert.Equal("current-sub", syncEffectiveState["Azure"]?["SubscriptionId"]?.GetValue<string>()); 1035Assert.Equal("current-sub", migratedSection.Data["SubscriptionId"]?.GetValue<string>()); 1057Assert.Equal("current-sub", asyncEffectiveState["Azure"]?["SubscriptionId"]?.GetValue<string>()); 1058Assert.Equal("current-sub", syncEffectiveState["Azure"]?["SubscriptionId"]?.GetValue<string>()); 1059Assert.Equal("current-sub", restartedSection.Data["SubscriptionId"]?.GetValue<string>()); 1065Assert.Equal("current-sub", savedSection.Data["SubscriptionId"]?.GetValue<string>()); 1066Assert.Equal("westus", savedSection.Data["Location"]?.GetValue<string>()); 1084Assert.Equal("sub", currentSection.Data["SubscriptionId"]?.GetValue<string>()); 1135.Data["SandboxId"]?.GetValue<string>()); 1139.Data["SubscriptionId"]?.GetValue<string>()); 1176.Data["SandboxId"]?.GetValue<string>()); 1180.Data["SandboxId"]?.GetValue<string>());
ConfigurationSchemaGenerator (1)
ConfigSchemaEmitter.cs (1)
450if (propertyNodeType?.GetValueKind() == JsonValueKind.String && propertyNodeType.GetValue<string>() == "boolean")
dotnet-user-jwts (1)
Helpers\SigningKeysHandler.cs (1)
85var toRemove = signingKeys.SingleOrDefault(key => key["Issuer"].GetValue<string>() == issuer);
GenerateTemplateManifest (4)
TemplateRestorePlan.cs (4)
105symbol?["replaces"]?.GetValue<string>() is { Length: > 0 } replacement && 116foreach (var (name, symbol) in symbols.Where(s => included.Contains(s.Key) && s.Value?["type"]?.GetValue<string>() == "parameter")) 118string[] values = symbol!["datatype"]?.GetValue<string>() switch 121"choice" => symbol["choices"]!.AsArray().Select(c => c!["choice"]!.GetValue<string>()).ToArray(),
Infrastructure.Tests (4)
Pipelines\NixCliPackageTests.cs (1)
265return Assert.IsAssignableFrom<JsonValue>(value).GetValue<string>();
Pipelines\NpmCliPackageTests.cs (3)
779return jsonObject[propertyName]?.GetValue<string>() 785return jsonNode?.AsArray().Select(value => value?.GetValue<string>() ?? throw new InvalidOperationException("JSON array contains a null value.")).ToArray() 793property => property.Value?.GetValue<string>() ?? throw new InvalidOperationException($"JSON property '{property.Key}' is not a string."),
Microsoft.AspNetCore.OpenApi (7)
Extensions\JsonNodeSchemaExtensions.cs (6)
383var defaultValue = defaultNode.GetValue<string>(); 388if (serialized?.GetValue<string>() == defaultValue) 510!string.IsNullOrEmpty(schemaIdNode.GetValue<string>())); 597if (typeArray[i]?.GetValue<string>() == "null") 604schema[OpenApiSchemaKeywords.TypeKeyword] = typeArray[0]?.GetValue<string>(); 618if (Enum.TryParse<JsonSchemaType>(jsonNode?.GetValue<string>(), true, out var openApiSchemaType))
Services\Schemas\OpenApiSchemaService.cs (1)
282if (rawEnum[i]?.GetValue<string>() != memberNames[i])
Microsoft.Extensions.AI.Abstractions (8)
Utilities\AIJsonUtilities.Schema.Create.cs (7)
295string refUri = paramName!.GetValue<string>(); 346string typeValue = typeKeyWord.GetValue<string>()!; 367string typeValue = typeKeyWord.GetValue<string>()!; 582if (entry?.GetValue<string>() == propertyName) 724schemaType = typeNode.GetValue<string>(); 736string entryValue = entry.GetValue<string>(); 789entry.GetValue<string>() is string type)
Utilities\AIJsonUtilities.Schema.Transform.cs (1)
180string? description = schemaObj.TryGetPropertyValue(DescriptionPropertyName, out JsonNode? descriptionSchema) ? descriptionSchema?.GetValue<string>() : null;
Microsoft.Extensions.AI.Abstractions.Tests (1)
Contents\FunctionCallContentTests.cs (1)
111Assert.Equal(informationalOnly, informationalOnlyValue!.GetValue<bool>());
Microsoft.Extensions.AI.OpenAI (1)
OpenAIClientExtensions.cs (1)
92$"{descriptionNode.GetValue<string>()}{Environment.NewLine}{additionalDescription}" :
Microsoft.ML.AutoML (9)
SweepableEstimator\Converter\MultiModelPipelineConverter.cs (2)
18var schema = jValue["schema"].GetValue<string>(); 19var estimators = jValue["estimator"].GetValue<Dictionary<string, SweepableEstimator>>();
SweepableEstimator\Converter\SweepableEstimatorConverter.cs (2)
19var estimatorType = jsonObject["estimatorType"].GetValue<EstimatorType>(); 20var parameter = jsonObject["parameter"].GetValue<Parameter>();
SweepableEstimator\Converter\SweepableEstimatorPipelineConverter.cs (2)
18var parameter = jNode["parameter"].GetValue<Parameter>(); 19var estimators = jNode["estimators"].GetValue<SweepableEstimator[]>();
SweepableEstimator\Converter\SweepablePipelineConverter.cs (3)
18var currentSchema = jValue["currentSchema"].GetValue<string>(); 19var schema = jValue["schema"].GetValue<string>(); 20var estimators = jValue["estimator"].GetValue<Dictionary<string, SweepableEstimator>>();
Microsoft.ML.AutoML.SourceGenerator (20)
SearchSpaceGenerator.cs (20)
39var className = Utils.ToTitleCase(jNode["name"].GetValue<string>()); 43var optionName = Utils.ToTitleCase(t["name"].GetValue<string>()); 44string optionTypeName = t["type"].GetValue<string>() switch 69(_, "string") => $"\"{defaultToken.GetValue<string>()}\"", 70(_, "int") => $"{defaultToken.GetValue<int>().ToString(CultureInfo.InvariantCulture)}", 71(_, "double") => $"{defaultToken.GetValue<double>().ToString(CultureInfo.InvariantCulture)}", 72(_, "float") => $"{defaultToken.GetValue<float>().ToString(CultureInfo.InvariantCulture)}F", 73(_, "bool") => defaultToken.GetValue<bool>() ? "true" : "false", 74(_, "Anchor") => defaultToken.GetValue<string>(), 75(_, "ResizingKind") => defaultToken.GetValue<string>(), 76(_, "ColorBits") => defaultToken.GetValue<string>(), 77(_, "ColorsOrder") => defaultToken.GetValue<string>(), 78(_, "BertArchitecture") => defaultToken.GetValue<string>(), 79(_, "Microsoft.ML.Vision.ImageClassificationTrainer.Architecture") => defaultToken.GetValue<string>(), 80(_, "Microsoft.ML.Data.DataKind") => defaultToken.GetValue<string>(), 81(_, "Microsoft.ML.IDataView") => defaultToken.GetValue<string>(), 82(_, "Microsoft.ML.Transforms.Text.TextNormalizingEstimator.CaseMode") => defaultToken.GetValue<string>(), 97var minValue = searchSpaceNode["min"].GetValue<double>(); 98var maxValue = searchSpaceNode["max"].GetValue<double>(); 99var logBase = searchSpaceObject.ContainsKey("log_base") is false ? "false" : searchSpaceNode["log_base"].GetValue<bool>() ? "true" : "false";
Microsoft.NET.Build.Containers (5)
ImageConfig.cs (5)
70internal string[]? GetEntrypoint() => _config["config"]?["Entrypoint"]?.AsArray()?.Select(node => node!.GetValue<string>())?.ToArray(); 71private string[]? GetCmd() => _config["config"]?["Entrypoint"]?.AsArray()?.Select(node => node!.GetValue<string>())?.ToArray(); 289string[] val = entry.GetValue<string>().Split('=', 2); 337if (rootfs["type"]?.GetValue<string>() == "layers" && rootfs["diff_ids"] is JsonArray layers) 339return layers.Select(l => l!.GetValue<string>()).ToList();
Microsoft.TemplateEngine.Cli (13)
Alias\AliasRegistry.cs (2)
203result[property.Key] = new List<string>() { property.Value.GetValue<string>() }; 212values.Add(item.GetValue<string>());
HostSpecificTemplateData.cs (3)
33.Select(v => v!.GetValue<string>())); 59JsonValueKind.String => symbolProperty.Value.GetValue<string>(), 80else if (kind == JsonValueKind.String && bool.TryParse(isHiddenNode.GetValue<string>(), out bool hidden))
JExtensions.cs (5)
30return val.GetValue<string>(); 47return element.GetValue<string>(); 91return bool.TryParse(token.GetValue<string>(), out result); 210values.Add(item.GetValue<string>()); 262return int.TryParse(token.GetValue<string>(), out result);
PostActionProcessors\ChmodPostActionProcessor.cs (1)
30values[i] = valueArray[i]?.GetValue<string>() ?? "";
PostActionProcessors\PostActionProcessorBase.cs (2)
134paths = config.GetValue<string>().Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries); 145.Select(token => token!.GetValue<string>()).ToList();
Microsoft.TemplateEngine.Edge (19)
BuiltInManagedProvider\GlobalSettings.cs (1)
91package![nameof(TemplatePackageData.LastChangeTime)]?.GetValue<DateTime>() ?? default,
Constraints\ConstraintsExtensions.cs (2)
24return new[] { token.GetValue<string>() ?? throw new ConfigurationException(string.Format(LocalizableStrings.Constraint_Error_ArgumentHasEmptyString, args)) }; 36string? strValue = value.GetValue<string>();
parent\Shared\JExtensions.cs (8)
38return val.GetValue<string>(); 57return strVal.GetValue<string>(); 104return bool.TryParse(token.GetValue<string>(), out result); 139return int.TryParse(token.GetValue<string>(), out result); 305result[property.Key] = property.Value.GetValue<string>(); 382values.Add(item.GetValue<string>()); 407if (Guid.TryParse(item.GetValue<string>(), out Guid val)) 478string tokenValue = token.GetValue<string>();
Settings\SettingsStore.cs (3)
29ComponentGuidToAssemblyQualifiedName[entry.Key] = entry.Value.GetValue<string>(); 43ProbingPaths.Add(path.GetValue<string>()); 64if (Guid.TryParse(value.GetValue<string>(), out Guid id))
Settings\TemplateCache.cs (2)
92? localeToken!.GetValue<string>() 103mountPointInfo.Add(entry.Key, entry.Value.GetValue<DateTime>());
Settings\TemplateInfoReader.cs (3)
39classifications.Add(item.GetValue<string>()); 100tags.Add(item.Key, item.Value?.GetValue<string>() ?? string.Empty); 112if (item != null && Guid.TryParse(item.GetValue<string>(), out Guid id))
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (10)
LocalizationModelDeserializer.cs (1)
32.Select(p => p.Value?.GetValueKind() == JsonValueKind.String ? (p.Key, p.Value.GetValue<string>()) : throw new Exception(LocalizableStrings.Authoring_InvalidJsonElementInLocalizationFile))
Macros\BaseMacroConfig.cs (1)
127return val.GetValueKind() == JsonValueKind.String ? val.GetValue<string>() : val.ToJsonString();
parent\Shared\JExtensions.cs (8)
38return val.GetValue<string>(); 57return strVal.GetValue<string>(); 104return bool.TryParse(token.GetValue<string>(), out result); 139return int.TryParse(token.GetValue<string>(), out result); 305result[property.Key] = property.Value.GetValue<string>(); 382values.Add(item.GetValue<string>()); 407if (Guid.TryParse(item.GetValue<string>(), out Guid val)) 478string tokenValue = token.GetValue<string>();
Microsoft.TemplateEngine.Utils (8)
parent\Shared\JExtensions.cs (8)
38return val.GetValue<string>(); 57return strVal.GetValue<string>(); 104return bool.TryParse(token.GetValue<string>(), out result); 139return int.TryParse(token.GetValue<string>(), out result); 305result[property.Key] = property.Value.GetValue<string>(); 382values.Add(item.GetValue<string>()); 407if (Guid.TryParse(item.GetValue<string>(), out Guid val)) 478string tokenValue = token.GetValue<string>();
Microsoft.TemplateSearch.Common (8)
parent\Shared\JExtensions.cs (8)
38return val.GetValue<string>(); 57return strVal.GetValue<string>(); 104return bool.TryParse(token.GetValue<string>(), out result); 139return int.TryParse(token.GetValue<string>(), out result); 305result[property.Key] = property.Value.GetValue<string>(); 382values.Add(item.GetValue<string>()); 407if (Guid.TryParse(item.GetValue<string>(), out Guid val)) 478string tokenValue = token.GetValue<string>();
sdk-tasks (1)
UpdateRuntimeConfig.cs (1)
58var name = framework["name"]!.GetValue<string>();
System.Text.Json (36)
System\Text\Json\Nodes\JsonArray.cs (2)
137/// Returns an enumerable that wraps calls to <see cref="JsonNode.GetValue{T}"/>. 145yield return item is null ? (T)(object?)null! : item.GetValue<T>();
System\Text\Json\Nodes\JsonNode.Operators.cs (33)
255public static explicit operator bool(JsonNode value) => value.GetValue<bool>(); 262public static explicit operator bool?(JsonNode? value) => value?.GetValue<bool>(); 269public static explicit operator byte(JsonNode value) => value.GetValue<byte>(); 276public static explicit operator byte?(JsonNode? value) => value?.GetValue<byte>(); 283public static explicit operator char(JsonNode value) => value.GetValue<char>(); 290public static explicit operator char?(JsonNode? value) => value?.GetValue<char>(); 297public static explicit operator DateTime(JsonNode value) => value.GetValue<DateTime>(); 304public static explicit operator DateTime?(JsonNode? value) => value?.GetValue<DateTime>(); 311public static explicit operator DateTimeOffset(JsonNode value) => value.GetValue<DateTimeOffset>(); 318public static explicit operator DateTimeOffset?(JsonNode? value) => value?.GetValue<DateTimeOffset>(); 325public static explicit operator decimal(JsonNode value) => value.GetValue<decimal>(); 332public static explicit operator decimal?(JsonNode? value) => value?.GetValue<decimal>(); 339public static explicit operator double(JsonNode value) => value.GetValue<double>(); 346public static explicit operator double?(JsonNode? value) => value?.GetValue<double>(); 353public static explicit operator Guid(JsonNode value) => value.GetValue<Guid>(); 360public static explicit operator Guid?(JsonNode? value) => value?.GetValue<Guid>(); 367public static explicit operator short(JsonNode value) => value.GetValue<short>(); 374public static explicit operator short?(JsonNode? value) => value?.GetValue<short>(); 381public static explicit operator int(JsonNode value) => value.GetValue<int>(); 388public static explicit operator int?(JsonNode? value) => value?.GetValue<int>(); 395public static explicit operator long(JsonNode value) => value.GetValue<long>(); 402public static explicit operator long?(JsonNode? value) => value?.GetValue<long>(); 410public static explicit operator sbyte(JsonNode value) => value.GetValue<sbyte>(); 418public static explicit operator sbyte?(JsonNode? value) => value?.GetValue<sbyte>(); 425public static explicit operator float(JsonNode value) => value.GetValue<float>(); 432public static explicit operator float?(JsonNode? value) => value?.GetValue<float>(); 439public static explicit operator string?(JsonNode? value) => value?.GetValue<string>(); 447public static explicit operator ushort(JsonNode value) => value.GetValue<ushort>(); 455public static explicit operator ushort?(JsonNode? value) => value?.GetValue<ushort>(); 463public static explicit operator uint(JsonNode value) => value.GetValue<uint>(); 471public static explicit operator uint?(JsonNode? value) => value?.GetValue<uint>(); 479public static explicit operator ulong(JsonNode value) => value.GetValue<ulong>(); 487public static explicit operator ulong?(JsonNode? value) => value?.GetValue<ulong>();
System\Text\Json\Nodes\JsonValue.cs (1)
32/// <seealso cref="JsonNode.GetValue{T}"></seealso>