4 overrides of GetValue
System.Text.Json (4)
System\Text\Json\Nodes\JsonValueOfJsonPrimitive.cs (3)
56
public override T
GetValue
<T>()
140
public override T
GetValue
<T>()
187
public override T
GetValue
<T>()
System\Text\Json\Nodes\JsonValueOfT.cs (1)
23
public override T
GetValue
<T>()
979 references to GetValue
aspire (20)
Agents\DeprecatedMcpCommandScanner.cs (5)
137
args[0]?.
GetValue
<string>() == "mcp" &&
138
args[1]?.
GetValue
<string>() == "start")
169
command[0]?.
GetValue
<string>() == "aspire" &&
170
command[1]?.
GetValue
<string>() == "mcp" &&
171
command[2]?.
GetValue
<string>() == "start")
Commands\InitCommand.cs (6)
731
if (!TryParseHostPort(https["applicationUrl"]?.
GetValue
<string>(), "https", out var dashboardHttps)
732
|| !TryParseHostPort(http["applicationUrl"]?.
GetValue
<string>(), "http", out var dashboardHttp)
733
|| !TryParseHostPort(httpsEnv[KnownConfigNames.DashboardOtlpGrpcEndpointUrl]?.
GetValue
<string>(), "https", out var otlpHttps)
734
|| !TryParseHostPort(httpEnv[KnownConfigNames.DashboardOtlpGrpcEndpointUrl]?.
GetValue
<string>(), "http", out var otlpHttp)
735
|| !TryParseHostPort(httpsEnv[KnownConfigNames.ResourceServiceEndpointUrl]?.
GetValue
<string>(), "https", out var resourceServiceHttps)
736
|| !TryParseHostPort(httpEnv[KnownConfigNames.ResourceServiceEndpointUrl]?.
GetValue
<string>(), "http", out var resourceServiceHttp))
Migrations\TypeScriptAppHostMigration.cs (3)
208
var currentPath = pathValue.
GetValue
<string>();
260
rewritten.Add((JsonNode?)JsonValue.Create(LegacyTypeScriptAppHost.RewriteTsConfigIncludeEntry(value.
GetValue
<string>())));
299
var current = value.
GetValue
<string>();
Npm\SigstoreNpmProvenanceChecker.cs (1)
219
predicateType = predicateTypeValue.
GetValue
<string>();
Utils\EnvironmentChecker\DeprecatedAgentConfigCheck.cs (5)
124
args[0]?.
GetValue
<string>() == "mcp" &&
125
args[1]?.
GetValue
<string>() == "start")
156
command[0]?.
GetValue
<string>() == "aspire" &&
157
command[1]?.
GetValue
<string>() == "mcp" &&
158
command[2]?.
GetValue
<string>() == "start")
Aspire.Cli.EndToEnd.Tests (23)
CSharpInitTests.cs (2)
68
var path = appHostNode!["path"]?.
GetValue
<string>();
71
var language = appHostNode["language"]?.
GetValue
<string>();
SelfUpdateChannelPersistenceTests.cs (1)
89
Assert.Equal("staging", updatedConfig["channel"]?.
GetValue
<string>());
SingleFileAppHostInitDotnetRunTests.cs (4)
87
Assert.Equal("Project", httpsProfile["commandName"]?.
GetValue
<string>());
88
Assert.False(string.IsNullOrWhiteSpace(httpsProfile["applicationUrl"]?.
GetValue
<string>()));
91
Assert.False(string.IsNullOrWhiteSpace(httpsEnv["ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL"]?.
GetValue
<string>()));
92
Assert.False(string.IsNullOrWhiteSpace(httpsEnv["ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL"]?.
GetValue
<string>()));
TypeScriptMigrateAppHostTests.cs (1)
216
var includes = tsconfig["include"]!.AsArray().Select(n => n!.
GetValue
<string>()).ToArray();
TypeScriptPolyglotTests.cs (15)
355
originalDevScript = scripts["dev"]?.
GetValue
<string>();
356
originalBuildScript = scripts["build"]?.
GetValue
<string>();
357
originalPreviewScript = scripts["preview"]?.
GetValue
<string>();
358
originalPackageType = packageJson["type"]?.
GetValue
<string>();
387
Assert.Equal(originalDevScript, scripts["dev"]?.
GetValue
<string>());
388
Assert.Equal(originalBuildScript, scripts["build"]?.
GetValue
<string>());
389
Assert.Equal(originalPreviewScript, scripts["preview"]?.
GetValue
<string>());
390
Assert.Equal("custom-apphost-start", scripts["aspire:start"]?.
GetValue
<string>());
391
Assert.Equal("npm --prefix aspire-apphost run aspire:build", scripts["aspire:build"]?.
GetValue
<string>());
392
Assert.Equal("npm --prefix aspire-apphost run aspire:dev", scripts["aspire:dev"]?.
GetValue
<string>());
393
Assert.Equal(originalPackageType, packageJson["type"]?.
GetValue
<string>());
413
Assert.Equal("module", appHostPackageJson["type"]?.
GetValue
<string>());
414
Assert.Equal("aspire-apphost", appHostPackageJson["name"]?.
GetValue
<string>());
415
Assert.Equal("aspire run", appHostScripts["aspire:start"]?.
GetValue
<string>());
427
Assert.Equal("aspire-apphost/apphost.mts", appHost["path"]?.
GetValue
<string>());
Aspire.Cli.Tests (219)
Agents\CopilotCliAgentEnvironmentScannerTests.cs (6)
71
Assert.Equal("local", aspireServer["type"]?.
GetValue
<string>());
72
Assert.Equal("aspire", aspireServer["command"]?.
GetValue
<string>());
77
Assert.Equal("agent", args[0]?.
GetValue
<string>());
78
Assert.Equal("mcp", args[1]?.
GetValue
<string>());
84
Assert.Equal("${DOTNET_ROOT}", env["DOTNET_ROOT"]?.
GetValue
<string>());
90
Assert.Equal("*", tools[0]?.
GetValue
<string>());
Agents\VsCodeAgentEnvironmentScannerTests.cs (6)
157
Assert.Equal("stdio", aspireServer["type"]?.
GetValue
<string>());
158
Assert.Equal("aspire", aspireServer["command"]?.
GetValue
<string>());
163
Assert.Equal("agent", args[0]?.
GetValue
<string>());
164
Assert.Equal("mcp", args[1]?.
GetValue
<string>());
250
Assert.Equal("stdio", aspireServer["type"]?.
GetValue
<string>());
251
Assert.Equal("aspire", aspireServer["command"]?.
GetValue
<string>());
Backchannel\ResourceSnapshotMapperTests.cs (3)
31
Assert.Equal(12345, pid.
GetValue
<int>());
354
value => Assert.Equal("one", value?.
GetValue
<string>()),
355
value => Assert.Equal("two", value?.
GetValue
<string>()));
Commands\InitCommandTests.cs (31)
170
Assert.Equal("apphost.cs", appHost["path"]!.
GetValue
<string>());
200
Assert.Equal("Project", https["commandName"]!.
GetValue
<string>());
201
Assert.True(https["dotnetRunMessages"]!.
GetValue
<bool>());
202
var httpsUrls = https["applicationUrl"]!.
GetValue
<string>();
205
Assert.Equal("Development", httpsEnv[KnownAspNetCoreConfigNames.Environment]!.
GetValue
<string>());
206
Assert.Equal("Development", httpsEnv[KnownAspNetCoreConfigNames.DotNetEnvironment]!.
GetValue
<string>());
207
Assert.StartsWith("https://localhost:", httpsEnv["ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL"]!.
GetValue
<string>());
208
Assert.StartsWith("https://localhost:", httpsEnv["ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL"]!.
GetValue
<string>());
211
Assert.Equal("Project", http["commandName"]!.
GetValue
<string>());
213
Assert.Equal("Development", httpEnv[KnownAspNetCoreConfigNames.Environment]!.
GetValue
<string>());
214
Assert.StartsWith("http://localhost:", httpEnv["ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL"]!.
GetValue
<string>());
215
Assert.StartsWith("http://localhost:", httpEnv["ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL"]!.
GetValue
<string>());
216
Assert.Equal("true", httpEnv["ASPIRE_ALLOW_UNSECURED_TRANSPORT"]!.
GetValue
<string>());
223
aspireProfiles["https"]!["applicationUrl"]!.
GetValue
<string>(),
226
aspireProfiles["http"]!["applicationUrl"]!.
GetValue
<string>(),
227
http["applicationUrl"]!.
GetValue
<string>());
279
Assert.Equal("https://localhost:18000;http://localhost:18001", https["applicationUrl"]!.
GetValue
<string>());
280
Assert.Equal("https://localhost:18002", https["environmentVariables"]!["ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL"]!.
GetValue
<string>());
281
Assert.Equal("https://localhost:18003", https["environmentVariables"]!["ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL"]!.
GetValue
<string>());
282
Assert.Equal("http://localhost:18001", http["applicationUrl"]!.
GetValue
<string>());
283
Assert.Equal("http://localhost:18005", http["environmentVariables"]!["ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL"]!.
GetValue
<string>());
284
Assert.Equal("http://localhost:18006", http["environmentVariables"]!["ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL"]!.
GetValue
<string>());
331
Assert.Equal("https://localhost:18000", preservedHttps["applicationUrl"]!.
GetValue
<string>());
333
Assert.Equal("custom-value", preservedEnv["MY_CUSTOM_VAR"]!.
GetValue
<string>());
401
Assert.Equal("apphost.mts", appHost["path"]!.
GetValue
<string>());
402
Assert.Equal("typescript/nodejs", appHost["language"]!.
GetValue
<string>());
689
Assert.Equal("apphost.cs", merged["appHost"]!.AsObject()["path"]!.
GetValue
<string>());
691
Assert.Equal("stable", merged["channel"]!.
GetValue
<string>());
692
Assert.True(merged["features"]!.AsObject()["polyglotSupportEnabled"]!.
GetValue
<bool>());
1140
Assert.Equal(contextChannel, config["channel"]!.
GetValue
<string>());
1173
Assert.Equal("pr-99999", config["channel"]!.
GetValue
<string>());
Commands\OperatingSystemCheckTests.cs (8)
28
Assert.Equal("Linux", result.Metadata["osType"]!.
GetValue
<string>());
29
Assert.Equal("Linux Ubuntu", result.Metadata["displayName"]!.
GetValue
<string>());
30
Assert.Equal("24.04", result.Metadata["version"]!.
GetValue
<string>());
31
Assert.Equal("Ubuntu 24.04.2 LTS", result.Metadata["description"]!.
GetValue
<string>());
50
Assert.Equal("unknown", result.Metadata["osType"]!.
GetValue
<string>());
51
Assert.Equal("unknown", result.Metadata["displayName"]!.
GetValue
<string>());
52
Assert.Equal("1.2.3", result.Metadata["version"]!.
GetValue
<string>());
53
Assert.Equal("Unknown OS description", result.Metadata["description"]!.
GetValue
<string>());
Commands\ResourceCommandHelperTests.cs (1)
143
Assert.Equal("#submit", connection.ExecuteResourceCommandArguments["selector"]!.
GetValue
<string>());
Commands\ResourceCommandTests.cs (5)
1768
Assert.Equal("browser", argumentInputs[0]!["name"]!.
GetValue
<string>());
1769
Assert.Equal("Chrome", argumentInputs[0]!["value"]!.
GetValue
<string>());
1770
Assert.Equal("profile", argumentInputs[1]!["name"]!.
GetValue
<string>());
1771
Assert.Equal("Default", argumentInputs[1]!["options"]!["Default"]!.
GetValue
<string>());
2297
Assert.Equal(value, actualElement.
GetValue
<string>());
Commands\TelemetryTracesCommandTests.cs (3)
141
Assert.Equal("abc1234567890def", item["traceId"]!.
GetValue
<string>());
143
var dashboardUrl = item["dashboardUrl"]!.
GetValue
<string>();
229
var dashboardUrl = items[0]!["dashboardUrl"]!.
GetValue
<string>();
Commands\VsCodeExtensionCheckTests.cs (6)
51
Assert.True(result.Metadata["vsCodeInstalled"]!.
GetValue
<bool>());
52
Assert.False(result.Metadata["extensionInstalled"]!.
GetValue
<bool>());
53
Assert.Equal(VsCodeExtensionCheck.ExtensionId, result.Metadata["extensionId"]!.
GetValue
<string>());
80
Assert.True(result.Metadata["vsCodeInstalled"]!.
GetValue
<bool>());
81
Assert.True(result.Metadata["extensionInstalled"]!.
GetValue
<bool>());
82
Assert.Equal(VsCodeExtensionCheck.ExtensionId, result.Metadata["extensionId"]!.
GetValue
<string>());
Configuration\ConfigurationServiceTests.cs (3)
313
Assert.Equal("true", node.
GetValue
<string>());
336
Assert.Equal("true", node.
GetValue
<string>());
356
Assert.Equal("daily", node.
GetValue
<string>());
Mcp\ExecuteResourceCommandToolTests.cs (4)
92
Assert.Equal("#submit", connection.ExecuteResourceCommandArguments["selector"]!.
GetValue
<string>());
113
Assert.Equal("3", connection.ExecuteResourceCommandArguments["count"]!.
GetValue
<string>());
114
Assert.Equal("true", connection.ExecuteResourceCommandArguments["urgent"]!.
GetValue
<string>());
115
Assert.Equal("1.5", connection.ExecuteResourceCommandArguments["ratio"]!.
GetValue
<string>());
Mcp\ListStructuredLogsToolTests.cs (9)
199
Assert.Equal("api-service-instance-1", firstLog["resourceName"]?.
GetValue
<string>());
200
Assert.Equal(42, firstLog["logId"]?.
GetValue
<long>());
207
Assert.Equal("http://localhost:18888/structuredlogs?logEntryId=42", firstLog["dashboardUrl"]?.
GetValue
<string>());
212
Assert.Equal("api-service-instance-2", secondLog["resourceName"]?.
GetValue
<string>());
213
Assert.Equal(43, secondLog["logId"]?.
GetValue
<long>());
218
Assert.Equal("http://localhost:18888/structuredlogs?logEntryId=43", secondLog["dashboardUrl"]?.
GetValue
<string>());
223
Assert.Equal("worker-service", thirdLog["resourceName"]?.
GetValue
<string>());
224
Assert.Equal(44, thirdLog["logId"]?.
GetValue
<long>());
226
Assert.Equal("http://localhost:18888/structuredlogs?logEntryId=44", thirdLog["dashboardUrl"]?.
GetValue
<string>());
Mcp\ListTracesToolTests.cs (11)
172
Assert.Equal("abc123def456789012345678901234567890", firstTrace["traceId"]?.
GetValue
<string>());
180
Assert.Equal("http://localhost:18888/traces/detail/abc123def456789012345678901234567890", firstTrace["dashboardUrl"]?.
GetValue
<string>());
183
var serverSpan = spans.FirstOrDefault(s => s?["kind"]?.
GetValue
<string>() == "Server")?.AsObject();
185
Assert.Equal("api-service-instance-1", serverSpan["source"]?.
GetValue
<string>());
189
var clientSpan = spans.FirstOrDefault(s => s?["kind"]?.
GetValue
<string>() == "Client")?.AsObject();
191
Assert.Equal("api-service-instance-2", clientSpan["source"]?.
GetValue
<string>());
192
Assert.Equal("catalog-service", clientSpan["destination"]?.
GetValue
<string>());
197
Assert.Equal("xyz789abc123456789012345678901234567890", secondTrace["traceId"]?.
GetValue
<string>());
199
Assert.Equal("http://localhost:18888/traces/detail/xyz789abc123456789012345678901234567890", secondTrace["dashboardUrl"]?.
GetValue
<string>());
209
Assert.Equal("Internal", internalSpan["kind"]?.
GetValue
<string>());
210
Assert.Equal("worker-service", internalSpan["source"]?.
GetValue
<string>());
Migrations\TypeScriptAppHostMigrationTests.cs (7)
62
Assert.Equal(KnownLanguageId.TypeScript, descriptor.Metadata["language"]!.
GetValue
<string>());
63
Assert.Equal(appHostPath, descriptor.Metadata["appHostPath"]!.
GetValue
<string>());
113
Assert.Equal(appHostPath, descriptor.Metadata!["appHostPath"]!.
GetValue
<string>());
190
Assert.Equal("apphost.mts", config["appHost"]!["path"]!.
GetValue
<string>());
193
var includes = tsconfig["include"]!.AsArray().Select(n => n!.
GetValue
<string>()).ToArray();
198
Assert.Equal("tsc -p tsconfig.apphost.json", scripts["aspire:build"]!.
GetValue
<string>());
199
Assert.Equal("eslint apphost.mts", scripts["aspire:lint"]!.
GetValue
<string>());
Scaffolding\PackageJsonMergerTests.cs (95)
22
ParseJson(mergedJson)["scripts"]![scriptName]?.
GetValue
<string>()!;
28
ParseJson(mergedJson)[section]?[packageName]?.
GetValue
<string>();
57
Assert.Equal("vite", scripts["dev"]?.
GetValue
<string>());
58
Assert.Equal("vite build", scripts["build"]?.
GetValue
<string>());
61
Assert.Equal("aspire run", scripts["aspire:dev"]?.
GetValue
<string>());
62
Assert.Equal("tsc -p tsconfig.apphost.json", scripts["aspire:build"]?.
GetValue
<string>());
65
Assert.Equal("eslint apphost.ts", scripts["lint"]?.
GetValue
<string>());
94
Assert.Equal("jest", scripts["test"]?.
GetValue
<string>());
97
Assert.Equal("aspire run", scripts["dev"]?.
GetValue
<string>());
98
Assert.Equal("tsc -p tsconfig.apphost.json", scripts["build"]?.
GetValue
<string>());
99
Assert.Equal("eslint apphost.ts", scripts["lint"]?.
GetValue
<string>());
131
Assert.Equal("vite", scripts["dev"]?.
GetValue
<string>());
132
Assert.Equal("vite build", scripts["build"]?.
GetValue
<string>());
135
Assert.Equal("custom start", scripts["aspire:start"]?.
GetValue
<string>());
136
Assert.Equal("tsc -p tsconfig.apphost.json", scripts["aspire:build"]?.
GetValue
<string>());
137
Assert.Equal("tsc --watch -p tsconfig.apphost.json", scripts["aspire:dev"]?.
GetValue
<string>());
138
Assert.Equal("eslint apphost.ts", scripts["aspire:lint"]?.
GetValue
<string>());
169
Assert.Equal("npm run aspire:start", scripts["start"]?.
GetValue
<string>());
170
Assert.Equal("npm run aspire:lint", scripts["lint"]?.
GetValue
<string>());
173
Assert.Equal("vite", scripts["dev"]?.
GetValue
<string>());
174
Assert.Equal("vite build", scripts["build"]?.
GetValue
<string>());
201
Assert.Equal("yarn run aspire:start", scripts["start"]?.
GetValue
<string>());
233
Assert.Equal("node server.js", scripts["start"]?.
GetValue
<string>());
234
Assert.Equal("prettier --check .", scripts["lint"]?.
GetValue
<string>());
235
Assert.Equal("vite", scripts["dev"]?.
GetValue
<string>());
236
Assert.Equal("vite build", scripts["build"]?.
GetValue
<string>());
239
Assert.Equal("aspire run", scripts["aspire:start"]?.
GetValue
<string>());
240
Assert.Equal("eslint apphost.ts", scripts["aspire:lint"]?.
GetValue
<string>());
241
Assert.Equal("tsc -p tsconfig.apphost.json", scripts["aspire:build"]?.
GetValue
<string>());
245
Assert.Equal("node server.js", scripts["start"]?.
GetValue
<string>());
246
Assert.Equal("prettier --check .", scripts["lint"]?.
GetValue
<string>());
276
Assert.Equal("vite", scripts["dev"]?.
GetValue
<string>());
277
Assert.Equal("jest", scripts["test"]?.
GetValue
<string>());
280
Assert.Equal("aspire run", scripts["aspire:dev"]?.
GetValue
<string>());
283
Assert.Equal("tsc -p tsconfig.apphost.json", scripts["build"]?.
GetValue
<string>());
286
Assert.Equal("eslint apphost.ts", scripts["aspire:lint"]?.
GetValue
<string>());
287
Assert.Equal("npm run aspire:lint", scripts["lint"]?.
GetValue
<string>());
369
Assert.Equal("my-existing-app", json["name"]?.
GetValue
<string>());
370
Assert.Equal("3.0.0", json["version"]?.
GetValue
<string>());
371
Assert.Equal("My cool app", json["description"]?.
GetValue
<string>());
372
Assert.True(json["private"]?.
GetValue
<bool>());
373
Assert.Equal("module", json["type"]?.
GetValue
<string>());
376
Assert.Equal("^20.19.0 || ^22.13.0 || >=24", json["engines"]?["node"]?.
GetValue
<string>());
444
Assert.Equal("my-app", json["name"]?.
GetValue
<string>());
518
Assert.Equal("aspire run", scripts["dev"]?.
GetValue
<string>());
519
Assert.Equal("tsc -p tsconfig.apphost.json", scripts["build"]?.
GetValue
<string>());
520
Assert.Equal("eslint apphost.ts", scripts["lint"]?.
GetValue
<string>());
576
Assert.Equal("vite-project", json["name"]?.
GetValue
<string>());
577
Assert.Equal("1.0.0", json["version"]?.
GetValue
<string>());
580
Assert.Equal("vite", scripts["dev"]?.
GetValue
<string>());
581
Assert.Equal("vite build", scripts["build"]?.
GetValue
<string>());
582
Assert.Equal("eslint . --ext .ts,.tsx", scripts["lint"]?.
GetValue
<string>());
583
Assert.Equal("vite preview", scripts["preview"]?.
GetValue
<string>());
586
Assert.Equal("aspire run", scripts["aspire:dev"]?.
GetValue
<string>());
587
Assert.Equal("tsc -p tsconfig.apphost.json", scripts["aspire:build"]?.
GetValue
<string>());
588
Assert.Equal("eslint apphost.ts", scripts["aspire:lint"]?.
GetValue
<string>());
591
Assert.Equal("tsc --watch -p tsconfig.apphost.json", scripts["watch"]?.
GetValue
<string>());
634
Assert.Equal("vite", scripts["dev"]?.
GetValue
<string>());
635
Assert.Equal("vite build", scripts["build"]?.
GetValue
<string>());
638
Assert.Equal("aspire run", scripts["aspire:start"]?.
GetValue
<string>());
639
Assert.Equal("tsc -p tsconfig.apphost.json", scripts["aspire:build"]?.
GetValue
<string>());
640
Assert.Equal("tsc --watch -p tsconfig.apphost.json", scripts["aspire:dev"]?.
GetValue
<string>());
641
Assert.Equal("eslint apphost.ts", scripts["aspire:lint"]?.
GetValue
<string>());
644
Assert.Equal("npm run aspire:start", scripts["start"]?.
GetValue
<string>());
645
Assert.Equal("npm run aspire:lint", scripts["lint"]?.
GetValue
<string>());
648
Assert.Equal("vite", scripts["dev"]?.
GetValue
<string>());
649
Assert.Equal("vite build", scripts["build"]?.
GetValue
<string>());
698
Assert.Equal("tsc && vite build", scripts["build"]?.
GetValue
<string>());
699
Assert.Equal("concurrently \"tsc -w\" \"vite\"", scripts["dev"]?.
GetValue
<string>());
700
Assert.Equal("vitest run && echo 'done'", scripts["test"]?.
GetValue
<string>());
701
Assert.Equal("eslint . --ext .ts,.tsx && prettier --check .", scripts["lint"]?.
GetValue
<string>());
702
Assert.Equal("rm -rf dist && rm -rf node_modules/.cache", scripts["clean"]?.
GetValue
<string>());
703
Assert.Equal("node server.js | tee output.log", scripts["start"]?.
GetValue
<string>());
1018
Assert.Equal("scaffold", ParseJson(result)["name"]?.
GetValue
<string>());
1147
Assert.Equal("^20.19.0 || ^22.13.0 || >=24", engines["node"]?.
GetValue
<string>());
1175
Assert.Equal("^20.19.0 || ^22.13.0 || >=24", engines["node"]?.
GetValue
<string>());
1177
Assert.Equal(">=8", engines["npm"]?.
GetValue
<string>());
1200
Assert.Equal("^20.19.0 || ^22.13.0 || >=24", engines["node"]?.
GetValue
<string>());
1226
Assert.Equal("web", keywords[0]!.
GetValue
<string>());
1227
Assert.Equal("api", keywords[1]!.
GetValue
<string>());
1231
Assert.Equal("dist/**", files[0]!.
GetValue
<string>());
1278
Assert.Equal("my-project", doc["name"]!.
GetValue
<string>());
1279
Assert.Equal("ISC", doc["license"]!.
GetValue
<string>());
1296
Assert.Contains(">=24", doc["engines"]?["node"]?.
GetValue
<string>());
1463
Assert.Equal("vite-brownfield", doc["name"]!.
GetValue
<string>());
1464
Assert.Equal("2.0.0", doc["version"]!.
GetValue
<string>());
1465
Assert.Equal("module", doc["type"]!.
GetValue
<string>());
1469
Assert.Equal("vite", scripts["dev"]?.
GetValue
<string>());
1470
Assert.Equal("vite build", scripts["build"]?.
GetValue
<string>());
1471
Assert.Equal("vite preview", scripts["preview"]?.
GetValue
<string>());
1474
Assert.Equal("aspire run", scripts["aspire:start"]?.
GetValue
<string>());
1475
Assert.Equal("tsc -p tsconfig.apphost.json", scripts["aspire:build"]?.
GetValue
<string>());
1476
Assert.Equal("tsc --watch -p tsconfig.apphost.json", scripts["aspire:dev"]?.
GetValue
<string>());
1477
Assert.Equal("eslint apphost.ts", scripts["aspire:lint"]?.
GetValue
<string>());
1492
Assert.Contains(">=24", doc["engines"]?["node"]?.
GetValue
<string>());
Scaffolding\ScaffoldingServiceTests.cs (16)
127
Assert.Equal("vitest", scripts["test"]?.
GetValue
<string>());
128
Assert.Equal("pnpm --dir apps/web/aspire-apphost run aspire:start", scripts["aspire:start"]?.
GetValue
<string>());
129
Assert.Equal("pnpm --dir apps/web/aspire-apphost run aspire:build", scripts["aspire:build"]?.
GetValue
<string>());
130
Assert.Equal("pnpm --dir apps/web/aspire-apphost run aspire:dev", scripts["aspire:dev"]?.
GetValue
<string>());
153
Assert.Equal("pnpm --dir aspire-apphost run aspire:start", scripts["aspire:start"]?.
GetValue
<string>());
154
Assert.Equal("pnpm --dir aspire-apphost run aspire:build", scripts["aspire:build"]?.
GetValue
<string>());
155
Assert.Equal("pnpm --dir aspire-apphost run aspire:dev", scripts["aspire:dev"]?.
GetValue
<string>());
179
Assert.Equal("custom-start", scripts["aspire:start"]?.
GetValue
<string>());
180
Assert.Equal("npm --prefix aspire-apphost run aspire:build", scripts["aspire:build"]?.
GetValue
<string>());
181
Assert.Equal("npm --prefix aspire-apphost run aspire:dev", scripts["aspire:dev"]?.
GetValue
<string>());
308
Assert.True(merged["editor.formatOnSave"]!.
GetValue
<bool>());
310
Assert.Equal("automatic", merged["java.compile.nullAnalysis.mode"]!.
GetValue
<string>());
311
Assert.Equal([".", ".aspire/modules"], merged["java.project.sourcePaths"]!.AsArray().Select(v => v!.
GetValue
<string>()));
333
merged["java.project.sourcePaths"]!.AsArray().Select(v => v!.
GetValue
<string>()));
355
Assert.Equal(4, merged["editor.tabSize"]!.
GetValue
<int>());
356
Assert.Equal(["."], merged["java.project.sourcePaths"]!.AsArray().Select(v => v!.
GetValue
<string>()));
Utils\DevCertsCheckTests.cs (3)
309
Assert.Equal("AAAA1111BBBB2222", certNode["thumbprint"]!.
GetValue
<string>());
310
Assert.Equal(MinVersion, certNode["version"]!.
GetValue
<int>());
311
Assert.Equal("full", certNode["trustLevel"]!.
GetValue
<string>());
Utils\EnvironmentCheckerTests.cs (2)
61
Assert.Equal(nameof(TestEnvironmentCheck), timeoutResult.Metadata!["checkType"]!.
GetValue
<string>());
62
Assert.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)
147
if (node?.GetValueKind() == JsonValueKind.String && node.
GetValue
<string>() is { } json)
Model\GenAI\GenAISchemaHelpers.cs (4)
23
Description = schemaObj["description"]?.
GetValue
<string>()
53
schema.Required.Add(item.
GetValue
<string>());
96
var typeValue = item.
GetValue
<string>();
112
var typeString = typeNode.
GetValue
<string>();
Model\GenAI\GenAIVisualizerDialogViewModel.cs (3)
104
Type = obj["type"]?.
GetValue
<string>() ?? "function",
105
Name = obj["name"]?.
GetValue
<string>(),
106
Description = obj["description"]?.
GetValue
<string>()
Aspire.Dashboard.Tests (15)
Model\GenAIMessageParsingHelperTests.cs (6)
138
Assert.Equal("Seattle", toolCallPart.Arguments["location"]!.
GetValue
<string>());
153
Assert.Equal("Seattle", toolCallPart.Arguments["location"]!.
GetValue
<string>());
168
Assert.Equal(72, objectResponse.Response!["temperature"]!.
GetValue
<int>());
172
Assert.Equal("plain text result", stringResponse.Response!.
GetValue
<string>());
246
Assert.Equal("latest news", serverToolCallPart.ServerToolCall["query"]!.
GetValue
<string>());
261
Assert.Equal("web_search", serverToolCallResponsePart.ServerToolCallResponse["type"]!.
GetValue
<string>());
Model\GenAIVisualizerDialogViewModelTests.cs (2)
1194
Assert.Equal("celsius", unitProp.Enum[0]!.
GetValue
<string>());
1195
Assert.Equal("fahrenheit", unitProp.Enum[1]!.
GetValue
<string>());
Model\TelemetryExportServiceTests.cs (7)
1434
Assert.Equal("dependency-resource", waitingForPropertyValue?.
GetValue
<string>());
1436
Assert.Equal("localhost", connectionPropertiesObject["Host"]?.
GetValue
<string>());
1437
Assert.Equal("catalogdb", connectionPropertiesObject["DatabaseName"]?.
GetValue
<string>());
1568
Assert.Equal(6379, portsArray[0]!.
GetValue
<double>());
1569
Assert.Equal(6380, portsArray[1]!.
GetValue
<double>());
1572
var exitCode = deserialized.Properties["resource.exitCode"]!.
GetValue
<double>();
1576
var enabled = deserialized.Properties["resource.enabled"]!.
GetValue
<bool>();
Aspire.Hosting (13)
Backchannel\AuxiliaryBackchannelRpcTarget.cs (1)
416
JsonValueKind.String => value.
GetValue
<string>(),
Dashboard\DashboardEventHandlers.cs (3)
161
frameworkObj["name"]?.
GetValue
<string>() is { } name &&
162
frameworkObj["version"]?.
GetValue
<string>() is { } version)
254
frameworkObj["name"]?.
GetValue
<string>() is { } name)
Pipelines\Internal\DeploymentStateManagerBase.cs (1)
200
value = jsonValue.
GetValue
<string>();
Pipelines\Internal\FileDeploymentStateManager.cs (3)
748
var legacyFallbackDisabled = migrationState[LegacyFallbackDisabledProperty]?.
GetValue
<bool>() ?? false;
764
JsonValue stateValue => JsonNode.Parse(stateValue.
GetValue
<string>())?.AsObject()
775
claimedSectionsValue.
GetValue
<string>());
Publishing\ContainerRuntimeBase.cs (5)
197
root["WorkingDir"]?.
GetValue
<string>());
220
if (item?.
GetValue
<string>() is { } value)
308
var actualOperatingSystem = platform?["os"]?.
GetValue
<string>();
309
var actualArchitecture = platform?["architecture"]?.
GetValue
<string>();
310
var digest = descriptor["digest"]?.
GetValue
<string>();
Aspire.Hosting.Azure (53)
AzureProvisioningController.cs (27)
1857
var subscriptionId = section.Data["SubscriptionId"]?.
GetValue
<string>();
1858
var resourceGroupName = section.Data["ResourceGroup"]?.
GetValue
<string>();
2499
deployment.TryGetPropertyValue("resourceId", out var resourceIdNode) ? resourceIdNode?.
GetValue
<string>() : null,
2510
var deploymentId = section.Data["Id"]?.
GetValue
<string>();
2514
var 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>())
2533
if (section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.
GetValue
<string>() is { Length: > 0 } provisioningState)
2745
if (section.Data[LocationOverrideKey]?.
GetValue
<string>() is { Length: > 0 } locationOverride)
2764
if (section.Data[LocationOverrideKey]?.
GetValue
<string>() is { Length: > 0 } locationOverride)
3092
=> section.Data["Id"]?.
GetValue
<string>() is { Length: > 0 } deploymentId ? deploymentId : null;
3096
section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.
GetValue
<string>(),
3157
if (section.Data["Parameters"]?.
GetValue
<string>() is not { Length: > 0 } parametersJson)
3164
var persistedLocation = AzureProvisioningJsonHelpers.ParseDeploymentStateJson(parametersJson)?[AzureBicepResource.KnownParameters.Location]?["value"]?.
GetValue
<string>();
3188
=> section.Data[LocationOverrideKey]?.
GetValue
<string>() is { Length: > 0 } locationOverride ? locationOverride : null;
3371
section.Data["SubscriptionId"]?.
GetValue
<string>() ?? provisionerOptions.Value.SubscriptionId ?? configuration["Azure:SubscriptionId"],
3372
section.Data["ResourceGroup"]?.
GetValue
<string>() ?? provisionerOptions.Value.ResourceGroup ?? configuration["Azure:ResourceGroup"],
3373
section.Data["Location"]?.
GetValue
<string>() ?? provisionerOptions.Value.Location ?? configuration["Azure:Location"],
3374
section.Data["TenantId"]?.
GetValue
<string>() ?? provisionerOptions.Value.TenantId ?? configuration["Azure:TenantId"],
3375
section.Data["Tenant"]?.
GetValue
<string>());
3393
if (section.Data["Outputs"]?.
GetValue
<string>() is not { Length: > 0 } outputsJson)
3402
return AzureProvisioningJsonHelpers.ParseDeploymentStateJson(outputsJson)?["id"]?["value"]?.
GetValue
<string>();
3512
if (section.Data[LocationOverrideKey]?.
GetValue
<string>() is { Length: > 0 } locationOverride)
3519
if (section.Data["Parameters"]?.
GetValue
<string>() is not { Length: > 0 } parametersJson)
3526
return AzureProvisioningJsonHelpers.ParseDeploymentStateJson(parametersJson)?[AzureBicepResource.KnownParameters.Location]?["value"]?.
GetValue
<string>();
3815
section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.
GetValue
<string>(),
Provisioning\BicepUtilities.cs (2)
171
if (section.Data[DeploymentStateParametersKey]?.
GetValue
<string>() is not { Length: > 0 } jsonString)
179
var scope = section.Data[DeploymentStateScopeKey]?.
GetValue
<string>() is { Length: > 0 } scopeString
Provisioning\Internal\RunModeProvisioningContextProvider.cs (5)
237
if (data["Location"]?.
GetValue
<string>() is { Length: > 0 } location)
242
if (data["SubscriptionId"]?.
GetValue
<string>() is { Length: > 0 } subscriptionId)
247
if (data["ResourceGroup"]?.
GetValue
<string>() is { Length: > 0 } resourceGroup)
252
if (data["TenantId"]?.
GetValue
<string>() is { Length: > 0 } tenantId)
269
JsonValueKind.String when bool.TryParse(value.
GetValue
<string>(), out var parsedValue) => parsedValue,
Provisioning\Provisioners\BicepProvisioner.cs (19)
60
if (stateSection.Data[DeploymentStateProvisioningStateKey]?.
GetValue
<string>() is { Length: > 0 } provisioningState &&
68
var configCheckSum = stateSection.Data[BicepUtilities.DeploymentStateChecksumKey]?.
GetValue
<string>();
84
if (stateSection.Data[BicepUtilities.DeploymentStateOutputsKey]?.
GetValue
<string>() is { Length: > 0 } outputJson)
119
if (stateSection.Data[BicepUtilities.DeploymentStateIdKey]?.
GetValue
<string>() is { Length: > 0 } configuredDeploymentId &&
187
stateSection.Data[BicepUtilities.DeploymentStateIdKey]?.
GetValue
<string>() is not { Length: > 0 } deploymentId ||
358
stateSection.Data[BicepUtilities.DeploymentStateChecksumKey]?.
GetValue
<string>() is not { Length: > 0 } checksum)
375
var locationOverride = stateSection.Data[AzureProvisioningController.LocationOverrideKey]?.
GetValue
<string>();
455
var locationOverride = stateSection.Data[AzureProvisioningController.LocationOverrideKey]?.
GetValue
<string>();
476
if (stateSection.Data[key]?.
GetValue
<string>() is not { Length: > 0 } json)
495
stateSection.Data[DeploymentStateProvisioningStateKey]?.
GetValue
<string>(),
622
var canceledLocationOverride = canceledStateSection.Data[AzureProvisioningController.LocationOverrideKey]?.
GetValue
<string>();
679
locationOverride = stateSection.Data[AzureProvisioningController.LocationOverrideKey]?.
GetValue
<string>();
797
locationOverride = stateSection.Data[AzureProvisioningController.LocationOverrideKey]?.
GetValue
<string>();
855
var cachedDeploymentId = stateSection.Data[BicepUtilities.DeploymentStateIdKey]?.
GetValue
<string>();
856
var cachedChecksum = stateSection.Data[BicepUtilities.DeploymentStateChecksumKey]?.
GetValue
<string>();
1487
section.Data[key]?.
GetValue
<string>() is { Length: > 0 } value ? value : null;
1491
if (section.Data[AzureProvisioningController.LocationOverrideKey]?.
GetValue
<string>() is { Length: > 0 } locationOverride)
1496
if (section.Data[BicepUtilities.DeploymentStateParametersKey]?.
GetValue
<string>() is { Length: > 0 } parametersJson)
1500
if (JsonNode.Parse(parametersJson)?[AzureBicepResource.KnownParameters.Location]?["value"]?.
GetValue
<string>() is { Length: > 0 } configuredLocation)
Aspire.Hosting.Azure.Sandboxes (31)
AzureSandboxContainerDeployment.cs (28)
247
var previousOwnerId = previousStateSection.Data["OwnerId"]?.
GetValue
<string>();
377
var pendingSecurityCleanup = previousStateSection.Data["PendingSecurityCleanup"]?.
GetValue
<bool>() == true;
481
if (portStates.FirstOrDefault() is JsonObject firstPort && firstPort["Url"]?.
GetValue
<string>() is { } publicUrl)
1280
var ownerId = stateSection.Data["OwnerId"]?.
GetValue
<string>();
1396
if (stateSection.Data["OwnerId"]?.
GetValue
<string>() is { Length: > 0 } ownerId &&
1412
stateSection.Data["OwnerId"]?.
GetValue
<string>()))
1515
var sandboxId = stateSection.Data["SandboxId"]?.
GetValue
<string>();
1528
var diskImageId = stateSection.Data["DiskImageId"]?.
GetValue
<string>();
1793
if (stateSection.Data["ResourceName"]?.
GetValue
<string>() is { Length: > 0 } resourceName)
1856
if (stateSection.Data["OwnerId"]?.
GetValue
<string>() is { Length: > 0 } previousOwnerId &&
1890
if (stateSection.Data["OwnerId"]?.
GetValue
<string>() is { Length: > 0 } previousOwnerId &&
1993
previousStateSection.Data["HasRuntimeEnvironmentConfiguration"]?.
GetValue
<bool>() == true ||
1995
previousStateSection.Data["HasRuntimeCommandConfiguration"]?.
GetValue
<bool>() == true)
2000
if (previousStateSection.Data["PendingSecurityCleanup"]?.
GetValue
<bool>() == true)
2005
var previousFingerprint = previousStateSection.Data["EndpointSecurityFingerprint"]?.
GetValue
<string>();
2034
var subscriptionId = stateSection.Data["SubscriptionId"]?.
GetValue
<string>();
2035
var resourceGroup = stateSection.Data["ResourceGroup"]?.
GetValue
<string>();
2036
var location = stateSection.Data["Location"]?.
GetValue
<string>();
2037
var sandboxGroup = stateSection.Data["SandboxGroup"]?.
GetValue
<string>();
2058
!string.IsNullOrWhiteSpace(stateSection.Data["OwnerId"]?.
GetValue
<string>()) ||
2059
!string.IsNullOrWhiteSpace(stateSection.Data["SandboxId"]?.
GetValue
<string>()) ||
2060
!string.IsNullOrWhiteSpace(stateSection.Data["DiskImageId"]?.
GetValue
<string>());
2082
if (port["Url"]?.
GetValue
<string>() is { Length: > 0 } url)
2098
if (previousStateSection.Data["DeployId"]?.
GetValue
<string>() is { Length: > 0 } previousDeployId)
2113
if (previousStateSection.Data[stateKey]?.
GetValue
<string>() is { Length: > 0 } previousId)
2127
if (port["Port"]?.
GetValue
<int>() is { } portNumber)
2136
if (stateSection.Data["Port"]?.
GetValue
<int>() is { } legacyPort)
2267
var value = section.Data[name]?.
GetValue
<string>();
AzureSandboxEndpointPropertyValueProvider.cs (3)
131
if (port["Port"]?.
GetValue
<int>() == _sandboxEndpoint.TargetPort)
136
if (string.Equals(port["Name"]?.
GetValue
<string>(), _sandboxEndpoint.Name, StringComparison.Ordinal))
147
url = port["Url"]?.
GetValue
<string>();
Aspire.Hosting.Azure.Tests (151)
AzureBicepProvisionerTests.cs (18)
1021
Assert.Equal("westus3", section.Data[AzureProvisioningController.LocationOverrideKey]?.
GetValue
<string>());
1083
Assert.Equal("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/test-rg/providers/Microsoft.Resources/deployments/storage2", section.Data["Id"]?.
GetValue
<string>());
1084
Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateRunning, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.
GetValue
<string>());
1338
Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateCanceled, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.
GetValue
<string>());
1371
Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateCanceled, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.
GetValue
<string>());
1403
Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateCanceled, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.
GetValue
<string>());
1438
Assert.Equal(deploymentId, section.Data[BicepUtilities.DeploymentStateIdKey]?.
GetValue
<string>());
1496
Assert.Equal(ResourcesProvisioningState.Failed.ToString(), section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.
GetValue
<string>());
1598
Assert.Equal(deploymentId, section.Data[BicepUtilities.DeploymentStateIdKey]?.
GetValue
<string>());
1599
var outputs = JsonNode.Parse(section.Data[BicepUtilities.DeploymentStateOutputsKey]!.
GetValue
<string>())!.AsObject();
1600
Assert.Equal("https://storage.blob.core.windows.net/", outputs["blobEndpoint"]?["value"]?.
GetValue
<string>());
1678
Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateRunning, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.
GetValue
<string>());
1679
Assert.Equal(deploymentId, section.Data[BicepUtilities.DeploymentStateIdKey]?.
GetValue
<string>());
1707
Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateRunning, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.
GetValue
<string>());
1708
Assert.Equal(deploymentId, section.Data[BicepUtilities.DeploymentStateIdKey]?.
GetValue
<string>());
1733
Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateFailed, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.
GetValue
<string>());
1758
Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateCanceled, section.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.
GetValue
<string>());
1792
Assert.Equal(deploymentId, section.Data[BicepUtilities.DeploymentStateIdKey]?.
GetValue
<string>());
AzureEnvironmentResourceExtensionsTests.cs (126)
368
Assert.Contains("orphaned", resultData["warning"]?.
GetValue
<string>(), StringComparison.Ordinal);
370
Assert.Contains(recommendedActions, action => action?["code"]?.
GetValue
<string>() == "delete-live-resources");
762
Assert.Equal(1, data["resourceCount"]?.
GetValue
<int>());
842
Assert.Equal(AzureProvisioningController.GetAzureResourceCommandName, data["command"]?.
GetValue
<string>());
843
Assert.Equal("storage", data["resourceName"]?.
GetValue
<string>());
844
Assert.Equal("westus2", data["azureLocation"]?.
GetValue
<string>());
845
Assert.Equal("westus3", data["location"]?.
GetValue
<string>());
846
Assert.Equal("westus3", data["effectiveLocation"]?.
GetValue
<string>());
851
Assert.Equal(subscriptionId, azureContext["subscriptionId"]?.
GetValue
<string>());
852
Assert.Equal(tenantId, azureContext["tenantId"]?.
GetValue
<string>());
853
Assert.Equal(resourceGroup, azureContext["resourceGroup"]?.
GetValue
<string>());
854
Assert.Equal("westus2", azureContext["location"]?.
GetValue
<string>());
857
Assert.True(deployment["hasState"]?.
GetValue
<bool>());
858
Assert.Equal(deploymentId, deployment["deploymentId"]?.
GetValue
<string>());
859
Assert.Equal(resourceId, deployment["resourceId"]?.
GetValue
<string>());
860
Assert.Equal("westus3", deployment["locationOverride"]?.
GetValue
<string>());
861
Assert.Equal("checksum", deployment["checksum"]?.
GetValue
<string>());
862
Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateRunning, deployment["provisioningState"]?.
GetValue
<string>());
863
Assert.Contains("/DeploymentDetailsBlade/", deployment["deploymentPortalUrl"]?.
GetValue
<string>());
864
Assert.Contains("/resource/subscriptions/", deployment["resourcePortalUrl"]?.
GetValue
<string>());
867
Assert.Equal("https://storage.blob.core.windows.net/", outputs["blobEndpoint"]?["value"]?.
GetValue
<string>());
870
Assert.Equal(resourceGroup, scope["resourceGroup"]?.
GetValue
<string>());
873
Assert.True(live["checked"]?.
GetValue
<bool>());
874
Assert.True(live["exists"]?.
GetValue
<bool>());
926
Assert.True(live["checked"]?.
GetValue
<bool>());
927
Assert.False(live["exists"]?.
GetValue
<bool>());
928
Assert.Equal("missing-live-resource", live["reason"]?.
GetValue
<string>());
929
Assert.Equal("azure", live["source"]?.
GetValue
<string>());
930
Assert.Equal("missing-live-resource", live["code"]?.
GetValue
<string>());
931
Assert.Contains("resource was not found in Azure", live["message"]?.
GetValue
<string>(), StringComparison.Ordinal);
933
Assert.Contains(recommendedActions, action => action?["code"]?.
GetValue
<string>() == "reprovision-or-forget-state");
987
Assert.Equal("Microsoft.Storage/storageAccounts", json["resourceType"]?.
GetValue
<string>());
988
Assert.Equal("storage", json["resourceName"]?.
GetValue
<string>());
989
Assert.Equal(targetResourceId, json["targetResourceId"]?.
GetValue
<string>());
1196
Assert.True(deployment["hasState"]?.
GetValue
<bool>());
1200
Assert.False(live["checked"]?.
GetValue
<bool>());
1202
Assert.Equal("missing-resource-id", live["reason"]?.
GetValue
<string>());
1203
Assert.Equal("aspire", live["source"]?.
GetValue
<string>());
1204
Assert.Equal("missing-resource-id", live["code"]?.
GetValue
<string>());
1205
Assert.Contains("cached deployment state does not contain a resource ID", live["message"]?.
GetValue
<string>(), StringComparison.Ordinal);
1207
Assert.Contains(recommendedActions, action => action?["code"]?.
GetValue
<string>() == "reprovision-or-change-context");
1259
Assert.True(live["checked"]?.
GetValue
<bool>());
1261
Assert.Equal("request-failed", live["reason"]?.
GetValue
<string>());
1262
Assert.Equal("azure", live["source"]?.
GetValue
<string>());
1263
Assert.Equal(403, live["status"]?.
GetValue
<int>());
1264
Assert.Equal("Azure", live["provider"]?.
GetValue
<string>());
1265
Assert.Equal(403, live["httpStatus"]?.
GetValue
<int>());
1266
Assert.Equal("AuthorizationFailed", live["errorCode"]?.
GetValue
<string>());
1267
Assert.Equal("live-resource-check", live["operation"]?.
GetValue
<string>());
1268
Assert.Contains("Forbidden", live["message"]?.
GetValue
<string>(), StringComparison.Ordinal);
1320
Assert.True(live["checked"]?.
GetValue
<bool>());
1322
Assert.Equal("credential-unavailable", live["reason"]?.
GetValue
<string>());
1323
Assert.Contains("Credential unavailable", live["message"]?.
GetValue
<string>(), StringComparison.Ordinal);
1383
Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateCanceled, storageSection.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.
GetValue
<string>());
1517
Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateCanceled, storageSection.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.
GetValue
<string>());
1721
Assert.Equal(BicepProvisioner.DeploymentStateProvisioningStateSucceeded, storageSection.Data[BicepProvisioner.DeploymentStateProvisioningStateKey]?.
GetValue
<string>());
1811
Assert.Equal(2, resultData["deletedResourceCount"]?.
GetValue
<int>());
1813
Assert.Equal(deletedResourceIds, resultResourceIds.Select(static resourceId => resourceId!.
GetValue
<string>()));
1816
Assert.Equal("westus3", storageSection.Data[AzureProvisioningController.LocationOverrideKey]?.
GetValue
<string>());
1821
Assert.Equal("storage2-deployment", storage2Section.Data["Id"]?.
GetValue
<string>());
1902
Assert.Equal(1, resultData["deletedResourceCount"]?.
GetValue
<int>());
2130
Assert.Equal("storage2-deployment", storage2Section.Data["Id"]?.
GetValue
<string>());
2195
Assert.Equal("storage2-deployment", storage2Section.Data["Id"]?.
GetValue
<string>());
2804
Assert.Equal("westus2", storageSection.Data[AzureProvisioningController.LocationOverrideKey]?.
GetValue
<string>());
2851
Assert.Equal("westus3", storageSection.Data[AzureProvisioningController.LocationOverrideKey]?.
GetValue
<string>());
2854
Assert.Equal(1, data["schemaVersion"]?.
GetValue
<int>());
2855
Assert.Equal(AzureProvisioningController.ChangeResourceLocationCommandName, data["command"]?.
GetValue
<string>());
2856
Assert.Equal("storage", data["resourceName"]?.
GetValue
<string>());
2857
Assert.Equal("westus3", data["location"]?.
GetValue
<string>());
2858
Assert.Equal("westus3", data["effectiveLocation"]?.
GetValue
<string>());
2859
Assert.Equal("eastus", data["azureLocation"]?.
GetValue
<string>());
2861
Assert.Equal("eastus", azureContext["location"]?.
GetValue
<string>());
2909
Assert.Equal("westus3", bicepSection.Data[AzureProvisioningController.LocationOverrideKey]?.
GetValue
<string>());
3235
Assert.Equal("westus3", storageSection.Data[AzureProvisioningController.LocationOverrideKey]?.
GetValue
<string>());
3297
Assert.Equal("westus3", storageSection.Data[AzureProvisioningController.LocationOverrideKey]?.
GetValue
<string>());
3362
Assert.Equal("westus3", storageSection.Data[AzureProvisioningController.LocationOverrideKey]?.
GetValue
<string>());
3416
Assert.Equal("12345678-1234-1234-1234-123456789012", azureSection.Data["SubscriptionId"]?.
GetValue
<string>());
3417
Assert.Equal("westus2", azureSection.Data["Location"]?.
GetValue
<string>());
3418
Assert.Equal("test-rg", azureSection.Data["ResourceGroup"]?.
GetValue
<string>());
3419
Assert.Equal("87654321-4321-4321-4321-210987654321", azureSection.Data["TenantId"]?.
GetValue
<string>());
3462
Assert.Equal("12345678-1234-1234-1234-123456789012", azureSection.Data["SubscriptionId"]?.
GetValue
<string>());
3463
Assert.Equal("westus3", azureSection.Data["Location"]?.
GetValue
<string>());
3464
Assert.Equal("cli-rg-é", azureSection.Data["ResourceGroup"]?.
GetValue
<string>());
3465
Assert.Equal("87654321-4321-4321-4321-210987654321", azureSection.Data["TenantId"]?.
GetValue
<string>());
3468
Assert.Equal(1, data["schemaVersion"]?.
GetValue
<int>());
3469
Assert.Equal(AzureProvisioningController.ChangeAzureContextCommandName, data["command"]?.
GetValue
<string>());
3470
Assert.Equal("12345678-1234-1234-1234-123456789012", data["subscriptionId"]?.
GetValue
<string>());
3471
Assert.Equal("87654321-4321-4321-4321-210987654321", data["tenantId"]?.
GetValue
<string>());
3472
Assert.Equal("cli-rg-é", data["resourceGroup"]?.
GetValue
<string>());
3473
Assert.Equal("westus3", data["azureLocation"]?.
GetValue
<string>());
3475
Assert.Equal("12345678-1234-1234-1234-123456789012", azureContext["subscriptionId"]?.
GetValue
<string>());
3476
Assert.Equal("87654321-4321-4321-4321-210987654321", azureContext["tenantId"]?.
GetValue
<string>());
3477
Assert.Equal("cli-rg-é", azureContext["resourceGroup"]?.
GetValue
<string>());
3478
Assert.Equal("westus3", azureContext["location"]?.
GetValue
<string>());
3482
Assert.Equal(1, data["resourceCount"]?.
GetValue
<int>());
3583
Assert.Equal("westus2", azureSection.Data["Location"]?.
GetValue
<string>());
3678
Assert.Equal("westus3", storage2Section.Data[AzureProvisioningController.LocationOverrideKey]?.
GetValue
<string>());
3724
Assert.Equal("westus3", storage2Section.Data[AzureProvisioningController.LocationOverrideKey]?.
GetValue
<string>());
3783
Assert.Equal("westus3", storage2Section.Data[AzureProvisioningController.LocationOverrideKey]?.
GetValue
<string>());
4026
Assert.False(data["success"]?.
GetValue
<bool>());
4029
Assert.Equal("Microsoft.KeyVault", diagnostic["provider"]?.
GetValue
<string>());
4030
Assert.Equal("Microsoft.KeyVault/vaults", diagnostic["resourceType"]?.
GetValue
<string>());
4031
Assert.Equal("kv-test", diagnostic["resourceName"]?.
GetValue
<string>());
4032
Assert.Equal(keyVaultResourceId, diagnostic["targetResourceId"]?.
GetValue
<string>());
4033
Assert.Equal(AzureProvisioningFailureDetails.KeyVaultDeletedStateTombstoneNotFoundReason, diagnostic["errorCode"]?.
GetValue
<string>());
4034
Assert.Equal(409, diagnostic["httpStatus"]?.
GetValue
<int>());
4035
Assert.Contains("deleted vault was not found", diagnostic["errorMessage"]?.
GetValue
<string>(), StringComparison.Ordinal);
4037
Assert.Contains(recommendedActions, action => action?["code"]?.
GetValue
<string>() == "retry-reprovision");
4233
Assert.False(data["success"]?.
GetValue
<bool>());
4234
Assert.Equal("failed", data["status"]?.
GetValue
<string>());
4237
Assert.Equal("azure", diagnostic["source"]?.
GetValue
<string>());
4238
Assert.Equal("Microsoft.ManagedIdentity", diagnostic["provider"]?.
GetValue
<string>());
4239
Assert.Equal("Microsoft.ManagedIdentity/userAssignedIdentities", diagnostic["resourceType"]?.
GetValue
<string>());
4240
Assert.Equal(400, diagnostic["httpStatus"]?.
GetValue
<int>());
4241
Assert.Equal("LocationNotAvailableForResourceType", diagnostic["errorCode"]?.
GetValue
<string>());
4242
Assert.Equal("provision", diagnostic["operation"]?.
GetValue
<string>());
4244
Assert.Contains(resultRecommendedActions, action => action?["code"]?.
GetValue
<string>() == "change-location");
4539
Assert.Equal("12345678-1234-1234-1234-123456789012", azureSection.Data["SubscriptionId"]?.
GetValue
<string>());
4540
Assert.Equal("westus2", azureSection.Data["Location"]?.
GetValue
<string>());
4541
Assert.Equal("test-rg", azureSection.Data["ResourceGroup"]?.
GetValue
<string>());
4542
Assert.Equal("87654321-4321-4321-4321-210987654321", azureSection.Data["TenantId"]?.
GetValue
<string>());
4688
Assert.Equal("storage-deployment", storageSection.Data["Id"]?.
GetValue
<string>());
5555
azureSection.Data["SubscriptionId"]?.
GetValue
<string>(),
5556
azureSection.Data["ResourceGroup"]?.
GetValue
<string>(),
5557
azureSection.Data["Location"]?.
GetValue
<string>(),
5558
azureSection.Data["TenantId"]?.
GetValue
<string>());
AzureSandboxesTests.cs (3)
345
Assert.Equal("existing-rg", rolesManifest["scope"]?["resourceGroup"]?.
GetValue
<string>());
832
Assert.Equal("production-sandbox", directCleanupState?["SandboxId"]?.
GetValue
<string>());
833
Assert.Equal("production-disk", directCleanupState?["DiskImageId"]?.
GetValue
<string>());
BicepUtilitiesTests.cs (2)
63
Assert.Equal(20, parameters["age"]?["value"]?.
GetValue
<int>());
422
Assert.Null(scope["resourceGroup"]?.AsValue().
GetValue
<object>());
DefaultArmClientProviderTests.cs (1)
158
Assert.Equal("https://storage.blob.core.windows.net/", deployment.Outputs?["blobEndpoint"]?["value"]?.
GetValue
<string>());
JsonExtensionsTests.cs (1)
23
Assert.Equal("TestValue", retrievedNode["TestProperty"]!.
GetValue
<string>());
Aspire.Hosting.CodeGeneration.TypeScript.Tests (44)
AtsTypeScriptCodeGeneratorTests.cs (2)
42
Assert.Equal("aspire-host", packageJson["name"]?.
GetValue
<string>());
43
Assert.Equal("module", packageJson["type"]?.
GetValue
<string>());
TypeScriptLanguageSupportTests.cs (42)
34
Assert.Equal("brownfieldapp", packageJson["name"]?.
GetValue
<string>());
35
Assert.Equal("1.0.0", packageJson["version"]?.
GetValue
<string>());
36
Assert.True(packageJson["private"]?.
GetValue
<bool>());
37
Assert.Equal("module", packageJson["type"]?.
GetValue
<string>());
38
Assert.Equal("aspire run", scripts["aspire:start"]?.
GetValue
<string>());
39
Assert.Equal("tsc -p tsconfig.apphost.json", scripts["aspire:build"]?.
GetValue
<string>());
40
Assert.Equal("tsc --watch -p tsconfig.apphost.json", scripts["aspire:dev"]?.
GetValue
<string>());
41
Assert.Equal("eslint apphost.mts", scripts["aspire:lint"]?.
GetValue
<string>());
42
Assert.Equal("npm run aspire:lint", scripts["lint"]?.
GetValue
<string>());
43
Assert.Equal("npm run aspire:lint", scripts["predev"]?.
GetValue
<string>());
44
Assert.Equal("npm run aspire:start", scripts["dev"]?.
GetValue
<string>());
45
Assert.Equal("npm run aspire:lint", scripts["prebuild"]?.
GetValue
<string>());
46
Assert.Equal("npm run aspire:build", scripts["build"]?.
GetValue
<string>());
47
Assert.Equal("npm run aspire:dev", scripts["watch"]?.
GetValue
<string>());
48
Assert.Equal("^4.21.0", devDependencies["tsx"]?.
GetValue
<string>());
49
Assert.Equal("^5.9.3", devDependencies["typescript"]?.
GetValue
<string>());
50
Assert.Equal("^10.0.3", devDependencies["eslint"]?.
GetValue
<string>());
51
Assert.Equal("^8.57.1", devDependencies["typescript-eslint"]?.
GetValue
<string>());
54
Assert.Equal("^20.19.0 || ^22.13.0 || >=24", engines["node"]?.
GetValue
<string>());
63
Assert.Equal("./dist/apphost", tsConfig["compilerOptions"]?["outDir"]?.
GetValue
<string>());
111
Assert.Equal("aspire run", scripts["aspire:start"]?.
GetValue
<string>());
112
Assert.Equal("tsc -p tsconfig.apphost.json", scripts["aspire:build"]?.
GetValue
<string>());
113
Assert.Equal("tsc --watch -p tsconfig.apphost.json", scripts["aspire:dev"]?.
GetValue
<string>());
114
Assert.Equal("eslint apphost.mts", scripts["aspire:lint"]?.
GetValue
<string>());
120
Assert.Equal("^8.2.0", dependencies["vscode-jsonrpc"]?.
GetValue
<string>());
121
Assert.Equal("^4.21.0", devDependencies["tsx"]?.
GetValue
<string>());
122
Assert.Equal("^22.0.0", devDependencies["@types/node"]?.
GetValue
<string>());
123
Assert.Equal("^3.1.14", devDependencies["nodemon"]?.
GetValue
<string>());
124
Assert.Equal("^5.9.3", devDependencies["typescript"]?.
GetValue
<string>());
129
Assert.Equal("^20.19.0 || ^22.13.0 || >=24", engines["node"]?.
GetValue
<string>());
147
Assert.Equal("aspire-apphost", packageJson["name"]?.
GetValue
<string>());
148
Assert.Equal("1.0.0", packageJson["version"]?.
GetValue
<string>());
149
Assert.True(packageJson["private"]?.
GetValue
<bool>());
150
Assert.Equal("module", packageJson["type"]?.
GetValue
<string>());
184
Assert.Equal("^8.2.0", dependencies["vscode-jsonrpc"]?.
GetValue
<string>());
185
Assert.Equal("^22.0.0", devDependencies["@types/node"]?.
GetValue
<string>());
186
Assert.Equal("^3.1.14", devDependencies["nodemon"]?.
GetValue
<string>());
187
Assert.Equal("^4.21.0", devDependencies["tsx"]?.
GetValue
<string>());
188
Assert.Equal("^5.9.3", devDependencies["typescript"]?.
GetValue
<string>());
236
var applicationUrls = httpsProfile["applicationUrl"]!.
GetValue
<string>().Split(';', StringSplitOptions.RemoveEmptyEntries);
243
var otlpHttpsPort = GetPort(environmentVariables["ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL"]!.
GetValue
<string>());
244
var resourceServiceHttpsPort = GetPort(environmentVariables["ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL"]!.
GetValue
<string>());
Aspire.Hosting.Foundry.Tests (4)
HostedAgentConfigurationTests.cs (3)
92
Assert.Equal(ProjectsAgentProtocol.Responses.ToString(), protocolVersion!["protocol"]!.
GetValue
<string>());
93
Assert.Equal("2.0.0", protocolVersion["version"]!.
GetValue
<string>());
94
Assert.Equal("myregistry.azurecr.io/myagent:v1", definition["container_configuration"]!["image"]!.
GetValue
<string>());
HostedAgentExtensionTests.cs (1)
187
Assert.Equal("hello from dashboard", JsonNode.Parse(fakeHandler.RequestContent!)?["message"]?.
GetValue
<string>());
Aspire.Hosting.Redis.Tests (30)
AddRedisTests.cs (26)
155
Assert.Equal("container.v0", manifest["type"]!.
GetValue
<string>());
156
var connectionString = manifest["connectionString"]!.
GetValue
<string>();
161
Assert.Equal($"{RedisContainerImageTags.Registry}/{RedisContainerImageTags.Image}:{RedisContainerImageTags.Tag}", manifest["image"]!.
GetValue
<string>());
162
Assert.Equal("/bin/sh", manifest["entrypoint"]!.
GetValue
<string>());
163
Assert.Equal("{redis-password.value}", manifest["env"]!["REDIS_PASSWORD"]!.
GetValue
<string>());
164
Assert.Equal("redis", manifest["bindings"]!["tcp"]!["scheme"]!.
GetValue
<string>());
165
Assert.Equal(6379, manifest["bindings"]!["tcp"]!["targetPort"]!.
GetValue
<int>());
180
Assert.Equal("container.v0", manifest["type"]!.
GetValue
<string>());
181
var connectionString = manifest["connectionString"]!.
GetValue
<string>();
186
Assert.Equal($"{RedisContainerImageTags.Registry}/{RedisContainerImageTags.Image}:{RedisContainerImageTags.Tag}", manifest["image"]!.
GetValue
<string>());
187
Assert.Equal("/bin/sh", manifest["entrypoint"]!.
GetValue
<string>());
188
Assert.Equal("redis", manifest["bindings"]!["tcp"]!["scheme"]!.
GetValue
<string>());
189
Assert.Equal(6379, manifest["bindings"]!["tcp"]!["targetPort"]!.
GetValue
<int>());
209
Assert.Equal("container.v0", manifest["type"]!.
GetValue
<string>());
210
var connectionString = manifest["connectionString"]!.
GetValue
<string>();
215
Assert.Equal($"{RedisContainerImageTags.Registry}/{RedisContainerImageTags.Image}:{RedisContainerImageTags.Tag}", manifest["image"]!.
GetValue
<string>());
216
Assert.Equal("{pass.value}", manifest["env"]!["REDIS_PASSWORD"]!.
GetValue
<string>());
217
Assert.Equal("redis", manifest["bindings"]!["tcp"]!["scheme"]!.
GetValue
<string>());
218
Assert.Equal(6379, manifest["bindings"]!["tcp"]!["targetPort"]!.
GetValue
<int>());
235
Assert.Equal("container.v0", manifest["type"]!.
GetValue
<string>());
236
var connectionString = manifest["connectionString"]!.
GetValue
<string>();
241
Assert.Equal($"{RedisContainerImageTags.Registry}/{RedisContainerImageTags.Image}:{RedisContainerImageTags.Tag}", manifest["image"]!.
GetValue
<string>());
242
Assert.Equal("{pass.value}", manifest["env"]!["REDIS_PASSWORD"]!.
GetValue
<string>());
243
Assert.Equal("redis", manifest["bindings"]!["tcp"]!["scheme"]!.
GetValue
<string>());
244
Assert.Equal(6379, manifest["bindings"]!["tcp"]!["targetPort"]!.
GetValue
<int>());
1003
Assert.Equal("value.v0", creEntry["type"]!.
GetValue
<string>());
RedisFunctionalTests.cs (4)
612
Assert.False(agreements["analytics"]!.
GetValue
<bool>());
613
Assert.False(agreements["notifications"]!.
GetValue
<bool>());
614
Assert.False(agreements["encryption"]!.
GetValue
<bool>());
615
Assert.True(agreements["eula"]!.
GetValue
<bool>());
Aspire.Hosting.RemoteHost (8)
Ats\AtsMarshaller.cs (4)
898
return value.
GetValue
<string>();
903
return value.
GetValue
<bool>();
948
return value.
GetValue
<double>();
953
return value.TryGetValue<float>(out var floatValue) ? floatValue : (float)value.
GetValue
<double>();
Ats\CapabilityDispatcher.cs (3)
1035
return value.
GetValue
<string>() ??
1046
return value.
GetValue
<string>();
1058
return value.
GetValue
<int>();
Ats\HandleRegistry.cs (1)
200
var handleId = handleNode?.
GetValue
<string>();
Aspire.Hosting.RemoteHost.Tests (117)
AtsMarshallerTests.cs (29)
137
Assert.Equal("hello", result.
GetValue
<string>());
148
Assert.Equal(42, result.
GetValue
<int>());
159
Assert.True(result.
GetValue
<bool>());
170
Assert.Equal("ValueB", result.
GetValue
<string>());
181
Assert.Equal(1500.0, result.
GetValue
<double>());
196
Assert.Equal(1, jsonArray[0]!.
GetValue
<int>());
197
Assert.Equal(2, jsonArray[1]!.
GetValue
<int>());
198
Assert.Equal(3, jsonArray[2]!.
GetValue
<int>());
211
var tokenId = tokenValue.
GetValue
<string>();
232
var tokenId = tokenValue.
GetValue
<string>();
461
Assert.Equal("2024-06-15", result.
GetValue
<string>());
484
Assert.Contains("14:30:45", result.
GetValue
<string>());
505
Assert.Equal(9223372036854775807L, result.
GetValue
<long>());
516
Assert.Equal(3.14159, result.
GetValue
<double>());
545
var typeId = jsonObj["$type"]!.
GetValue
<string>();
564
var typeId = jsonObj["$type"]!.
GetValue
<string>();
776
Assert.Equal("test", jsonObj["name"]?.
GetValue
<string>());
777
Assert.Equal(10, jsonObj["count"]?.
GetValue
<int>());
829
Assert.Equal(1500, json["required"]?.
GetValue
<double>());
830
Assert.Equal(90_000, json["optional"]?.
GetValue
<double>());
923
Assert.Equal("root", obj["name"]!.
GetValue
<string>());
939
Assert.Equal("parent", obj["label"]!.
GetValue
<string>());
941
Assert.Equal("child", childObj["label"]!.
GetValue
<string>());
959
Assert.Equal("typed", obj["name"]!.
GetValue
<string>());
975
Assert.Equal("parent", obj["label"]!.
GetValue
<string>());
977
Assert.Equal("child", childObj["label"]!.
GetValue
<string>());
1264
var handleId = json["$handle"]!.
GetValue
<string>();
1282
var handleId = json!["$handle"]!.
GetValue
<string>();
1301
var handleId = json!["$handle"]!.
GetValue
<string>();
CallbackProxyTests.cs (10)
128
Assert.Equal("hello-world", args["p0"]?.
GetValue
<string>());
145
Assert.Equal("test-name", args["p0"]?.
GetValue
<string>());
146
Assert.Equal(42, args["p1"]?.
GetValue
<int>());
170
Assert.NotNull(handle["$handle"]?.
GetValue
<string>());
171
Assert.Equal(AtsTypeMapping.DeriveTypeId(typeof(ITestCallbackHandle)), handle["$type"]?.
GetValue
<string>());
201
Assert.Equal("test", args["p0"]?.
GetValue
<string>());
202
var tokenId = args["p1"]?.
GetValue
<string>();
205
Assert.Equal(tokenId, args["$cancellationToken"]?.
GetValue
<string>());
222
var tokenId = args["p0"]?.
GetValue
<string>();
224
Assert.Equal(tokenId, args["$cancellationToken"]?.
GetValue
<string>());
CapabilityDispatcherTests.cs (76)
69
receivedName = args?["name"]?.
GetValue
<string>();
87
Assert.Equal(42, result.
GetValue
<int>());
189
Assert.Equal("HELLO", result.
GetValue
<string>());
201
Assert.Equal("test:default", result.
GetValue
<string>());
213
Assert.Equal("test:custom", result.
GetValue
<string>());
269
Assert.Equal("test-name", nameResult.
GetValue
<string>());
271
Assert.Equal(100, countResult.
GetValue
<int>());
330
Assert.True(result.
GetValue
<bool>());
390
var nestedHandleId = handleRef["$handle"]!.
GetValue
<string>();
391
var nestedTypeId = handleRef["$type"]!.
GetValue
<string>();
401
Assert.Equal("Publish", operationResult.
GetValue
<string>());
576
Assert.Equal(12, result.
GetValue
<int>());
596
Assert.Equal("TEST", result.
GetValue
<string>());
616
Assert.Equal("VALUE-TASK", result.
GetValue
<string>());
628
Assert.Equal("VALUE-TASK", result.
GetValue
<string>());
675
Assert.Equal("PROCESSED: test-input", result.
GetValue
<string>());
719
Assert.Equal("hello from C#", callbackArgs["p0"]?.
GetValue
<string>());
739
Assert.Equal(42, result.
GetValue
<int>());
751
Assert.Equal(callerThreadId, result.
GetValue
<int>());
763
Assert.NotEqual(callerThreadId, result.
GetValue
<int>());
775
Assert.NotEqual(callerThreadId, result.
GetValue
<int>());
800
Assert.NotEqual(callerThreadId, result.
GetValue
<int>());
917
Assert.Equal("HELLO", result.
GetValue
<string>());
946
Assert.Equal(15, result.
GetValue
<int>());
961
Assert.Equal("item0", resultArray[0]?.
GetValue
<string>());
962
Assert.Equal("item1", resultArray[1]?.
GetValue
<string>());
963
Assert.Equal("item2", resultArray[2]?.
GetValue
<string>());
978
Assert.Equal(60, result.
GetValue
<int>());
991
Assert.Equal("hello", result.
GetValue
<string>());
1003
Assert.Equal("42", result.
GetValue
<string>());
1021
Assert.Equal("dto-value", result.
GetValue
<string>());
1033
Assert.Equal("enum:ValueB", result.
GetValue
<string>());
1045
Assert.Equal("string:/usr/local/lib/redis/modules/redisearch.so", result.
GetValue
<string>());
1086
Assert.Equal("union-resource", result.
GetValue
<string>());
1152
var listHandle = (listResult as JsonObject)?["$handle"]?.
GetValue
<string>();
1165
Assert.Equal("second", result.
GetValue
<string>());
1175
var listHandle = (listResult as JsonObject)?["$handle"]?.
GetValue
<string>();
1187
Assert.Equal(20, result.
GetValue
<int>());
1198
var listHandle = (listResult as JsonObject)?["$handle"]?.
GetValue
<string>();
1210
Assert.True(removeResult.
GetValue
<bool>());
1220
Assert.Equal(2, lengthResult.
GetValue
<int>());
1231
var listHandle = (listResult as JsonObject)?["$handle"]?.
GetValue
<string>();
1242
Assert.Equal(3, result.
GetValue
<int>());
1253
var listHandle = (listResult as JsonObject)?["$handle"]?.
GetValue
<string>();
1271
Assert.Equal(0, lengthResult.
GetValue
<int>());
1298
var dictHandle = (dictResult as JsonObject)?["$handle"]?.
GetValue
<string>();
1311
Assert.Equal("value1", result.
GetValue
<string>());
1321
var dictHandle = (dictResult as JsonObject)?["$handle"]?.
GetValue
<string>();
1333
Assert.Equal(10, result.
GetValue
<int>());
1343
var dictHandle = (dictResult as JsonObject)?["$handle"]?.
GetValue
<string>();
1355
Assert.Equal("one", result.
GetValue
<string>());
1366
var dictHandle = (dictResult as JsonObject)?["$handle"]?.
GetValue
<string>();
1378
Assert.True(removeResult.
GetValue
<bool>());
1388
Assert.Equal(1, countResult.
GetValue
<int>());
1399
var dictHandle = (dictResult as JsonObject)?["$handle"]?.
GetValue
<string>();
1411
Assert.True(hasResult.
GetValue
<bool>());
1422
Assert.False(hasResult2.
GetValue
<bool>());
1433
var dictHandle = (dictResult as JsonObject)?["$handle"]?.
GetValue
<string>();
1447
Assert.Contains("key1", keysArray.Select(k => k?.
GetValue
<string>()));
1448
Assert.Contains("key2", keysArray.Select(k => k?.
GetValue
<string>()));
1458
var dictHandle = (dictResult as JsonObject)?["$handle"]?.
GetValue
<string>();
1471
Assert.Contains(1, keysArray.Select(k => k?.
GetValue
<int>()));
1472
Assert.Contains(2, keysArray.Select(k => k?.
GetValue
<int>()));
1482
var dictHandle = (dictResult as JsonObject)?["$handle"]?.
GetValue
<string>();
1502
var dictHandle = (dictResult as JsonObject)?["$handle"]?.
GetValue
<string>();
1513
Assert.Equal(2, result.
GetValue
<int>());
1530
Assert.Equal("Received: ValueB", result.
GetValue
<string>());
1547
Assert.Equal("Received: ValueC", result.
GetValue
<string>());
1564
Assert.Equal("ValueA", result.
GetValue
<string>());
1581
Assert.Equal("Received: ValueB", result.
GetValue
<string>());
1593
Assert.Equal("No value", result.
GetValue
<string>());
1682
Assert.Equal("blue", result.
GetValue
<string>());
1723
Assert.Equal("hello, test-resource!", result.
GetValue
<string>());
1740
Assert.Equal("yellow", result.
GetValue
<string>());
1757
Assert.Equal("my-resource", result.
GetValue
<string>());
2100
Assert.Equal("Host", result.
GetValue
<string>());
HandleRegistryTests.cs (2)
176
Assert.Equal("aspire/TestObject", json["$type"]!.
GetValue
<string>());
178
var handleId = json["$handle"]!.
GetValue
<string>();
Aspire.Hosting.Tests (88)
Backchannel\AuxiliaryBackchannelRpcTargetTests.cs (13)
326
Assert.Equal("normal-value", normalJsonValue.
GetValue
<string>());
1278
Assert.Equal("42", Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["number"]).
GetValue
<string>());
1279
Assert.Equal(bool.TrueString, Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["flag"]).
GetValue
<string>());
1280
Assert.Equal("one,two", Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["list"]).
GetValue
<string>());
1325
Assert.Equal(42, Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["number"]).
GetValue
<int>());
1326
Assert.True(Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["flag"]).
GetValue
<bool>());
1330
value => Assert.Equal("one", value?.
GetValue
<string>()),
1331
value => Assert.Equal("two", value?.
GetValue
<string>()));
1333
Assert.Equal("localhost", nameValueObject["Host"]?.
GetValue
<string>());
1334
Assert.Equal("catalogdb", nameValueObject["DatabaseName"]?.
GetValue
<string>());
1370
Assert.Equal("true", Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["terminal.enabled"]).
GetValue
<string>());
1371
Assert.Equal("0", Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["terminal.replicaIndex"]).
GetValue
<string>());
1372
Assert.Equal("1", Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["terminal.replicaCount"]).
GetValue
<string>());
Orchestrator\ParameterProcessorTests.cs (8)
1153
Assert.Equal("firstValue", savedValueNode?.
GetValue
<string>());
1159
Assert.Equal("secondValue", savedValueNode?.
GetValue
<string>());
1186
Assert.Equal("newValue", savedValueNode?.
GetValue
<string>());
1427
Assert.Equal("Server=localhost;Database=mydb", valueNode?.
GetValue
<string>());
1468
Assert.Equal("myvalue", valueNode?.
GetValue
<string>());
1512
Assert.Equal("customvalue", valueNode?.
GetValue
<string>());
1551
Assert.Equal("savedValue", savedValueNode?.
GetValue
<string>());
1569
Assert.Equal("savedValue", savedValueNode?.
GetValue
<string>());
Publishing\DeploymentStateManagerTests.cs (67)
51
Assert.Equal("value1", section2.Data["key1"]?.
GetValue
<string>());
120
Assert.Equal("value1", parametersCheck.Data["param1"]?.
GetValue
<string>());
121
Assert.Equal("azure-value1", azureCheck.Data["resource1"]?.
GetValue
<string>());
149
Assert.Equal($"value{i}", section.Data[$"key{i}"]?.
GetValue
<string>());
168
Assert.Equal("value1", section2.Data["key1"]?.
GetValue
<string>());
189
Assert.Equal("value1", section2.Data["key1"]?.
GetValue
<string>());
202
Assert.Equal("value1", section3.Data["key1"]?.
GetValue
<string>());
203
Assert.Equal("value2", section3.Data["key2"]?.
GetValue
<string>());
241
Assert.Equal("value1", parametersSection.Data["param1"]?.
GetValue
<string>());
242
Assert.Equal("azure-value1", azureSection.Data["resource1"]?.
GetValue
<string>());
243
Assert.Equal("value1", restartedParametersSection.Data["param1"]?.
GetValue
<string>());
260
Assert.Equal("value1", retrievedSection.Data["key1"]?.
GetValue
<string>());
277
Assert.Equal("nestedValue", verifySection.Data["nestedKey"]?.
GetValue
<string>());
297
Assert.Equal("value1", verify1.Data["key1"]?.
GetValue
<string>());
298
Assert.Equal("value2", verify2.Data["key2"]?.
GetValue
<string>());
314
Assert.Equal("value1", verify.Data[""]?.
GetValue
<string>());
374
Assert.Equal("topValue", verifyTop.Data["topKey"]?.
GetValue
<string>());
375
Assert.Equal("nestedValue", verifyNested.Data["nestedKey"]?.
GetValue
<string>());
481
Assert.True(migratedSection.Data["legacy"]?.
GetValue
<bool>());
493
Assert.True(currentSection.Data["legacy"]?.
GetValue
<bool>());
494
Assert.True(currentSection.Data["current"]?.
GetValue
<bool>());
536
Assert.Equal("legacy", legacyAfterRestart.Data["Value"]?.
GetValue
<string>());
537
Assert.Equal("current", replacementAfterRestart.Data["Value"]?.
GetValue
<string>());
559
Assert.Equal("committed", restartedSection.Data["Value"]?.
GetValue
<string>());
597
Assert.Equal("legacy", parameterSection.Data[""]?.
GetValue
<string>());
624
Assert.Equal("existing", section.Data[""]?.
GetValue
<string>());
630
Assert.Equal("existing", restartedSection.Data[""]?.
GetValue
<string>());
661
Assert.Equal("updated", restartedSection.Data[""]?.
GetValue
<string>());
693
Assert.Equal("updated", restartedSection.Data["Leaf"]?.
GetValue
<string>());
723
Assert.True(features["A"]?.
GetValue
<bool>());
724
Assert.True(features["B"]?.
GetValue
<bool>());
757
Assert.Equal("first-sandbox", migratedFirstSection.Data["SandboxId"]?.
GetValue
<string>());
758
Assert.True(migratedFirstSection.Data["Migrated"]?.
GetValue
<bool>());
770
Assert.True(restartedFirstSection.Data["Migrated"]?.
GetValue
<bool>());
771
Assert.Equal("second-sandbox", restartedSecondSection.Data["SandboxId"]?.
GetValue
<string>());
776
Assert.Equal("second-sandbox", secondSection.Data["SandboxId"]?.
GetValue
<string>());
786
Assert.Equal("first-sandbox", clearedFirstLegacySection.Data["SandboxId"]?.
GetValue
<string>());
787
Assert.Equal("second-sandbox", preservedSecondLegacySection.Data["SandboxId"]?.
GetValue
<string>());
811
Assert.Equal("current-subscription", currentAzureSection.Data["SubscriptionId"]?.
GetValue
<string>());
816
Assert.Equal("current-subscription", restartedAzureSection.Data["SubscriptionId"]?.
GetValue
<string>());
817
Assert.Equal("first-sandbox", restartedAzureSection.Data["Sandboxes"]?["first"]?["SandboxId"]?.
GetValue
<string>());
818
Assert.Equal("second-sandbox", restartedAzureSection.Data["Sandboxes"]?["second"]?["SandboxId"]?.
GetValue
<string>());
854
restartedAzureSection.Data["Sandboxes"]?["new"]?["SandboxId"]?.
GetValue
<string>());
899
restartedSandboxesSection.Data["first"]?["new"]?["SandboxId"]?.
GetValue
<string>());
902
restartedSandboxesSection.Data["second"]?["SandboxId"]?.
GetValue
<string>());
938
Assert.Equal("first-sandbox", restartedFirstSection.Data["SandboxId"]?.
GetValue
<string>());
939
Assert.True(restartedFirstSection.Data["Updated"]?.
GetValue
<bool>());
940
Assert.Equal("second-sandbox", restartedSecondSection.Data["SandboxId"]?.
GetValue
<string>());
941
Assert.True(restartedSecondSection.Data["Updated"]?.
GetValue
<bool>());
971
Assert.Equal("current-subscription", restartedAzureSection.Data["SubscriptionId"]?.
GetValue
<string>());
972
Assert.Equal("current-location", restartedAzureSection.Data["Location"]?.
GetValue
<string>());
975
Assert.Equal("current-subscription", currentAzureSection.Data["SubscriptionId"]?.
GetValue
<string>());
976
Assert.Equal("current-location", currentAzureSection.Data["Location"]?.
GetValue
<string>());
1006
Assert.Equal("sub", preservedLegacySection.Data["SubscriptionId"]?.
GetValue
<string>());
1036
Assert.Equal("current-sub", asyncEffectiveState["Azure"]?["SubscriptionId"]?.
GetValue
<string>());
1037
Assert.Equal("current-sub", syncEffectiveState["Azure"]?["SubscriptionId"]?.
GetValue
<string>());
1038
Assert.Equal("current-sub", migratedSection.Data["SubscriptionId"]?.
GetValue
<string>());
1060
Assert.Equal("current-sub", asyncEffectiveState["Azure"]?["SubscriptionId"]?.
GetValue
<string>());
1061
Assert.Equal("current-sub", syncEffectiveState["Azure"]?["SubscriptionId"]?.
GetValue
<string>());
1062
Assert.Equal("current-sub", restartedSection.Data["SubscriptionId"]?.
GetValue
<string>());
1068
Assert.Equal("current-sub", savedSection.Data["SubscriptionId"]?.
GetValue
<string>());
1069
Assert.Equal("westus", savedSection.Data["Location"]?.
GetValue
<string>());
1087
Assert.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)
450
if (propertyNodeType?.GetValueKind() == JsonValueKind.String && propertyNodeType.
GetValue
<string>() == "boolean")
dotnet (1)
Commands\New\MSBuildEvaluation\ProjectCapabilityConstraint.cs (1)
88
string? configuredCapability = token.
GetValue
<string>();
dotnet-user-jwts (1)
Helpers\SigningKeysHandler.cs (1)
85
var toRemove = signingKeys.SingleOrDefault(key => key["Issuer"].
GetValue
<string>() == issuer);
Infrastructure.Tests (4)
Pipelines\NixCliPackageTests.cs (1)
265
return Assert.IsAssignableFrom<JsonValue>(value).
GetValue
<string>();
Pipelines\NpmCliPackageTests.cs (3)
779
return jsonObject[propertyName]?.
GetValue
<string>()
785
return jsonNode?.AsArray().Select(value => value?.
GetValue
<string>() ?? throw new InvalidOperationException("JSON array contains a null value.")).ToArray()
793
property => property.Value?.
GetValue
<string>() ?? throw new InvalidOperationException($"JSON property '{property.Key}' is not a string."),
Microsoft.AspNetCore.OpenApi (7)
Extensions\JsonNodeSchemaExtensions.cs (6)
383
var defaultValue = defaultNode.
GetValue
<string>();
388
if (serialized?.
GetValue
<string>() == defaultValue)
510
!string.IsNullOrEmpty(schemaIdNode.
GetValue
<string>()));
596
if (typeArray[i]?.
GetValue
<string>() == "null")
603
schema[OpenApiSchemaKeywords.TypeKeyword] = typeArray[0]?.
GetValue
<string>();
612
if (Enum.TryParse<JsonSchemaType>(jsonNode?.
GetValue
<string>(), true, out var openApiSchemaType))
Services\Schemas\OpenApiSchemaService.cs (1)
282
if (rawEnum[i]?.
GetValue
<string>() != memberNames[i])
Microsoft.Extensions.AI.Abstractions (8)
Utilities\AIJsonUtilities.Schema.Create.cs (7)
295
string refUri = paramName!.
GetValue
<string>();
346
string typeValue = typeKeyWord.
GetValue
<string>()!;
367
string typeValue = typeKeyWord.
GetValue
<string>()!;
582
if (entry?.
GetValue
<string>() == propertyName)
724
schemaType = typeNode.
GetValue
<string>();
736
string entryValue = entry.
GetValue
<string>();
789
entry.
GetValue
<string>() is string type)
Utilities\AIJsonUtilities.Schema.Transform.cs (1)
180
string? description = schemaObj.TryGetPropertyValue(DescriptionPropertyName, out JsonNode? descriptionSchema) ? descriptionSchema?.
GetValue
<string>() : null;
Microsoft.Extensions.AI.Abstractions.Tests (1)
Contents\FunctionCallContentTests.cs (1)
111
Assert.Equal(informationalOnly, informationalOnlyValue!.
GetValue
<bool>());
Microsoft.Extensions.AI.OpenAI (1)
OpenAIClientExtensions.cs (1)
93
$"{descriptionNode.
GetValue
<string>()}{Environment.NewLine}{additionalDescription}" :
Microsoft.ML.AutoML (9)
SweepableEstimator\Converter\MultiModelPipelineConverter.cs (2)
18
var schema = jValue["schema"].
GetValue
<string>();
19
var estimators = jValue["estimator"].
GetValue
<Dictionary<string, SweepableEstimator>>();
SweepableEstimator\Converter\SweepableEstimatorConverter.cs (2)
19
var estimatorType = jsonObject["estimatorType"].
GetValue
<EstimatorType>();
20
var parameter = jsonObject["parameter"].
GetValue
<Parameter>();
SweepableEstimator\Converter\SweepableEstimatorPipelineConverter.cs (2)
18
var parameter = jNode["parameter"].
GetValue
<Parameter>();
19
var estimators = jNode["estimators"].
GetValue
<SweepableEstimator[]>();
SweepableEstimator\Converter\SweepablePipelineConverter.cs (3)
18
var currentSchema = jValue["currentSchema"].
GetValue
<string>();
19
var schema = jValue["schema"].
GetValue
<string>();
20
var estimators = jValue["estimator"].
GetValue
<Dictionary<string, SweepableEstimator>>();
Microsoft.ML.AutoML.SourceGenerator (20)
SearchSpaceGenerator.cs (20)
39
var className = Utils.ToTitleCase(jNode["name"].
GetValue
<string>());
43
var optionName = Utils.ToTitleCase(t["name"].
GetValue
<string>());
44
string 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>(),
97
var minValue = searchSpaceNode["min"].
GetValue
<double>();
98
var maxValue = searchSpaceNode["max"].
GetValue
<double>();
99
var logBase = searchSpaceObject.ContainsKey("log_base") is false ? "false" : searchSpaceNode["log_base"].
GetValue
<bool>() ? "true" : "false";
Microsoft.NET.Build.Containers (5)
ImageConfig.cs (5)
70
internal string[]? GetEntrypoint() => _config["config"]?["Entrypoint"]?.AsArray()?.Select(node => node!.
GetValue
<string>())?.ToArray();
71
private string[]? GetCmd() => _config["config"]?["Entrypoint"]?.AsArray()?.Select(node => node!.
GetValue
<string>())?.ToArray();
289
string[] val = entry.
GetValue
<string>().Split('=', 2);
337
if (rootfs["type"]?.
GetValue
<string>() == "layers" && rootfs["diff_ids"] is JsonArray layers)
339
return layers.Select(l => l!.
GetValue
<string>()).ToList();
Microsoft.TemplateEngine.Cli (13)
Alias\AliasRegistry.cs (2)
203
result[property.Key] = new List<string>() { property.Value.
GetValue
<string>() };
212
values.Add(item.
GetValue
<string>());
HostSpecificTemplateData.cs (3)
33
.Select(v => v!.
GetValue
<string>()));
59
JsonValueKind.String => symbolProperty.Value.
GetValue
<string>(),
80
else if (kind == JsonValueKind.String && bool.TryParse(isHiddenNode.
GetValue
<string>(), out bool hidden))
JExtensions.cs (5)
30
return val.
GetValue
<string>();
47
return element.
GetValue
<string>();
91
return bool.TryParse(token.
GetValue
<string>(), out result);
210
values.Add(item.
GetValue
<string>());
262
return int.TryParse(token.
GetValue
<string>(), out result);
PostActionProcessors\ChmodPostActionProcessor.cs (1)
30
values[i] = valueArray[i]?.
GetValue
<string>() ?? "";
PostActionProcessors\PostActionProcessorBase.cs (2)
134
paths = config.
GetValue
<string>().Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
145
.Select(token => token!.
GetValue
<string>()).ToList();
Microsoft.TemplateEngine.Edge (19)
BuiltInManagedProvider\GlobalSettings.cs (1)
91
package![nameof(TemplatePackageData.LastChangeTime)]?.
GetValue
<DateTime>() ?? default,
Constraints\ConstraintsExtensions.cs (2)
24
return new[] { token.
GetValue
<string>() ?? throw new ConfigurationException(string.Format(LocalizableStrings.Constraint_Error_ArgumentHasEmptyString, args)) };
36
string? strValue = value.
GetValue
<string>();
Settings\SettingsStore.cs (3)
29
ComponentGuidToAssemblyQualifiedName[entry.Key] = entry.Value.
GetValue
<string>();
43
ProbingPaths.Add(path.
GetValue
<string>());
64
if (Guid.TryParse(value.
GetValue
<string>(), out Guid id))
Settings\TemplateCache.cs (2)
90
? localeToken!.
GetValue
<string>()
101
mountPointInfo.Add(entry.Key, entry.Value.
GetValue
<DateTime>());
Settings\TemplateInfoReader.cs (3)
38
classifications.Add(item.
GetValue
<string>());
99
tags.Add(item.Key, item.Value?.
GetValue
<string>() ?? string.Empty);
111
if (item != null && Guid.TryParse(item.
GetValue
<string>(), out Guid id))
src\sdk\src\TemplateEngine\Shared\JExtensions.cs (8)
38
return val.
GetValue
<string>();
57
return strVal.
GetValue
<string>();
104
return bool.TryParse(token.
GetValue
<string>(), out result);
139
return int.TryParse(token.
GetValue
<string>(), out result);
305
result[property.Key] = property.Value.
GetValue
<string>();
382
values.Add(item.
GetValue
<string>());
407
if (Guid.TryParse(item.
GetValue
<string>(), out Guid val))
472
string tokenValue = token.
GetValue
<string>();
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)
127
return val.GetValueKind() == JsonValueKind.String ? val.
GetValue
<string>() : val.ToJsonString();
src\sdk\src\TemplateEngine\Shared\JExtensions.cs (8)
38
return val.
GetValue
<string>();
57
return strVal.
GetValue
<string>();
104
return bool.TryParse(token.
GetValue
<string>(), out result);
139
return int.TryParse(token.
GetValue
<string>(), out result);
305
result[property.Key] = property.Value.
GetValue
<string>();
382
values.Add(item.
GetValue
<string>());
407
if (Guid.TryParse(item.
GetValue
<string>(), out Guid val))
472
string tokenValue = token.
GetValue
<string>();
Microsoft.TemplateEngine.Utils (8)
src\sdk\src\TemplateEngine\Shared\JExtensions.cs (8)
38
return val.
GetValue
<string>();
57
return strVal.
GetValue
<string>();
104
return bool.TryParse(token.
GetValue
<string>(), out result);
139
return int.TryParse(token.
GetValue
<string>(), out result);
305
result[property.Key] = property.Value.
GetValue
<string>();
382
values.Add(item.
GetValue
<string>());
407
if (Guid.TryParse(item.
GetValue
<string>(), out Guid val))
472
string tokenValue = token.
GetValue
<string>();
Microsoft.TemplateSearch.Common (8)
src\sdk\src\TemplateEngine\Shared\JExtensions.cs (8)
38
return val.
GetValue
<string>();
57
return strVal.
GetValue
<string>();
104
return bool.TryParse(token.
GetValue
<string>(), out result);
139
return int.TryParse(token.
GetValue
<string>(), out result);
305
result[property.Key] = property.Value.
GetValue
<string>();
382
values.Add(item.
GetValue
<string>());
407
if (Guid.TryParse(item.
GetValue
<string>(), out Guid val))
472
string tokenValue = token.
GetValue
<string>();
sdk-tasks (1)
UpdateRuntimeConfig.cs (1)
58
var 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}"/>.
145
yield return item is null ? (T)(object?)null! : item.
GetValue
<T>();
System\Text\Json\Nodes\JsonNode.Operators.cs (33)
255
public static explicit operator bool(JsonNode value) => value.
GetValue
<bool>();
262
public static explicit operator bool?(JsonNode? value) => value?.
GetValue
<bool>();
269
public static explicit operator byte(JsonNode value) => value.
GetValue
<byte>();
276
public static explicit operator byte?(JsonNode? value) => value?.
GetValue
<byte>();
283
public static explicit operator char(JsonNode value) => value.
GetValue
<char>();
290
public static explicit operator char?(JsonNode? value) => value?.
GetValue
<char>();
297
public static explicit operator DateTime(JsonNode value) => value.
GetValue
<DateTime>();
304
public static explicit operator DateTime?(JsonNode? value) => value?.
GetValue
<DateTime>();
311
public static explicit operator DateTimeOffset(JsonNode value) => value.
GetValue
<DateTimeOffset>();
318
public static explicit operator DateTimeOffset?(JsonNode? value) => value?.
GetValue
<DateTimeOffset>();
325
public static explicit operator decimal(JsonNode value) => value.
GetValue
<decimal>();
332
public static explicit operator decimal?(JsonNode? value) => value?.
GetValue
<decimal>();
339
public static explicit operator double(JsonNode value) => value.
GetValue
<double>();
346
public static explicit operator double?(JsonNode? value) => value?.
GetValue
<double>();
353
public static explicit operator Guid(JsonNode value) => value.
GetValue
<Guid>();
360
public static explicit operator Guid?(JsonNode? value) => value?.
GetValue
<Guid>();
367
public static explicit operator short(JsonNode value) => value.
GetValue
<short>();
374
public static explicit operator short?(JsonNode? value) => value?.
GetValue
<short>();
381
public static explicit operator int(JsonNode value) => value.
GetValue
<int>();
388
public static explicit operator int?(JsonNode? value) => value?.
GetValue
<int>();
395
public static explicit operator long(JsonNode value) => value.
GetValue
<long>();
402
public static explicit operator long?(JsonNode? value) => value?.
GetValue
<long>();
410
public static explicit operator sbyte(JsonNode value) => value.
GetValue
<sbyte>();
418
public static explicit operator sbyte?(JsonNode? value) => value?.
GetValue
<sbyte>();
425
public static explicit operator float(JsonNode value) => value.
GetValue
<float>();
432
public static explicit operator float?(JsonNode? value) => value?.
GetValue
<float>();
439
public static explicit operator string?(JsonNode? value) => value?.
GetValue
<string>();
447
public static explicit operator ushort(JsonNode value) => value.
GetValue
<ushort>();
455
public static explicit operator ushort?(JsonNode? value) => value?.
GetValue
<ushort>();
463
public static explicit operator uint(JsonNode value) => value.
GetValue
<uint>();
471
public static explicit operator uint?(JsonNode? value) => value?.
GetValue
<uint>();
479
public static explicit operator ulong(JsonNode value) => value.
GetValue
<ulong>();
487
public static explicit operator ulong?(JsonNode? value) => value?.
GetValue
<ulong>();
System\Text\Json\Nodes\JsonValue.cs (1)
32
/// <seealso cref="JsonNode.
GetValue
{T}"></seealso>