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>()
1011 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)
745if (!TryParseHostPort(https["applicationUrl"]?.GetValue<string>(), "https", out var dashboardHttps) 746|| !TryParseHostPort(http["applicationUrl"]?.GetValue<string>(), "http", out var dashboardHttp) 747|| !TryParseHostPort(httpsEnv[KnownConfigNames.DashboardOtlpGrpcEndpointUrl]?.GetValue<string>(), "https", out var otlpHttps) 748|| !TryParseHostPort(httpEnv[KnownConfigNames.DashboardOtlpGrpcEndpointUrl]?.GetValue<string>(), "http", out var otlpHttp) 749|| !TryParseHostPort(httpsEnv[KnownConfigNames.ResourceServiceEndpointUrl]?.GetValue<string>(), "https", out var resourceServiceHttps) 750|| !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)
219predicateType = 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)
103Assert.Equal("staging", updatedConfig["channel"]?.GetValue<string>());
SingleFileAppHostInitDotnetRunTests.cs (4)
87Assert.Equal("Project", httpsProfile["commandName"]?.GetValue<string>()); 88Assert.False(string.IsNullOrWhiteSpace(httpsProfile["applicationUrl"]?.GetValue<string>())); 91Assert.False(string.IsNullOrWhiteSpace(httpsEnv["ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL"]?.GetValue<string>())); 92Assert.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 (235)
Agents\CopilotAgentEnvironmentScannerTests.cs (6)
73Assert.Equal("local", aspireServer["type"]?.GetValue<string>()); 74Assert.Equal("aspire", aspireServer["command"]?.GetValue<string>()); 79Assert.Equal("agent", args[0]?.GetValue<string>()); 80Assert.Equal("mcp", args[1]?.GetValue<string>()); 86Assert.Equal("${DOTNET_ROOT}", env["DOTNET_ROOT"]?.GetValue<string>()); 92Assert.Equal("*", tools[0]?.GetValue<string>());
Agents\VsCodeAgentEnvironmentScannerTests.cs (6)
157Assert.Equal("stdio", aspireServer["type"]?.GetValue<string>()); 158Assert.Equal("aspire", aspireServer["command"]?.GetValue<string>()); 163Assert.Equal("agent", args[0]?.GetValue<string>()); 164Assert.Equal("mcp", args[1]?.GetValue<string>()); 250Assert.Equal("stdio", aspireServer["type"]?.GetValue<string>()); 251Assert.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\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>()); 870Assert.Equal("apphost.cs", merged["appHost"]!.AsObject()["path"]!.GetValue<string>()); 872Assert.Equal("stable", merged["channel"]!.GetValue<string>()); 873Assert.True(merged["features"]!.AsObject()["polyglotSupportEnabled"]!.GetValue<bool>()); 1323Assert.Equal(contextChannel, config["channel"]!.GetValue<string>()); 1356Assert.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)
1766Assert.Equal("browser", argumentInputs[0]!["name"]!.GetValue<string>()); 1767Assert.Equal("Chrome", argumentInputs[0]!["value"]!.GetValue<string>()); 1768Assert.Equal("profile", argumentInputs[1]!["name"]!.GetValue<string>()); 1769Assert.Equal("Default", argumentInputs[1]!["options"]!["Default"]!.GetValue<string>()); 2295Assert.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)
313Assert.Equal("true", node.GetValue<string>()); 336Assert.Equal("true", node.GetValue<string>()); 356Assert.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)
199Assert.Equal("api-service-instance-1", firstLog["resourceName"]?.GetValue<string>()); 200Assert.Equal(42, firstLog["logId"]?.GetValue<long>()); 207Assert.Equal("http://localhost:18888/structuredlogs?logEntryId=42", firstLog["dashboardUrl"]?.GetValue<string>()); 212Assert.Equal("api-service-instance-2", secondLog["resourceName"]?.GetValue<string>()); 213Assert.Equal(43, secondLog["logId"]?.GetValue<long>()); 218Assert.Equal("http://localhost:18888/structuredlogs?logEntryId=43", secondLog["dashboardUrl"]?.GetValue<string>()); 223Assert.Equal("worker-service", thirdLog["resourceName"]?.GetValue<string>()); 224Assert.Equal(44, thirdLog["logId"]?.GetValue<long>()); 226Assert.Equal("http://localhost:18888/structuredlogs?logEntryId=44", thirdLog["dashboardUrl"]?.GetValue<string>());
Mcp\ListTracesToolTests.cs (11)
172Assert.Equal("abc123def456789012345678901234567890", firstTrace["traceId"]?.GetValue<string>()); 180Assert.Equal("http://localhost:18888/traces/detail/abc123def456789012345678901234567890", firstTrace["dashboardUrl"]?.GetValue<string>()); 183var serverSpan = spans.FirstOrDefault(s => s?["kind"]?.GetValue<string>() == "Server")?.AsObject(); 185Assert.Equal("api-service-instance-1", serverSpan["source"]?.GetValue<string>()); 189var clientSpan = spans.FirstOrDefault(s => s?["kind"]?.GetValue<string>() == "Client")?.AsObject(); 191Assert.Equal("api-service-instance-2", clientSpan["source"]?.GetValue<string>()); 192Assert.Equal("catalog-service", clientSpan["destination"]?.GetValue<string>()); 197Assert.Equal("xyz789abc123456789012345678901234567890", secondTrace["traceId"]?.GetValue<string>()); 199Assert.Equal("http://localhost:18888/traces/detail/xyz789abc123456789012345678901234567890", secondTrace["dashboardUrl"]?.GetValue<string>()); 209Assert.Equal("Internal", internalSpan["kind"]?.GetValue<string>()); 210Assert.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>()));
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)
200value = jsonValue.GetValue<string>();
Pipelines\Internal\FileDeploymentStateManager.cs (3)
748var legacyFallbackDisabled = migrationState[LegacyFallbackDisabledProperty]?.GetValue<bool>() ?? false; 764JsonValue stateValue => JsonNode.Parse(stateValue.GetValue<string>())?.AsObject() 775claimedSectionsValue.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)
1857var subscriptionId = section.Data["SubscriptionId"]?.GetValue<string>(); 1858var resourceGroupName = section.Data["ResourceGroup"]?.GetValue<string>(); 2499deployment.TryGetPropertyValue("resourceId", out var resourceIdNode) ? resourceIdNode?.GetValue<string>() : null, 2510var deploymentId = section.Data["Id"]?.GetValue<string>(); 2514var outputs = ParseDeploymentStateJson(resource.Name, "Outputs", section.Data["Outputs"]?.GetValue<string>()); 2524["locationOverride"] = section.Data[LocationOverrideKey]?.GetValue<string>(), 2525["checksum"] = section.Data["CheckSum"]?.GetValue<string>(), 2527["scope"] = ParseDeploymentStateJson(resource.Name, "Scope", section.Data["Scope"]?.GetValue<string>()) 2533if (section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>() is { Length: > 0 } provisioningState) 2745if (section.Data[LocationOverrideKey]?.GetValue<string>() is { Length: > 0 } locationOverride) 2764if (section.Data[LocationOverrideKey]?.GetValue<string>() is { Length: > 0 } locationOverride) 3092=> section.Data["Id"]?.GetValue<string>() is { Length: > 0 } deploymentId ? deploymentId : null; 3096section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>(), 3157if (section.Data["Parameters"]?.GetValue<string>() is not { Length: > 0 } parametersJson) 3164var persistedLocation = AzureProvisioningJsonHelpers.ParseDeploymentStateJson(parametersJson)?[AzureBicepResource.KnownParameters.Location]?["value"]?.GetValue<string>(); 3188=> section.Data[LocationOverrideKey]?.GetValue<string>() is { Length: > 0 } locationOverride ? locationOverride : null; 3371section.Data["SubscriptionId"]?.GetValue<string>() ?? provisionerOptions.Value.SubscriptionId ?? configuration["Azure:SubscriptionId"], 3372section.Data["ResourceGroup"]?.GetValue<string>() ?? provisionerOptions.Value.ResourceGroup ?? configuration["Azure:ResourceGroup"], 3373section.Data["Location"]?.GetValue<string>() ?? provisionerOptions.Value.Location ?? configuration["Azure:Location"], 3374section.Data["TenantId"]?.GetValue<string>() ?? provisionerOptions.Value.TenantId ?? configuration["Azure:TenantId"], 3375section.Data["Tenant"]?.GetValue<string>()); 3393if (section.Data["Outputs"]?.GetValue<string>() is not { Length: > 0 } outputsJson) 3402return AzureProvisioningJsonHelpers.ParseDeploymentStateJson(outputsJson)?["id"]?["value"]?.GetValue<string>(); 3512if (section.Data[LocationOverrideKey]?.GetValue<string>() is { Length: > 0 } locationOverride) 3519if (section.Data["Parameters"]?.GetValue<string>() is not { Length: > 0 } parametersJson) 3526return AzureProvisioningJsonHelpers.ParseDeploymentStateJson(parametersJson)?[AzureBicepResource.KnownParameters.Location]?["value"]?.GetValue<string>(); 3815section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>(),
Provisioning\BicepUtilities.cs (2)
127if (section.Data[DeploymentStateParametersKey]?.GetValue<string>() is not { Length: > 0 } jsonString) 135var scope = section.Data[DeploymentStateScopeKey]?.GetValue<string>() is { Length: > 0 } scopeString
Provisioning\Internal\RunModeProvisioningContextProvider.cs (5)
237if (data["Location"]?.GetValue<string>() is { Length: > 0 } location) 242if (data["SubscriptionId"]?.GetValue<string>() is { Length: > 0 } subscriptionId) 247if (data["ResourceGroup"]?.GetValue<string>() is { Length: > 0 } resourceGroup) 252if (data["TenantId"]?.GetValue<string>() is { Length: > 0 } tenantId) 269JsonValueKind.String when bool.TryParse(value.GetValue<string>(), out var parsedValue) => parsedValue,
Provisioning\Provisioners\BicepProvisioner.cs (19)
60if (stateSection.Data[DeploymentStateProvisioningStateKey]?.GetValue<string>() is { Length: > 0 } provisioningState && 68var configCheckSum = stateSection.Data[BicepUtilities.DeploymentStateChecksumKey]?.GetValue<string>(); 84if (stateSection.Data[BicepUtilities.DeploymentStateOutputsKey]?.GetValue<string>() is { Length: > 0 } outputJson) 119if (stateSection.Data[BicepUtilities.DeploymentStateIdKey]?.GetValue<string>() is { Length: > 0 } configuredDeploymentId && 187stateSection.Data[BicepUtilities.DeploymentStateIdKey]?.GetValue<string>() is not { Length: > 0 } deploymentId || 358stateSection.Data[BicepUtilities.DeploymentStateChecksumKey]?.GetValue<string>() is not { Length: > 0 } checksum) 375var locationOverride = stateSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>(); 455var locationOverride = stateSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>(); 476if (stateSection.Data[key]?.GetValue<string>() is not { Length: > 0 } json) 495stateSection.Data[DeploymentStateProvisioningStateKey]?.GetValue<string>(), 622var canceledLocationOverride = canceledStateSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>(); 679locationOverride = stateSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>(); 797locationOverride = stateSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>(); 855var cachedDeploymentId = stateSection.Data[BicepUtilities.DeploymentStateIdKey]?.GetValue<string>(); 856var cachedChecksum = stateSection.Data[BicepUtilities.DeploymentStateChecksumKey]?.GetValue<string>(); 1487section.Data[key]?.GetValue<string>() is { Length: > 0 } value ? value : null; 1491if (section.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>() is { Length: > 0 } locationOverride) 1496if (section.Data[BicepUtilities.DeploymentStateParametersKey]?.GetValue<string>() is { Length: > 0 } parametersJson) 1500if (JsonNode.Parse(parametersJson)?[AzureBicepResource.KnownParameters.Location]?["value"]?.GetValue<string>() is { Length: > 0 } configuredLocation)
Aspire.Hosting.Azure.Kubernetes (6)
AzureKubernetesEnvironmentResource.AksPipeline.cs (5)
418var scopeJson = deploymentStateSection.Data["Scope"]!.GetValue<string>(); 421scopedSubscription = scope["subscription"]?.GetValue<string>(); 422scopedResourceGroup = scope["resourceGroup"]?.GetValue<string>(); 469var outputsJson = deploymentState["Outputs"]?.GetValue<string>(); 475var resourceId = JsonNode.Parse(outputsJson)?["id"]?["value"]?.GetValue<string>();
AzureKubernetesEnvironmentResource.cs (1)
202return !string.IsNullOrEmpty(deploymentState["ReleaseName"]?.GetValue<string>());
Aspire.Hosting.Azure.Sandboxes (31)
AzureSandboxContainerDeployment.cs (28)
268var previousOwnerId = previousStateSection.Data["OwnerId"]?.GetValue<string>(); 393var pendingSecurityCleanup = previousStateSection.Data["PendingSecurityCleanup"]?.GetValue<bool>() == true; 497if (portStates.FirstOrDefault() is JsonObject firstPort && firstPort["Url"]?.GetValue<string>() is { } publicUrl) 1323var ownerId = stateSection.Data["OwnerId"]?.GetValue<string>(); 1439if (stateSection.Data["OwnerId"]?.GetValue<string>() is { Length: > 0 } ownerId && 1455stateSection.Data["OwnerId"]?.GetValue<string>())) 1595var sandboxId = stateSection.Data["SandboxId"]?.GetValue<string>(); 1608var diskImageId = stateSection.Data["DiskImageId"]?.GetValue<string>(); 1873if (stateSection.Data["ResourceName"]?.GetValue<string>() is { Length: > 0 } resourceName) 1936if (stateSection.Data["OwnerId"]?.GetValue<string>() is { Length: > 0 } previousOwnerId && 1970if (stateSection.Data["OwnerId"]?.GetValue<string>() is { Length: > 0 } previousOwnerId && 2073previousStateSection.Data["HasRuntimeEnvironmentConfiguration"]?.GetValue<bool>() == true || 2075previousStateSection.Data["HasRuntimeCommandConfiguration"]?.GetValue<bool>() == true) 2080if (previousStateSection.Data["PendingSecurityCleanup"]?.GetValue<bool>() == true) 2085var previousFingerprint = previousStateSection.Data["EndpointSecurityFingerprint"]?.GetValue<string>(); 2114var subscriptionId = stateSection.Data["SubscriptionId"]?.GetValue<string>(); 2115var resourceGroup = stateSection.Data["ResourceGroup"]?.GetValue<string>(); 2116var location = stateSection.Data["Location"]?.GetValue<string>(); 2117var sandboxGroup = stateSection.Data["SandboxGroup"]?.GetValue<string>(); 2138!string.IsNullOrWhiteSpace(stateSection.Data["OwnerId"]?.GetValue<string>()) || 2139!string.IsNullOrWhiteSpace(stateSection.Data["SandboxId"]?.GetValue<string>()) || 2140!string.IsNullOrWhiteSpace(stateSection.Data["DiskImageId"]?.GetValue<string>()); 2162if (port["Url"]?.GetValue<string>() is { Length: > 0 } url) 2178if (previousStateSection.Data["DeployId"]?.GetValue<string>() is { Length: > 0 } previousDeployId) 2193if (previousStateSection.Data[stateKey]?.GetValue<string>() is { Length: > 0 } previousId) 2207if (port["Port"]?.GetValue<int>() is { } portNumber) 2216if (stateSection.Data["Port"]?.GetValue<int>() is { } legacyPort) 2305var value = section.Data[name]?.GetValue<string>();
AzureSandboxEndpointPropertyValueProvider.cs (3)
138if (port["Port"]?.GetValue<int>() == sandboxEndpoint.TargetPort) 143if (string.Equals(port["Name"]?.GetValue<string>(), sandboxEndpoint.Name, StringComparison.Ordinal)) 154url = port["Url"]?.GetValue<string>();
Aspire.Hosting.Azure.Tests (155)
AzureBicepProvisionerTests.cs (18)
1021Assert.Equal("westus3", section.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>()); 1083Assert.Equal("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/test-rg/providers/Microsoft.Resources/deployments/storage2", section.Data["Id"]?.GetValue<string>()); 1084Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateRunning, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1338Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateCanceled, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1371Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateCanceled, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1403Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateCanceled, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1438Assert.Equal(deploymentId, section.Data[BicepUtilities.DeploymentStateIdKey]?.GetValue<string>()); 1496Assert.Equal(ResourcesProvisioningState.Failed.ToString(), section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1598Assert.Equal(deploymentId, section.Data[BicepUtilities.DeploymentStateIdKey]?.GetValue<string>()); 1599var outputs = JsonNode.Parse(section.Data[BicepUtilities.DeploymentStateOutputsKey]!.GetValue<string>())!.AsObject(); 1600Assert.Equal("https://storage.blob.core.windows.net/", outputs["blobEndpoint"]?["value"]?.GetValue<string>()); 1678Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateRunning, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1679Assert.Equal(deploymentId, section.Data[BicepUtilities.DeploymentStateIdKey]?.GetValue<string>()); 1707Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateRunning, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1708Assert.Equal(deploymentId, section.Data[BicepUtilities.DeploymentStateIdKey]?.GetValue<string>()); 1733Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateFailed, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1758Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateCanceled, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1792Assert.Equal(deploymentId, section.Data[BicepUtilities.DeploymentStateIdKey]?.GetValue<string>());
AzureDeployerTests.cs (1)
536Assert.Equal("salmonisland-e9e6a567.westus3.azurecontainerapps.io", parameters[reference.Key]!["value"]!.GetValue<string>());
AzureEnvironmentResourceExtensionsTests.cs (126)
368Assert.Contains("orphaned", resultData["warning"]?.GetValue<string>(), StringComparison.Ordinal); 370Assert.Contains(recommendedActions, action => action?["code"]?.GetValue<string>() == "delete-live-resources"); 762Assert.Equal(1, data["resourceCount"]?.GetValue<int>()); 842Assert.Equal(AzureProvisioningController.GetAzureResourceCommandName, data["command"]?.GetValue<string>()); 843Assert.Equal("storage", data["resourceName"]?.GetValue<string>()); 844Assert.Equal("westus2", data["azureLocation"]?.GetValue<string>()); 845Assert.Equal("westus3", data["location"]?.GetValue<string>()); 846Assert.Equal("westus3", data["effectiveLocation"]?.GetValue<string>()); 851Assert.Equal(subscriptionId, azureContext["subscriptionId"]?.GetValue<string>()); 852Assert.Equal(tenantId, azureContext["tenantId"]?.GetValue<string>()); 853Assert.Equal(resourceGroup, azureContext["resourceGroup"]?.GetValue<string>()); 854Assert.Equal("westus2", azureContext["location"]?.GetValue<string>()); 857Assert.True(deployment["hasState"]?.GetValue<bool>()); 858Assert.Equal(deploymentId, deployment["deploymentId"]?.GetValue<string>()); 859Assert.Equal(resourceId, deployment["resourceId"]?.GetValue<string>()); 860Assert.Equal("westus3", deployment["locationOverride"]?.GetValue<string>()); 861Assert.Equal("checksum", deployment["checksum"]?.GetValue<string>()); 862Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateRunning, deployment["provisioningState"]?.GetValue<string>()); 863Assert.Contains("/DeploymentDetailsBlade/", deployment["deploymentPortalUrl"]?.GetValue<string>()); 864Assert.Contains("/resource/subscriptions/", deployment["resourcePortalUrl"]?.GetValue<string>()); 867Assert.Equal("https://storage.blob.core.windows.net/", outputs["blobEndpoint"]?["value"]?.GetValue<string>()); 870Assert.Equal(resourceGroup, scope["resourceGroup"]?.GetValue<string>()); 873Assert.True(live["checked"]?.GetValue<bool>()); 874Assert.True(live["exists"]?.GetValue<bool>()); 926Assert.True(live["checked"]?.GetValue<bool>()); 927Assert.False(live["exists"]?.GetValue<bool>()); 928Assert.Equal("missing-live-resource", live["reason"]?.GetValue<string>()); 929Assert.Equal("azure", live["source"]?.GetValue<string>()); 930Assert.Equal("missing-live-resource", live["code"]?.GetValue<string>()); 931Assert.Contains("resource was not found in Azure", live["message"]?.GetValue<string>(), StringComparison.Ordinal); 933Assert.Contains(recommendedActions, action => action?["code"]?.GetValue<string>() == "reprovision-or-forget-state"); 987Assert.Equal("Microsoft.Storage/storageAccounts", json["resourceType"]?.GetValue<string>()); 988Assert.Equal("storage", json["resourceName"]?.GetValue<string>()); 989Assert.Equal(targetResourceId, json["targetResourceId"]?.GetValue<string>()); 1196Assert.True(deployment["hasState"]?.GetValue<bool>()); 1200Assert.False(live["checked"]?.GetValue<bool>()); 1202Assert.Equal("missing-resource-id", live["reason"]?.GetValue<string>()); 1203Assert.Equal("aspire", live["source"]?.GetValue<string>()); 1204Assert.Equal("missing-resource-id", live["code"]?.GetValue<string>()); 1205Assert.Contains("cached deployment state does not contain a resource ID", live["message"]?.GetValue<string>(), StringComparison.Ordinal); 1207Assert.Contains(recommendedActions, action => action?["code"]?.GetValue<string>() == "reprovision-or-change-context"); 1259Assert.True(live["checked"]?.GetValue<bool>()); 1261Assert.Equal("request-failed", live["reason"]?.GetValue<string>()); 1262Assert.Equal("azure", live["source"]?.GetValue<string>()); 1263Assert.Equal(403, live["status"]?.GetValue<int>()); 1264Assert.Equal("Azure", live["provider"]?.GetValue<string>()); 1265Assert.Equal(403, live["httpStatus"]?.GetValue<int>()); 1266Assert.Equal("AuthorizationFailed", live["errorCode"]?.GetValue<string>()); 1267Assert.Equal("live-resource-check", live["operation"]?.GetValue<string>()); 1268Assert.Contains("Forbidden", live["message"]?.GetValue<string>(), StringComparison.Ordinal); 1320Assert.True(live["checked"]?.GetValue<bool>()); 1322Assert.Equal("credential-unavailable", live["reason"]?.GetValue<string>()); 1323Assert.Contains("Credential unavailable", live["message"]?.GetValue<string>(), StringComparison.Ordinal); 1383Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateCanceled, storageSection.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1517Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateCanceled, storageSection.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1721Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateSucceeded, storageSection.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.GetValue<string>()); 1811Assert.Equal(2, resultData["deletedResourceCount"]?.GetValue<int>()); 1813Assert.Equal(deletedResourceIds, resultResourceIds.Select(static resourceId => resourceId!.GetValue<string>())); 1816Assert.Equal("westus3", storageSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>()); 1821Assert.Equal("storage2-deployment", storage2Section.Data["Id"]?.GetValue<string>()); 1902Assert.Equal(1, resultData["deletedResourceCount"]?.GetValue<int>()); 2130Assert.Equal("storage2-deployment", storage2Section.Data["Id"]?.GetValue<string>()); 2195Assert.Equal("storage2-deployment", storage2Section.Data["Id"]?.GetValue<string>()); 2804Assert.Equal("westus2", storageSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>()); 2851Assert.Equal("westus3", storageSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>()); 2854Assert.Equal(1, data["schemaVersion"]?.GetValue<int>()); 2855Assert.Equal(AzureProvisioningController.ChangeResourceLocationCommandName, data["command"]?.GetValue<string>()); 2856Assert.Equal("storage", data["resourceName"]?.GetValue<string>()); 2857Assert.Equal("westus3", data["location"]?.GetValue<string>()); 2858Assert.Equal("westus3", data["effectiveLocation"]?.GetValue<string>()); 2859Assert.Equal("eastus", data["azureLocation"]?.GetValue<string>()); 2861Assert.Equal("eastus", azureContext["location"]?.GetValue<string>()); 2909Assert.Equal("westus3", bicepSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>()); 3235Assert.Equal("westus3", storageSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>()); 3297Assert.Equal("westus3", storageSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>()); 3362Assert.Equal("westus3", storageSection.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>()); 3416Assert.Equal("12345678-1234-1234-1234-123456789012", azureSection.Data["SubscriptionId"]?.GetValue<string>()); 3417Assert.Equal("westus2", azureSection.Data["Location"]?.GetValue<string>()); 3418Assert.Equal("test-rg", azureSection.Data["ResourceGroup"]?.GetValue<string>()); 3419Assert.Equal("87654321-4321-4321-4321-210987654321", azureSection.Data["TenantId"]?.GetValue<string>()); 3462Assert.Equal("12345678-1234-1234-1234-123456789012", azureSection.Data["SubscriptionId"]?.GetValue<string>()); 3463Assert.Equal("westus3", azureSection.Data["Location"]?.GetValue<string>()); 3464Assert.Equal("cli-rg-é", azureSection.Data["ResourceGroup"]?.GetValue<string>()); 3465Assert.Equal("87654321-4321-4321-4321-210987654321", azureSection.Data["TenantId"]?.GetValue<string>()); 3468Assert.Equal(1, data["schemaVersion"]?.GetValue<int>()); 3469Assert.Equal(AzureProvisioningController.ChangeAzureContextCommandName, data["command"]?.GetValue<string>()); 3470Assert.Equal("12345678-1234-1234-1234-123456789012", data["subscriptionId"]?.GetValue<string>()); 3471Assert.Equal("87654321-4321-4321-4321-210987654321", data["tenantId"]?.GetValue<string>()); 3472Assert.Equal("cli-rg-é", data["resourceGroup"]?.GetValue<string>()); 3473Assert.Equal("westus3", data["azureLocation"]?.GetValue<string>()); 3475Assert.Equal("12345678-1234-1234-1234-123456789012", azureContext["subscriptionId"]?.GetValue<string>()); 3476Assert.Equal("87654321-4321-4321-4321-210987654321", azureContext["tenantId"]?.GetValue<string>()); 3477Assert.Equal("cli-rg-é", azureContext["resourceGroup"]?.GetValue<string>()); 3478Assert.Equal("westus3", azureContext["location"]?.GetValue<string>()); 3482Assert.Equal(1, data["resourceCount"]?.GetValue<int>()); 3583Assert.Equal("westus2", azureSection.Data["Location"]?.GetValue<string>()); 3678Assert.Equal("westus3", storage2Section.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>()); 3724Assert.Equal("westus3", storage2Section.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>()); 3783Assert.Equal("westus3", storage2Section.Data[AzureProvisioningController.LocationOverrideKey]?.GetValue<string>()); 4026Assert.False(data["success"]?.GetValue<bool>()); 4029Assert.Equal("Microsoft.KeyVault", diagnostic["provider"]?.GetValue<string>()); 4030Assert.Equal("Microsoft.KeyVault/vaults", diagnostic["resourceType"]?.GetValue<string>()); 4031Assert.Equal("kv-test", diagnostic["resourceName"]?.GetValue<string>()); 4032Assert.Equal(keyVaultResourceId, diagnostic["targetResourceId"]?.GetValue<string>()); 4033Assert.Equal(AzureProvisioningFailureDetails.KeyVaultDeletedStateTombstoneNotFoundReason, diagnostic["errorCode"]?.GetValue<string>()); 4034Assert.Equal(409, diagnostic["httpStatus"]?.GetValue<int>()); 4035Assert.Contains("deleted vault was not found", diagnostic["errorMessage"]?.GetValue<string>(), StringComparison.Ordinal); 4037Assert.Contains(recommendedActions, action => action?["code"]?.GetValue<string>() == "retry-reprovision"); 4233Assert.False(data["success"]?.GetValue<bool>()); 4234Assert.Equal("failed", data["status"]?.GetValue<string>()); 4237Assert.Equal("azure", diagnostic["source"]?.GetValue<string>()); 4238Assert.Equal("Microsoft.ManagedIdentity", diagnostic["provider"]?.GetValue<string>()); 4239Assert.Equal("Microsoft.ManagedIdentity/userAssignedIdentities", diagnostic["resourceType"]?.GetValue<string>()); 4240Assert.Equal(400, diagnostic["httpStatus"]?.GetValue<int>()); 4241Assert.Equal("LocationNotAvailableForResourceType", diagnostic["errorCode"]?.GetValue<string>()); 4242Assert.Equal("provision", diagnostic["operation"]?.GetValue<string>()); 4244Assert.Contains(resultRecommendedActions, action => action?["code"]?.GetValue<string>() == "change-location"); 4539Assert.Equal("12345678-1234-1234-1234-123456789012", azureSection.Data["SubscriptionId"]?.GetValue<string>()); 4540Assert.Equal("westus2", azureSection.Data["Location"]?.GetValue<string>()); 4541Assert.Equal("test-rg", azureSection.Data["ResourceGroup"]?.GetValue<string>()); 4542Assert.Equal("87654321-4321-4321-4321-210987654321", azureSection.Data["TenantId"]?.GetValue<string>()); 4688Assert.Equal("storage-deployment", storageSection.Data["Id"]?.GetValue<string>()); 5567azureSection.Data["SubscriptionId"]?.GetValue<string>(), 5568azureSection.Data["ResourceGroup"]?.GetValue<string>(), 5569azureSection.Data["Location"]?.GetValue<string>(), 5570azureSection.Data["TenantId"]?.GetValue<string>());
AzureSandboxesTests.cs (3)
441Assert.Equal("existing-rg", rolesManifest["scope"]?["resourceGroup"]?.GetValue<string>()); 928Assert.Equal("production-sandbox", directCleanupState?["SandboxId"]?.GetValue<string>()); 929Assert.Equal("production-disk", directCleanupState?["DiskImageId"]?.GetValue<string>());
BicepUtilitiesTests.cs (5)
66Assert.Equal(20, parameters["age"]?["value"]?.GetValue<int>()); 122Assert.Equal("context-value", parameters["value"]?["value"]?.GetValue<string>()); 123Assert.Equal("context-value", parameters["deferred"]?["value"]?.GetValue<string>()); 124Assert.Equal("context-value/suffix", parameters["expression"]?["value"]?.GetValue<string>()); 457Assert.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)
34Assert.Equal("brownfieldapp", packageJson["name"]?.GetValue<string>()); 35Assert.Equal("1.0.0", packageJson["version"]?.GetValue<string>()); 36Assert.True(packageJson["private"]?.GetValue<bool>()); 37Assert.Equal("module", packageJson["type"]?.GetValue<string>()); 38Assert.Equal("aspire run", scripts["aspire:start"]?.GetValue<string>()); 39Assert.Equal("tsc -p tsconfig.apphost.json", scripts["aspire:build"]?.GetValue<string>()); 40Assert.Equal("tsc --watch -p tsconfig.apphost.json", scripts["aspire:dev"]?.GetValue<string>()); 41Assert.Equal("eslint apphost.mts", scripts["aspire:lint"]?.GetValue<string>()); 42Assert.Equal("eslint apphost.mts", scripts["lint"]?.GetValue<string>()); 43Assert.Equal("eslint apphost.mts && aspire run", scripts["dev"]?.GetValue<string>()); 44Assert.Equal("eslint apphost.mts && tsc -p tsconfig.apphost.json", scripts["build"]?.GetValue<string>()); 45Assert.Equal("tsc --watch -p tsconfig.apphost.json", scripts["watch"]?.GetValue<string>()); 46Assert.Equal("^4.21.0", devDependencies["tsx"]?.GetValue<string>()); 47Assert.Equal("^5.9.3", devDependencies["typescript"]?.GetValue<string>()); 48Assert.Equal("^10.0.3", devDependencies["eslint"]?.GetValue<string>()); 49Assert.Equal("^8.57.1", devDependencies["typescript-eslint"]?.GetValue<string>()); 52Assert.Equal("^20.19.0 || ^22.13.0 || >=24", engines["node"]?.GetValue<string>()); 61Assert.Equal("./dist/apphost", tsConfig["compilerOptions"]?["outDir"]?.GetValue<string>()); 109Assert.Equal("aspire run", scripts["aspire:start"]?.GetValue<string>()); 110Assert.Equal("tsc -p tsconfig.apphost.json", scripts["aspire:build"]?.GetValue<string>()); 111Assert.Equal("tsc --watch -p tsconfig.apphost.json", scripts["aspire:dev"]?.GetValue<string>()); 112Assert.Equal("eslint apphost.mts", scripts["aspire:lint"]?.GetValue<string>()); 118Assert.Equal("^8.2.0", dependencies["vscode-jsonrpc"]?.GetValue<string>()); 119Assert.Equal("^4.21.0", devDependencies["tsx"]?.GetValue<string>()); 120Assert.Equal("^22.0.0", devDependencies["@types/node"]?.GetValue<string>()); 121Assert.Equal("^3.1.14", devDependencies["nodemon"]?.GetValue<string>()); 122Assert.Equal("^5.9.3", devDependencies["typescript"]?.GetValue<string>()); 127Assert.Equal("^20.19.0 || ^22.13.0 || >=24", engines["node"]?.GetValue<string>()); 145Assert.Equal("aspire-apphost", packageJson["name"]?.GetValue<string>()); 146Assert.Equal("1.0.0", packageJson["version"]?.GetValue<string>()); 147Assert.True(packageJson["private"]?.GetValue<bool>()); 148Assert.Equal("module", packageJson["type"]?.GetValue<string>()); 182Assert.Equal("^8.2.0", dependencies["vscode-jsonrpc"]?.GetValue<string>()); 183Assert.Equal("^22.0.0", devDependencies["@types/node"]?.GetValue<string>()); 184Assert.Equal("^3.1.14", devDependencies["nodemon"]?.GetValue<string>()); 185Assert.Equal("^4.21.0", devDependencies["tsx"]?.GetValue<string>()); 186Assert.Equal("^5.9.3", devDependencies["typescript"]?.GetValue<string>()); 234var applicationUrls = httpsProfile["applicationUrl"]!.GetValue<string>().Split(';', StringSplitOptions.RemoveEmptyEntries); 241var otlpHttpsPort = GetPort(environmentVariables["ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL"]!.GetValue<string>()); 242var resourceServiceHttpsPort = GetPort(environmentVariables["ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL"]!.GetValue<string>());
Aspire.Hosting.Dotnet.Tests (2)
DotnetProjectResourceTests.cs (2)
185Assert.Equal("project.v0", manifest["type"]?.GetValue<string>()); 186Assert.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)
189Assert.Equal("hello from dashboard", JsonNode.Parse(fakeHandler.RequestContent!)?["message"]?.GetValue<string>());
Aspire.Hosting.JavaScript.Tests (1)
AddDenoAppTests.cs (1)
1093Assert.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)
918return value.GetValue<string>(); 923return value.GetValue<bool>(); 968return value.GetValue<double>(); 973return value.TryGetValue<float>(out var floatValue) ? floatValue : (float)value.GetValue<double>();
Ats\CapabilityDispatcher.cs (3)
1035return value.GetValue<string>() ?? 1046return value.GetValue<string>(); 1058return value.GetValue<int>();
Ats\HandleRegistry.cs (1)
200var handleId = handleNode?.GetValue<string>();
Aspire.Hosting.RemoteHost.Tests (119)
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)
128Assert.Equal("hello-world", args["p0"]?.GetValue<string>()); 145Assert.Equal("test-name", args["p0"]?.GetValue<string>()); 146Assert.Equal(42, args["p1"]?.GetValue<int>()); 170Assert.NotNull(handle["$handle"]?.GetValue<string>()); 171Assert.Equal(AtsTypeMapping.DeriveTypeId(typeof(ITestCallbackHandle)), handle["$type"]?.GetValue<string>()); 201Assert.Equal("test", args["p0"]?.GetValue<string>()); 202var tokenId = args["p1"]?.GetValue<string>(); 205Assert.Equal(tokenId, args["$cancellationToken"]?.GetValue<string>()); 222var tokenId = args["p0"]?.GetValue<string>(); 224Assert.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>());
HandleRegistryTests.cs (2)
176Assert.Equal("aspire/TestObject", json["$type"]!.GetValue<string>()); 178var handleId = json["$handle"]!.GetValue<string>();
Aspire.Hosting.Tests (91)
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)
166Assert.Equal("project.v0", manifest["type"]?.GetValue<string>()); 167Assert.Equal("program.csproj", manifest["path"]?.GetValue<string>()); 170manifest["args"]?.AsArray().Select(static value => value!.GetValue<string>()));
Orchestrator\ParameterProcessorTests.cs (8)
1153Assert.Equal("firstValue", savedValueNode?.GetValue<string>()); 1159Assert.Equal("secondValue", savedValueNode?.GetValue<string>()); 1186Assert.Equal("newValue", savedValueNode?.GetValue<string>()); 1427Assert.Equal("Server=localhost;Database=mydb", valueNode?.GetValue<string>()); 1468Assert.Equal("myvalue", valueNode?.GetValue<string>()); 1512Assert.Equal("customvalue", valueNode?.GetValue<string>()); 1551Assert.Equal("savedValue", savedValueNode?.GetValue<string>()); 1569Assert.Equal("savedValue", savedValueNode?.GetValue<string>());
Publishing\DeploymentStateManagerTests.cs (67)
51Assert.Equal("value1", section2.Data["key1"]?.GetValue<string>()); 120Assert.Equal("value1", parametersCheck.Data["param1"]?.GetValue<string>()); 121Assert.Equal("azure-value1", azureCheck.Data["resource1"]?.GetValue<string>()); 149Assert.Equal($"value{i}", section.Data[$"key{i}"]?.GetValue<string>()); 168Assert.Equal("value1", section2.Data["key1"]?.GetValue<string>()); 189Assert.Equal("value1", section2.Data["key1"]?.GetValue<string>()); 202Assert.Equal("value1", section3.Data["key1"]?.GetValue<string>()); 203Assert.Equal("value2", section3.Data["key2"]?.GetValue<string>()); 241Assert.Equal("value1", parametersSection.Data["param1"]?.GetValue<string>()); 242Assert.Equal("azure-value1", azureSection.Data["resource1"]?.GetValue<string>()); 243Assert.Equal("value1", restartedParametersSection.Data["param1"]?.GetValue<string>()); 260Assert.Equal("value1", retrievedSection.Data["key1"]?.GetValue<string>()); 277Assert.Equal("nestedValue", verifySection.Data["nestedKey"]?.GetValue<string>()); 297Assert.Equal("value1", verify1.Data["key1"]?.GetValue<string>()); 298Assert.Equal("value2", verify2.Data["key2"]?.GetValue<string>()); 314Assert.Equal("value1", verify.Data[""]?.GetValue<string>()); 374Assert.Equal("topValue", verifyTop.Data["topKey"]?.GetValue<string>()); 375Assert.Equal("nestedValue", verifyNested.Data["nestedKey"]?.GetValue<string>()); 481Assert.True(migratedSection.Data["legacy"]?.GetValue<bool>()); 493Assert.True(currentSection.Data["legacy"]?.GetValue<bool>()); 494Assert.True(currentSection.Data["current"]?.GetValue<bool>()); 536Assert.Equal("legacy", legacyAfterRestart.Data["Value"]?.GetValue<string>()); 537Assert.Equal("current", replacementAfterRestart.Data["Value"]?.GetValue<string>()); 559Assert.Equal("committed", restartedSection.Data["Value"]?.GetValue<string>()); 597Assert.Equal("legacy", parameterSection.Data[""]?.GetValue<string>()); 624Assert.Equal("existing", section.Data[""]?.GetValue<string>()); 630Assert.Equal("existing", restartedSection.Data[""]?.GetValue<string>()); 661Assert.Equal("updated", restartedSection.Data[""]?.GetValue<string>()); 693Assert.Equal("updated", restartedSection.Data["Leaf"]?.GetValue<string>()); 723Assert.True(features["A"]?.GetValue<bool>()); 724Assert.True(features["B"]?.GetValue<bool>()); 757Assert.Equal("first-sandbox", migratedFirstSection.Data["SandboxId"]?.GetValue<string>()); 758Assert.True(migratedFirstSection.Data["Migrated"]?.GetValue<bool>()); 770Assert.True(restartedFirstSection.Data["Migrated"]?.GetValue<bool>()); 771Assert.Equal("second-sandbox", restartedSecondSection.Data["SandboxId"]?.GetValue<string>()); 776Assert.Equal("second-sandbox", secondSection.Data["SandboxId"]?.GetValue<string>()); 786Assert.Equal("first-sandbox", clearedFirstLegacySection.Data["SandboxId"]?.GetValue<string>()); 787Assert.Equal("second-sandbox", preservedSecondLegacySection.Data["SandboxId"]?.GetValue<string>()); 811Assert.Equal("current-subscription", currentAzureSection.Data["SubscriptionId"]?.GetValue<string>()); 816Assert.Equal("current-subscription", restartedAzureSection.Data["SubscriptionId"]?.GetValue<string>()); 817Assert.Equal("first-sandbox", restartedAzureSection.Data["Sandboxes"]?["first"]?["SandboxId"]?.GetValue<string>()); 818Assert.Equal("second-sandbox", restartedAzureSection.Data["Sandboxes"]?["second"]?["SandboxId"]?.GetValue<string>()); 854restartedAzureSection.Data["Sandboxes"]?["new"]?["SandboxId"]?.GetValue<string>()); 899restartedSandboxesSection.Data["first"]?["new"]?["SandboxId"]?.GetValue<string>()); 902restartedSandboxesSection.Data["second"]?["SandboxId"]?.GetValue<string>()); 938Assert.Equal("first-sandbox", restartedFirstSection.Data["SandboxId"]?.GetValue<string>()); 939Assert.True(restartedFirstSection.Data["Updated"]?.GetValue<bool>()); 940Assert.Equal("second-sandbox", restartedSecondSection.Data["SandboxId"]?.GetValue<string>()); 941Assert.True(restartedSecondSection.Data["Updated"]?.GetValue<bool>()); 971Assert.Equal("current-subscription", restartedAzureSection.Data["SubscriptionId"]?.GetValue<string>()); 972Assert.Equal("current-location", restartedAzureSection.Data["Location"]?.GetValue<string>()); 975Assert.Equal("current-subscription", currentAzureSection.Data["SubscriptionId"]?.GetValue<string>()); 976Assert.Equal("current-location", currentAzureSection.Data["Location"]?.GetValue<string>()); 1006Assert.Equal("sub", preservedLegacySection.Data["SubscriptionId"]?.GetValue<string>()); 1036Assert.Equal("current-sub", asyncEffectiveState["Azure"]?["SubscriptionId"]?.GetValue<string>()); 1037Assert.Equal("current-sub", syncEffectiveState["Azure"]?["SubscriptionId"]?.GetValue<string>()); 1038Assert.Equal("current-sub", migratedSection.Data["SubscriptionId"]?.GetValue<string>()); 1060Assert.Equal("current-sub", asyncEffectiveState["Azure"]?["SubscriptionId"]?.GetValue<string>()); 1061Assert.Equal("current-sub", syncEffectiveState["Azure"]?["SubscriptionId"]?.GetValue<string>()); 1062Assert.Equal("current-sub", restartedSection.Data["SubscriptionId"]?.GetValue<string>()); 1068Assert.Equal("current-sub", savedSection.Data["SubscriptionId"]?.GetValue<string>()); 1069Assert.Equal("westus", savedSection.Data["Location"]?.GetValue<string>()); 1087Assert.Equal("sub", currentSection.Data["SubscriptionId"]?.GetValue<string>()); 1138.Data["SandboxId"]?.GetValue<string>()); 1142.Data["SubscriptionId"]?.GetValue<string>()); 1179.Data["SandboxId"]?.GetValue<string>()); 1183.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);
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>