1276 references to GetProperty
aspire (10)
Aspire.Acquisition.Tests (6)
Aspire.Cli.EndToEnd.Tests (38)
Aspire.Cli.Tests (318)
Commands\AgentMcpCommandTests.cs (22)
193Assert.Equal("object", schema.GetProperty("type").GetString());
195Assert.False(schema.GetProperty("additionalProperties").GetBoolean());
197var properties = schema.GetProperty("properties");
202var resourceNames = properties.GetProperty("resourceNames");
203Assert.Equal("array", resourceNames.GetProperty("type").GetString());
204Assert.Equal(100, resourceNames.GetProperty("maxItems").GetInt32());
205Assert.Equal("string", resourceNames.GetProperty("items").GetProperty("type").GetString());
206Assert.Equal(256, resourceNames.GetProperty("items").GetProperty("maxLength").GetInt32());
208var targetState = properties.GetProperty("targetState");
209Assert.Equal("string", targetState.GetProperty("type").GetString());
210Assert.Equal("healthy", targetState.GetProperty("default").GetString());
213targetState.GetProperty("enum").EnumerateArray().Select(static value => value.GetString()));
215var timeoutSeconds = properties.GetProperty("timeoutSeconds");
216Assert.Equal("integer", timeoutSeconds.GetProperty("type").GetString());
217Assert.Equal(120, timeoutSeconds.GetProperty("default").GetInt32());
218Assert.Equal(1, timeoutSeconds.GetProperty("minimum").GetInt32());
219Assert.Equal(3600, timeoutSeconds.GetProperty("maximum").GetInt32());
892firstListJson.RootElement[0].GetProperty("state").GetString());
893Assert.Equal("success", waitJson.RootElement.GetProperty("outcome").GetString());
896secondListJson.RootElement[0].GetProperty("state").GetString());
Commands\DoctorCommandTests.cs (96)
51Assert.Equal(EnvironmentCheckCategories.Aspire, cliVersionCheck.GetProperty("category").GetString());
52Assert.Equal("warning", cliVersionCheck.GetProperty("status").GetString());
53Assert.Contains("13.0.0", cliVersionCheck.GetProperty("message").GetString()!);
54Assert.Contains("13.1.0", cliVersionCheck.GetProperty("message").GetString()!);
55var cliVersionMetadata = cliVersionCheck.GetProperty("metadata");
56Assert.Equal("13.0.0", cliVersionMetadata.GetProperty("currentVersion").GetString());
57Assert.Equal("13.1.0", cliVersionMetadata.GetProperty("latestVersion").GetString());
58Assert.Equal("aspire update", cliVersionMetadata.GetProperty("updateCommand").GetString());
72Assert.Equal(EnvironmentCheckCategories.Environment, osCheck.GetProperty("category").GetString());
73Assert.Equal("pass", osCheck.GetProperty("status").GetString());
74Assert.StartsWith("Operating system: ", osCheck.GetProperty("message").GetString(), StringComparison.Ordinal);
75var metadata = osCheck.GetProperty("metadata");
99var metadata = osCheck.GetProperty("metadata");
102Assert.Equal("Linux", metadata.GetProperty("osType").GetString());
103Assert.Equal(expectedDisplayName, metadata.GetProperty("displayName").GetString());
107Assert.Equal(version, metadata.GetProperty("version").GetString());
108Assert.Equal($"Operating system: {expectedDisplayName} {version}", osCheck.GetProperty("message").GetString());
113Assert.Equal(prettyName, metadata.GetProperty("description").GetString());
180Assert.Equal(EnvironmentCheckCategories.AppHost, appHostVersionCheck.GetProperty("category").GetString());
181Assert.Equal("pass", appHostVersionCheck.GetProperty("status").GetString());
182Assert.Contains("13.0.0", appHostVersionCheck.GetProperty("message").GetString()!);
183Assert.Contains("AppHost.csproj", appHostVersionCheck.GetProperty("message").GetString()!);
184var appHostVersionMetadata = appHostVersionCheck.GetProperty("metadata");
185Assert.Equal("13.0.0", appHostVersionMetadata.GetProperty("version").GetString());
186Assert.Equal("AppHost.csproj", appHostVersionMetadata.GetProperty("appHostPath").GetString());
229Assert.Equal(EnvironmentCheckCategories.AppHost, appHostVersionCheck.GetProperty("category").GetString());
230Assert.Equal("pass", appHostVersionCheck.GetProperty("status").GetString());
231Assert.Contains("13.1.0", appHostVersionCheck.GetProperty("message").GetString()!);
232Assert.Contains("apphost.ts", appHostVersionCheck.GetProperty("message").GetString()!);
233var appHostVersionMetadata = appHostVersionCheck.GetProperty("metadata");
234Assert.Equal("13.1.0", appHostVersionMetadata.GetProperty("version").GetString());
235Assert.Equal("apphost.ts", appHostVersionMetadata.GetProperty("appHostPath").GetString());
261Assert.DoesNotContain(doc.RootElement.GetProperty("checks").EnumerateArray(),
262check => check.GetProperty("name").GetString() == AspireVersionCheck.AppHostVersionCheckName);
289Assert.DoesNotContain(doc.RootElement.GetProperty("checks").EnumerateArray(),
290check => check.GetProperty("name").GetString() == AspireVersionCheck.AppHostVersionCheckName);
315Assert.DoesNotContain(doc.RootElement.GetProperty("checks").EnumerateArray(),
316check => check.GetProperty("name").GetString() == AspireVersionCheck.AppHostVersionCheckName);
342Assert.DoesNotContain(doc.RootElement.GetProperty("checks").EnumerateArray(),
343check => check.GetProperty("name").GetString() == AspireVersionCheck.AppHostVersionCheckName);
369Assert.Equal("pass", cliVersionCheck.GetProperty("status").GetString());
370Assert.Equal("warning", appHostVersionCheck.GetProperty("status").GetString());
371Assert.Equal("invalid aspire.config.json", appHostVersionCheck.GetProperty("details").GetString());
374appHostVersionCheck.GetProperty("metadata").GetProperty("appHostPath").GetString());
395Assert.Equal("pass", cliVersionCheck.GetProperty("status").GetString());
396Assert.Equal("warning", appHostVersionCheck.GetProperty("status").GetString());
397Assert.Equal("settings lookup failed", appHostVersionCheck.GetProperty("details").GetString());
427Assert.Equal(EnvironmentCheckCategories.AppHost, appHostVersionCheck.GetProperty("category").GetString());
428Assert.Equal("pass", appHostVersionCheck.GetProperty("status").GetString());
429Assert.Contains("13.2.0", appHostVersionCheck.GetProperty("message").GetString()!);
430Assert.Contains("AppHost.csproj", appHostVersionCheck.GetProperty("message").GetString()!);
431var appHostVersionMetadata = appHostVersionCheck.GetProperty("metadata");
432Assert.Equal("13.2.0", appHostVersionMetadata.GetProperty("version").GetString());
435appHostVersionMetadata.GetProperty("appHostPath").GetString());
460var metadata = cliVersionCheck.GetProperty("metadata");
461Assert.Equal("staging", metadata.GetProperty("identityChannel").GetString());
462Assert.Contains("channel: staging", cliVersionCheck.GetProperty("message").GetString()!);
486var metadata = cliVersionCheck.GetProperty("metadata");
488Assert.DoesNotContain("channel:", cliVersionCheck.GetProperty("message").GetString()!);
516var metadata = appHostVersionCheck.GetProperty("metadata");
517Assert.Equal("daily", metadata.GetProperty("pinnedChannel").GetString());
518Assert.Contains("channel: daily", appHostVersionCheck.GetProperty("message").GetString()!);
550var metadata = appHostVersionCheck.GetProperty("metadata");
551Assert.Equal("daily", metadata.GetProperty("pinnedChannel").GetString());
552Assert.Contains("channel: daily", appHostVersionCheck.GetProperty("message").GetString()!);
553Assert.Equal(Path.Combine("src", "NestedAppHost", "AppHost.csproj"), metadata.GetProperty("appHostPath").GetString());
575var metadata = appHostVersionCheck.GetProperty("metadata");
577Assert.DoesNotContain("channel:", appHostVersionCheck.GetProperty("message").GetString()!);
610var metadata = cliVersionCheck.GetProperty("metadata");
611Assert.Equal("local", metadata.GetProperty("identityChannel").GetString());
612Assert.Equal("prerelease", metadata.GetProperty("latestVersionChannel").GetString());
617var message = cliVersionCheck.GetProperty("message").GetString()!;
660var installations = doc.RootElement.GetProperty("installations").EnumerateArray().ToArray();
664Assert.Equal("/home/test/.aspire/bin/aspire", self.GetProperty("path").GetString());
665Assert.Equal("stable", self.GetProperty("channel").GetString());
666Assert.Equal("script", self.GetProperty("route").GetString());
667Assert.Equal(InstallationPathStatus.Active, self.GetProperty("pathStatus").GetString());
670Assert.Equal("/home/test/.aspire/dogfood/pr-1234/bin/aspire", peer.GetProperty("path").GetString());
671Assert.Equal("pr-1234", peer.GetProperty("channel").GetString());
672Assert.Equal("pr", peer.GetProperty("route").GetString());
673Assert.Equal(InstallationPathStatus.Shadowed, peer.GetProperty("pathStatus").GetString());
892Assert.Empty(doc.RootElement.GetProperty("checks").EnumerateArray());
893var installations = doc.RootElement.GetProperty("installations").EnumerateArray().ToArray();
895Assert.Equal("/usr/local/bin/aspire", row.GetProperty("path").GetString());
896Assert.Equal("13.0.0", row.GetProperty("version").GetString());
897Assert.Equal("stable", row.GetProperty("channel").GetString());
898Assert.Equal("script", row.GetProperty("route").GetString());
899Assert.Equal(InstallationPathStatus.Active, row.GetProperty("pathStatus").GetString());
900Assert.Equal(InstallationInfoStatus.Ok, row.GetProperty("status").GetString());
921Assert.NotEmpty(doc.RootElement.GetProperty("checks").EnumerateArray());
922var row = Assert.Single(doc.RootElement.GetProperty("installations").EnumerateArray());
923Assert.Equal(InstallationInfoStatus.Failed, row.GetProperty("status").GetString());
924Assert.Equal("Install discovery failed. See the Aspire CLI logs for details.", row.GetProperty("statusReason").GetString());
1032=> document.RootElement.GetProperty("checks").EnumerateArray()
1033.Single(check => check.GetProperty("name").GetString() == checkName);
Commands\LsCommandTests.cs (10)
323Assert.Equal(appHostPath1, firstCandidate.RootElement.GetProperty("path").GetString());
324Assert.Equal(KnownLanguageId.CSharp, firstCandidate.RootElement.GetProperty("language").GetString());
325Assert.Equal("buildable", firstCandidate.RootElement.GetProperty("status").GetString());
328Assert.Equal(appHostPath2, secondCandidate.RootElement.GetProperty("path").GetString());
329Assert.Equal(KnownLanguageId.TypeScript, secondCandidate.RootElement.GetProperty("language").GetString());
330Assert.Equal("possibly-unbuildable", secondCandidate.RootElement.GetProperty("status").GetString());
406Assert.Equal(appHostPathZ, first.RootElement.GetProperty("path").GetString());
407Assert.Equal(appHostPathA, second.RootElement.GetProperty("path").GetString());
408Assert.Equal(appHostPathM, third.RootElement.GetProperty("path").GetString());
449Assert.Equal(appHostPath, candidate.RootElement.GetProperty("path").GetString());
Mcp\ListResourcesToolTests.cs (53)
88Assert.Equal("[]", resource.GetProperty("waiting_for").GetRawText());
89Assert.Equal("[]", resource.GetProperty("urls").GetRawText());
90Assert.Equal("[]", resource.GetProperty("relationships").GetRawText());
91Assert.Equal("{}", resource.GetProperty("commands").GetRawText());
152.GetProperty("relationships")
158relationship => Assert.Equal("Reference", relationship.GetProperty("type").GetString()));
161relationships.Select(relationship => relationship.GetProperty("resource_name").GetString()));
211.GetProperty("relationships")
213.Select(relationship => relationship.GetProperty("resource_name").GetString()));
218.Select(resource => resource.GetProperty("name").GetString()));
261.GetProperty("waiting_for")
268.Select(resource => resource.GetProperty("name").GetString()));
338Assert.Equal(["api-service", "postgres", "redis"], resources.EnumerateArray().Select(r => r.GetProperty("name").GetString()));
418var pageNames = resources.RootElement.EnumerateArray().Select(resource => resource.GetProperty("name").GetString()).ToArray();
421Assert.Equal(offset, pagination.RootElement.GetProperty("offset").GetInt32());
422Assert.Equal(64, pagination.RootElement.GetProperty("limit").GetInt32());
423Assert.Equal(names.Length, pagination.RootElement.GetProperty("total").GetInt32());
462resources.RootElement.EnumerateArray().Select(resource => resource.GetProperty("name").GetString()));
463Assert.Equal(3, pagination.RootElement.GetProperty("total").GetInt32());
565await Verify(json.RootElement[0].GetProperty("commands").GetRawText(), "json");
600var metadata = json.RootElement[0].GetProperty("commands");
602var command = metadata.GetProperty("command-039");
603Assert.Equal(new string('x', 255) + "\U0001F680", command.GetProperty("description").GetString());
604var arguments = command.GetProperty("argument_inputs");
606arguments.EnumerateArray().Select(input => input.GetProperty("name").GetString()));
608Assert.Equal(new string('x', 255) + "\U0001F680", argument.GetProperty("description").GetString());
609var options = argument.GetProperty("options");
655Assert.Equal(expectedState, resource.GetProperty("state").GetString());
701Assert.Equal(70, pagination.RootElement.GetProperty("total").GetInt32());
702Assert.Equal(64, pagination.RootElement.GetProperty("next_offset").GetInt32());
706var value = Assert.IsType<string>(firstResource.GetProperty(propertyName).GetString());
710Assert.Equal("unknown", firstResource.GetProperty("state").GetString());
711Assert.Equal(32, firstResource.GetProperty("waiting_for").GetArrayLength());
712Assert.Equal(16, firstResource.GetProperty("urls").GetArrayLength());
713Assert.Equal(32, firstResource.GetProperty("relationships").GetArrayLength());
750Assert.Equal("Api.csproj", resources[0].GetProperty("source").GetString());
751Assert.Equal("worker.exe", resources[1].GetProperty("source").GetString());
800Assert.Equal(["container", "executable", "project"], json.RootElement.EnumerateArray().Select(resource => resource.GetProperty("name").GetString()));
828var source = Assert.IsType<string>(json.RootElement[0].GetProperty("source").GetString());
863var urls = json.RootElement[0].GetProperty("urls");
874.Select(url => url.GetProperty("url").GetString()));
1022Assert.Equal(["Redis"], resource.GetProperty("waiting_for").EnumerateArray().Select(value => value.GetString()));
1023Assert.Equal("Api.csproj", resource.GetProperty("source").GetString());
1026resource.GetProperty("urls")[0].GetProperty("url").GetString());
1029resource.GetProperty("urls")[0].EnumerateObject().Select(p => p.Name));
1032resource.GetProperty("relationships")[0].EnumerateObject().Select(p => p.Name));
1033Assert.Equal("redis-instance", resource.GetProperty("relationships")[0].GetProperty("resource_name").GetString());
1036resource.GetProperty("dashboard_url").GetString());
1039Assert.Equal("redis:8", resources[3].GetProperty("source").GetString());
1040Assert.Equal("worker", resources[4].GetProperty("source").GetString());
1041await Verify(resource.GetProperty("commands").GetRawText(), "json");
Mcp\WaitForResourcesToolTests.cs (32)
138Assert.Equal("success", json.RootElement.GetProperty("outcome").GetString());
139Assert.Equal("healthy", json.RootElement.GetProperty("target_state").GetString());
141var resource = Assert.Single(json.RootElement.GetProperty("resources").EnumerateArray());
145Assert.Equal("api", resource.GetProperty("name").GetString());
146Assert.Equal("Running", resource.GetProperty("state").GetString());
147Assert.Equal("Healthy", resource.GetProperty("health").GetString());
148Assert.Equal("success", resource.GetProperty("outcome").GetString());
209Assert.Equal("success", json.RootElement.GetProperty("outcome").GetString());
294Assert.Equal("failure", json.RootElement.GetProperty("outcome").GetString());
295Assert.Equal("healthy", json.RootElement.GetProperty("target_state").GetString());
298json.RootElement.GetProperty("error").GetString());
299Assert.Empty(json.RootElement.GetProperty("resources").EnumerateArray());
349Assert.Equal("up", json.RootElement.GetProperty("target_state").GetString());
352json.RootElement.GetProperty("resources")
354.Select(static resource => resource.GetProperty("name").GetString()));
415Assert.Equal("failure", json.RootElement.GetProperty("outcome").GetString());
416var resources = json.RootElement.GetProperty("resources").EnumerateArray().ToArray();
500Assert.Equal("failure", json.RootElement.GetProperty("outcome").GetString());
502json.RootElement.GetProperty("resources").EnumerateArray(),
555Assert.Equal("timeout", json.RootElement.GetProperty("outcome").GetString());
558json.RootElement.GetProperty("resources")
560.Select(static resource => resource.GetProperty("outcome").GetString()));
597json.RootElement.GetProperty("resources")
599.Select(static resource => resource.GetProperty("name").GetString()));
648Assert.Equal("success", json.RootElement.GetProperty("outcome").GetString());
714Assert.Equal("failure", json.RootElement.GetProperty("outcome").GetString());
716json.RootElement.GetProperty("resources").EnumerateArray(),
841Assert.Equal(name, resource.GetProperty("name").GetString());
844Assert.Equal("failure", resource.GetProperty("outcome").GetString());
845Assert.Equal(error, resource.GetProperty("error").GetString());
855Assert.Equal(name, resource.GetProperty("name").GetString());
857Assert.Equal(outcome, resource.GetProperty("outcome").GetString());
Aspire.Dashboard.Components.Tests (5)
Aspire.Dashboard.Tests (196)
Terminal\TerminalWebSocketTests.cs (157)
33Assert.Equal(101, initial.GetProperty("history").GetProperty("totalRows").GetInt32());
60frame.GetProperty("history").TryGetProperty("markers", out var marks) &&
61marks.EnumerateArray().Any(mark => mark.GetProperty("phase").GetString() == "executing"), timeout.Token);
62var mark = Assert.Single(initial.GetProperty("history").GetProperty("markers").EnumerateArray(),
63mark => mark.GetProperty("phase").GetString() == "executing");
64var id = mark.GetProperty("id").GetString();
66Assert.Equal("command", mark.GetProperty("source").GetString());
67Assert.Equal(0, mark.GetProperty("row").GetInt32());
73frame.GetProperty("history").GetProperty("markerResult") is { ValueKind: JsonValueKind.Object } result &&
74result.GetProperty("requestId").GetInt32() == 1, timeout.Token);
75var detailsResult = detailsFrame.GetProperty("history").GetProperty("markerResult");
76Assert.True(detailsResult.GetProperty("success").GetBoolean());
77Assert.Equal("executing", detailsResult.GetProperty("details").GetProperty("phase").GetString());
78Assert.Equal("cmdline_url=echo%20retained", detailsResult.GetProperty("details").GetProperty("rawParameters").GetString());
82frame.GetProperty("history").GetProperty("markerResult") is { ValueKind: JsonValueKind.Object } result &&
83result.GetProperty("requestId").GetInt32() == 2, timeout.Token);
84Assert.True(jumped.GetProperty("history").GetProperty("markerResult").GetProperty("success").GetBoolean());
85Assert.Equal(0, jumped.GetProperty("history").GetProperty("top").GetInt32());
101await ReadUntilAsync(browser, frame => frame.GetProperty("peer").GetProperty("isPrimary").GetBoolean(), timeout.Token);
106await ReadUntilAsync(browser, frame => frame.GetProperty("history").GetProperty("totalRows").GetInt32() >= 36, timeout.Token);
114var resized = await ReadUntilAsync(browser, frame => frame.GetProperty("columns").GetInt32() == width &&
115frame.GetProperty("history").GetProperty("totalRows").GetInt32() == expectedRows, timeout.Token);
116Assert.Equal(expectedRows, resized.GetProperty("history").GetProperty("totalRows").GetInt32());
125await ReadUntilAsync(browser, frame => frame.GetProperty("columns").GetInt32() == 20, timeout.Token);
142var initial = await ReadUntilAsync(first, frame => frame.GetProperty("peer").GetProperty("id").ValueKind == JsonValueKind.String, timeout.Token);
143Assert.Equal(100, initial.GetProperty("columns").GetInt32());
144Assert.Equal(30, initial.GetProperty("rows").GetInt32());
149var primary = await ReadUntilAsync(first, frame => frame.GetProperty("peer").GetProperty("isPrimary").GetBoolean(), timeout.Token);
150Assert.Equal(80, primary.GetProperty("columns").GetInt32());
151Assert.Equal(24, primary.GetProperty("rows").GetInt32());
152Assert.Equal(primary.GetProperty("peer").GetProperty("id").GetString(), host.Presentation.PrimaryPeerId);
155var viewer = await ReadUntilAsync(second, frame => frame.GetProperty("peer").GetProperty("id").ValueKind == JsonValueKind.String, timeout.Token);
156Assert.False(viewer.GetProperty("peer").GetProperty("isPrimary").GetBoolean());
157Assert.Equal(80, viewer.GetProperty("columns").GetInt32());
160await ReadUntilAsync(second, frame => frame.GetProperty("peer").GetProperty("primaryId").ValueKind == JsonValueKind.Null, timeout.Token);
162var takeover = await ReadUntilAsync(second, frame => frame.GetProperty("peer").GetProperty("isPrimary").GetBoolean(), timeout.Token);
163Assert.Equal(132, takeover.GetProperty("columns").GetInt32());
242var graphics = await ReadUntilAsync(browser, frame => frame.GetProperty("placements").GetArrayLength() > 0, timeout.Token);
243Assert.Single(graphics.GetProperty("placements").EnumerateArray());
244Assert.Single(graphics.GetProperty("images").EnumerateArray());
248var restored = await ReadUntilAsync(reconnected, frame => frame.GetProperty("placements").GetArrayLength() > 0, timeout.Token);
249Assert.Single(restored.GetProperty("placements").EnumerateArray());
250Assert.Single(restored.GetProperty("images").EnumerateArray());
286Assert.Equal(initial.GetProperty("placements")[0].GetProperty("x").GetDouble(),
287late.GetProperty("placements")[0].GetProperty("x").GetDouble());
291var originalX = initial.GetProperty("placements")[0].GetProperty("x").GetDouble();
295Assert.Equal(updates[0].GetProperty("placements")[0].GetProperty("x").GetDouble(),
296updates[1].GetProperty("placements")[0].GetProperty("x").GetDouble());
305static bool HasPlacement(JsonElement frame) => frame.GetProperty("placements").GetArrayLength() == 1;
308HasPlacement(frame) && frame.GetProperty("placements")[0].GetProperty("x").GetDouble() > originalX;
312var image = Assert.Single(frame.GetProperty("images").EnumerateArray());
313Assert.Equal(1, image.GetProperty("width").GetInt32());
314Assert.Equal(1, image.GetProperty("height").GetInt32());
315Assert.Equal(4, image.GetProperty("byteLength").GetInt32());
316Assert.Equal(image.GetProperty("key").GetString(), frame.GetProperty("placements")[0].GetProperty("key").GetString());
331var initial = await ReadUntilAsync(first, frame => frame.GetProperty("placements").GetArrayLength() == 1, timeout.Token);
332var originalX = initial.GetProperty("placements")[0].GetProperty("x").GetDouble();
343var original = await ReadUntilAsync(first, frame => frame.GetProperty("placements").GetArrayLength() == 1 &&
344frame.GetProperty("placements")[0].GetProperty("x").GetDouble() > originalX, timeout.Token);
345var restored = await ReadUntilAsync(late, frame => frame.GetProperty("placements").GetArrayLength() == 1, timeout.Token);
346var image = Assert.Single(restored.GetProperty("images").EnumerateArray());
347Assert.Equal(4, image.GetProperty("byteLength").GetInt32());
348Assert.Equal(original.GetProperty("placements")[0].GetProperty("x").GetDouble(),
349restored.GetProperty("placements")[0].GetProperty("x").GetDouble());
368var initial = await ReadUntilAsync(first, frame => frame.GetProperty("placements").GetArrayLength() == 1, timeout.Token);
369var originalX = initial.GetProperty("placements")[0].GetProperty("x").GetDouble();
384Assert.Equal(updates[0].GetProperty("placements")[0].GetProperty("x").GetDouble(),
385updates[1].GetProperty("placements")[0].GetProperty("x").GetDouble());
390frame.GetProperty("placements").GetArrayLength() == 1 &&
391frame.GetProperty("placements")[0].GetProperty("x").GetDouble() > originalX;
407var initial = await ReadUntilAsync(browser, frame => frame.GetProperty("hyperlinks").GetArrayLength() > 0, timeout.Token);
411var changed = await ReadUntilAsync(browser, frame => frame.GetProperty("hyperlinks").EnumerateArray()
412.Any(link => link.GetProperty("uri").GetString() == "https://example.com/second"), timeout.Token);
417var restored = await ReadUntilAsync(reconnected, frame => frame.GetProperty("hyperlinks").GetArrayLength() > 0, timeout.Token);
423var link = Assert.Single(frame.GetProperty("hyperlinks").EnumerateArray());
424Assert.Equal(uri, link.GetProperty("uri").GetString());
425Assert.Equal(0, link.GetProperty("row").GetInt32());
426Assert.Equal(0, link.GetProperty("startColumn").GetInt32());
427Assert.Equal(4, link.GetProperty("endColumn").GetInt32());
465await ReadUntilAsync(second, frame => frame.GetProperty("peer").GetProperty("id").ValueKind == JsonValueKind.String, timeout.Token);
508var readOnly = await ReadUntilAsync(browser, frame => frame.GetProperty("full").GetBoolean(), timeout.Token);
509Assert.Equal(100, readOnly.GetProperty("columns").GetInt32());
510Assert.Equal(30, readOnly.GetProperty("rows").GetInt32());
511Assert.False(readOnly.GetProperty("peer").GetProperty("isPrimary").GetBoolean());
515var primary = await ReadUntilAsync(browser, frame => frame.GetProperty("peer").GetProperty("isPrimary").GetBoolean(), timeout.Token);
516Assert.Equal(80, primary.GetProperty("columns").GetInt32());
517Assert.Equal(24, primary.GetProperty("rows").GetInt32());
550var primary = await ReadUntilAsync(interactive, frame => frame.GetProperty("peer").GetProperty("isPrimary").GetBoolean(), timeout.Token);
551var peerId = primary.GetProperty("peer").GetProperty("id").GetString();
552await ReadUntilAsync(readOnly, frame => frame.GetProperty("peer").GetProperty("primaryId").GetString() == peerId, timeout.Token);
556var unchanged = await ReadUntilAsync(readOnly, frame => frame.GetProperty("full").GetBoolean(), timeout.Token);
557Assert.Equal(80, unchanged.GetProperty("columns").GetInt32());
558Assert.Equal(24, unchanged.GetProperty("rows").GetInt32());
559Assert.False(unchanged.GetProperty("peer").GetProperty("isPrimary").GetBoolean());
757frame => frame.GetProperty("history").GetProperty("requestId").GetInt32() == requestId, cancellationToken);
758Assert.Equal(0, frame.GetProperty("history").GetProperty("top").GetInt32());
759var history = frame.GetProperty("history");
768generation = history.GetProperty("generation").GetString(),
769rowId = history.GetProperty("rowIds")[0].GetString()
772frame => frame.GetProperty("history").GetProperty("selection").GetProperty("status").GetString() == "valid",
774var text = selection.GetProperty("history").GetProperty("selection").GetProperty("text").GetString();
777frame => frame.GetProperty("history").GetProperty("selection").GetProperty("status").GetString() != "valid",
781frame => frame.GetProperty("history").GetProperty("requestId").GetInt32() == requestId + 3, cancellationToken);
826await SendAsync(socket, $$"""{"type":"ack","revision":{{frame.GetProperty("revision").GetUInt32()}}}""", cancellationToken);
Aspire.Deployment.EndToEnd.Tests (72)
AcaExpressDeploymentTests.cs (41)
257var environment = Assert.Single(environmentDocument.RootElement.GetProperty("value").EnumerateArray());
258Assert.Equal("Express", environment.GetProperty("properties").GetProperty("environmentMode").GetString());
259var environmentId = environment.GetProperty("id").GetString();
263var apps = appsDocument.RootElement.GetProperty("value").EnumerateArray().ToArray();
268var properties = app.GetProperty("properties");
269Assert.Equal(environmentId, properties.GetProperty("environmentId").GetString(), ignoreCase: true);
270var configuration = properties.GetProperty("configuration");
271var ingress = configuration.GetProperty("ingress");
272Assert.True(ingress.GetProperty("external").GetBoolean());
273Assert.False(ingress.GetProperty("allowInsecure").GetBoolean());
274Assert.Equal(8080, ingress.GetProperty("targetPort").GetInt32());
275var hostname = ingress.GetProperty("fqdn").GetString();
277var template = properties.GetProperty("template");
278Assert.Equal(0, template.GetProperty("scale").GetProperty("minReplicas").GetInt32());
279var container = Assert.Single(template.GetProperty("containers").EnumerateArray());
280var name = container.GetProperty("name").GetString()!;
284var registry = Assert.Single(configuration.GetProperty("registries").EnumerateArray());
285var server = registry.GetProperty("server").GetString()!;
287Assert.StartsWith($"{server}/", container.GetProperty("image").GetString(), StringComparison.OrdinalIgnoreCase);
288var identity = registry.GetProperty("identity").GetString()!;
291Assert.Contains(app.GetProperty("identity").GetProperty("userAssignedIdentities").EnumerateObject(),
296var secretEnvironment = Assert.Single(container.GetProperty("env").EnumerateArray(),
297entry => entry.GetProperty("name").GetString() == "MANUAL_SECRET");
300var secretName = secretEnvironment.GetProperty("secretRef").GetString();
302var secret = Assert.Single(configuration.GetProperty("secrets").EnumerateArray(),
303entry => entry.GetProperty("name").GetString() == secretName);
309app.GetProperty("properties").GetProperty("template").GetProperty("containers")[0].GetProperty("name").GetString() == "frontend");
310var reference = Assert.Single(frontend.GetProperty("properties").GetProperty("template").GetProperty("containers")[0].GetProperty("env").EnumerateArray(),
311entry => entry.GetProperty("name").GetString() == "services__api__http__0");
312Assert.Equal(urls["api"].GetLeftPart(UriPartial.Authority), reference.GetProperty("value").GetString());
358if (result.GetProperty("message").GetString() == ApiMessage)
360Assert.Equal(urls["api"].GetLeftPart(UriPartial.Authority), result.GetProperty("backend").GetString());
Aspire.Hosting (4)
Aspire.Hosting.Azure.Tests (58)
AzureSandboxesTests.cs (58)
504Assert.Equal("site-1234", root.GetProperty("name").GetString());
505Assert.Equal("site-container", root.GetProperty("labels").GetProperty("aspire-resource").GetString());
506var source = root.GetProperty("source");
507Assert.Equal("registry", source.GetProperty("kind").GetString());
508Assert.Equal("example.azurecr.io/site:tag", source.GetProperty("imageUrl").GetString());
509Assert.Equal("11111111-1111-1111-1111-111111111111", source.GetProperty("managedIdentityClientId").GetString());
553var source = document.RootElement.GetProperty("source");
554Assert.Equal("docker.io/library/nginx@sha256:abc123", source.GetProperty("imageUrl").GetString());
1729Assert.Equal("disk-1", root.GetProperty("sourcesRef").GetProperty("diskImage").GetProperty("id").GetString());
1730Assert.False(root.GetProperty("sourcesRef").GetProperty("diskImage").GetProperty("isPublic").GetBoolean());
1731Assert.Equal("2000m", root.GetProperty("resources").GetProperty("cpu").GetString());
1732Assert.Equal("4096Mi", root.GetProperty("resources").GetProperty("memory").GetString());
1733Assert.Equal("32768Mi", root.GetProperty("resources").GetProperty("disk").GetString());
1734Assert.Equal("dotnet", root.GetProperty("entrypoint")[0].GetString());
1735Assert.Equal("/app/app.dll", root.GetProperty("entrypoint")[1].GetString());
1736Assert.Equal("--urls", root.GetProperty("cmd")[0].GetString());
1737Assert.Equal("/app", root.GetProperty("workingDirectory").GetString());
1738Assert.Equal("http://+:5000", root.GetProperty("environment").GetProperty("ASPNETCORE_URLS").GetString());
1799Assert.False(root.GetProperty("autoSuspendPolicy").GetProperty("enabled").GetBoolean());
1800Assert.Equal(300, root.GetProperty("autoSuspendPolicy").GetProperty("interval").GetInt32());
1801Assert.Equal("Disk", root.GetProperty("autoSuspendPolicy").GetProperty("mode").GetString());
1802Assert.True(root.GetProperty("autoDeletePolicy").GetProperty("enabled").GetBoolean());
1803Assert.Equal(3600, root.GetProperty("autoDeletePolicy").GetProperty("deleteIntervalInSeconds").GetInt64());
1804Assert.Equal("AfterSuspend", root.GetProperty("autoDeletePolicy").GetProperty("trigger").GetString());
1852Assert.Equal(80, root.GetProperty("port").GetInt32());
1853Assert.True(root.GetProperty("auth").GetProperty("anonymous").GetBoolean());
1854Assert.Equal("Http", root.GetProperty("protocol").GetString());
1892Assert.Equal("webhook", root.GetProperty("name").GetString());
1893Assert.Equal(8080, root.GetProperty("port").GetInt32());
1894Assert.Equal("OnDemand", root.GetProperty("activationMode").GetString());
1895Assert.Equal("Http", root.GetProperty("protocol").GetString());
1897var auth = root.GetProperty("auth");
1899Assert.False(auth.GetProperty("anonymous").GetBoolean());
1900var entraId = auth.GetProperty("entraId");
1901Assert.True(entraId.GetProperty("enabled").GetBoolean());
1904entraId.GetProperty("objectIds").EnumerateArray().Select(static item => item.GetString()!).ToArray());
1907entraId.GetProperty("tenantIds").EnumerateArray().Select(static item => item.GetString()!).ToArray());
1954var auth = document.RootElement.GetProperty("auth");
1956var entraId = auth.GetProperty("entraId");
1957Assert.True(entraId.GetProperty("enabled").GetBoolean());
1958Assert.Empty(entraId.GetProperty("objectIds").EnumerateArray());
1959Assert.Empty(entraId.GetProperty("tenantIds").EnumerateArray());
Aspire.Hosting.Blazor.Tests (4)
Aspire.Hosting.Browsers.Tests (24)
BrowserLogsBuilderExtensionsTests.cs (20)
804Assert.Equal("web-browser-logs", document.RootElement.GetProperty("resourceName").GetString());
805Assert.Equal("session-0002", document.RootElement.GetProperty("sessionId").GetString());
806Assert.Equal("msedge", document.RootElement.GetProperty("browser").GetString());
807Assert.Equal(@"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe", document.RootElement.GetProperty("browserExecutable").GetString());
808Assert.Equal("Adopted", document.RootElement.GetProperty("browserHostOwnership").GetString());
809Assert.Equal(4242, document.RootElement.GetProperty("processId").GetInt32());
810Assert.Equal("target-0002", document.RootElement.GetProperty("targetId").GetString());
811Assert.Equal("https://localhost:8443/", document.RootElement.GetProperty("targetUrl").GetString());
812Assert.EndsWith("screenshot.png", document.RootElement.GetProperty("path").GetString(), StringComparison.Ordinal);
813Assert.Equal("image/png", document.RootElement.GetProperty("mimeType").GetString());
814Assert.Equal(1234, document.RootElement.GetProperty("sizeBytes").GetInt32());
893var path = document.RootElement.GetProperty("path").GetString();
898Assert.Equal("session-0001", document.RootElement.GetProperty("sessionId").GetString());
899Assert.Equal("chrome", document.RootElement.GetProperty("browser").GetString());
900Assert.Equal("/fake/browser-1", document.RootElement.GetProperty("browserExecutable").GetString());
901Assert.Equal("Owned", document.RootElement.GetProperty("browserHostOwnership").GetString());
902Assert.Equal(1001, document.RootElement.GetProperty("processId").GetInt32());
903Assert.Equal("target-1", document.RootElement.GetProperty("targetId").GetString());
904Assert.Equal("http://localhost:8080/", document.RootElement.GetProperty("targetUrl").GetString());
905Assert.Equal(session.ScreenshotBytes.Length, document.RootElement.GetProperty("sizeBytes").GetInt32());
Aspire.Hosting.CodeGeneration.TypeScript.Tests (23)
Aspire.Hosting.Dotnet (4)
Aspire.Hosting.Dotnet.Tests (2)
Aspire.Hosting.Foundry (3)
Aspire.Hosting.Java.Tests (3)
Aspire.Hosting.JavaScript.Tests (1)
Aspire.Hosting.Kubernetes (9)
Aspire.Hosting.Maui (1)
Aspire.Hosting.PostgreSQL.Tests (33)
AddPostgresTests.cs (33)
532var servers = document.RootElement.GetProperty("Servers");
535Assert.Equal(pg1.Resource.Name, servers.GetProperty("1").GetProperty("Name").GetString());
536Assert.Equal("Servers", servers.GetProperty("1").GetProperty("Group").GetString());
537Assert.Equal("mypostgres1", servers.GetProperty("1").GetProperty("Host").GetString());
538Assert.Equal(5432, servers.GetProperty("1").GetProperty("Port").GetInt32());
539Assert.Equal("postgres", servers.GetProperty("1").GetProperty("Username").GetString());
540Assert.Equal("prefer", servers.GetProperty("1").GetProperty("SSLMode").GetString());
541Assert.Equal("postgres", servers.GetProperty("1").GetProperty("MaintenanceDB").GetString());
543Assert.Equal($"echo '{pg1.Resource.PasswordParameter.Value}'", servers.GetProperty("1").GetProperty("PasswordExecCommand").GetString());
547Assert.Equal(pg2.Resource.Name, servers.GetProperty("2").GetProperty("Name").GetString());
548Assert.Equal("Servers", servers.GetProperty("2").GetProperty("Group").GetString());
549Assert.Equal("mypostgres2", servers.GetProperty("2").GetProperty("Host").GetString());
550Assert.Equal(5432, servers.GetProperty("2").GetProperty("Port").GetInt32());
551Assert.Equal("myuser", servers.GetProperty("2").GetProperty("Username").GetString());
552Assert.Equal("prefer", servers.GetProperty("2").GetProperty("SSLMode").GetString());
553Assert.Equal("postgres", servers.GetProperty("2").GetProperty("MaintenanceDB").GetString());
555Assert.Equal($"echo '{pg2.Resource.PasswordParameter.Value}'", servers.GetProperty("2").GetProperty("PasswordExecCommand").GetString());
Aspire.Hosting.Radius.Tests (5)
Aspire.Hosting.RemoteHost.Tests (25)
CodeGeneration\ApiReferenceExportTests.cs (25)
34Assert.Equal(1, export.GetProperty("schemaVersion").GetInt32());
35Assert.Equal("typescript", export.GetProperty("language").GetString());
36Assert.Equal("Aspire.Hosting", export.GetProperty("package").GetProperty("name").GetString());
37Assert.Equal("13.5.0", export.GetProperty("package").GetProperty("version").GetString());
39var modules = export.GetProperty("modules").EnumerateArray().ToList();
42var items = modules.SelectMany(module => module.GetProperty("items").EnumerateArray()).ToList();
49item.GetProperty("declaration").GetString()!,
52Assert.NotEmpty(export.GetProperty("declarations").EnumerateArray());
64var declarationOwners = export.GetProperty("declarations").EnumerateArray()
65.Select(declaration => declaration.GetProperty("owningAssembly").GetString())
68var items = export.GetProperty("modules").EnumerateArray()
69.SelectMany(module => module.GetProperty("items").EnumerateArray())
76.Where(item => item.GetProperty("kind").GetString() != "augmentation")
77.Select(item => item.GetProperty("owningAssembly").GetString())
83items.Where(item => item.GetProperty("kind").GetString() == "augmentation"),
86Assert.StartsWith("augmentation:", item.GetProperty("id").GetString(), StringComparison.Ordinal);
87Assert.NotEqual("Aspire.Hosting", item.GetProperty("owningAssembly").GetString());
145Assert.Equal("Contoso.Aspire.MetaPackage", export.GetProperty("package").GetProperty("name").GetString());
147var ownedItemOwners = export.GetProperty("modules").EnumerateArray()
148.SelectMany(module => module.GetProperty("items").EnumerateArray())
149.Where(item => item.GetProperty("kind").GetString() != "augmentation")
150.Select(item => item.GetProperty("owningAssembly").GetString())
Aspire.Hosting.Sdk.Tests (1)
Aspire.Hosting.Seq.Tests (4)
Aspire.Hosting.Tests (77)
WithTerminalTests.cs (14)
481Assert.Equal(TerminalHostMetadata.CurrentSchemaVersion, root.GetProperty("schemaVersion").GetInt32());
482Assert.Equal(host.Layout.ReplicaId, root.GetProperty("replicaId").GetString());
483Assert.Equal("myapp", root.GetProperty("resourceName").GetString());
484Assert.Equal(0, root.GetProperty("replicaIndex").GetInt32());
485Assert.Equal(Environment.ProcessId, root.GetProperty("appHostPid").GetInt32());
488root.GetProperty("appHostProcessIdentity").GetInt64());
491root.GetProperty("appHostProcessScopeId").GetString());
494root.GetProperty("appHostBootId").GetString());
495Assert.Equal(137, root.GetProperty("columns").GetInt32());
496Assert.Equal(41, root.GetProperty("rows").GetInt32());
497Assert.Equal(host.Layout.ControlUdsPath, root.GetProperty("controlSocketPath").GetString());
498Assert.Equal(host.Layout.ConsumerUdsPath, root.GetProperty("consumerSocketPath").GetString());
499Assert.False(string.IsNullOrEmpty(root.GetProperty("appHostPath").GetString()));
500Assert.NotEqual(default, root.GetProperty("createdAtUtc").GetDateTime());
Aspire.Templates.Tests (1)
Aspire.TerminalHost.Tests (4)
Aspire.TestTools (17)
Aspire.Tray.Tests (2)
dotnet-aot (7)
dotnet-openapi (1)
GenerateTemplateManifest (10)
Infrastructure.Tests (218)
WorkflowScripts\AnalyzeCiFailureWorkflowTests.cs (127)
225Assert.Equal(expectedNumber, selected.RootElement.GetProperty("number").GetInt32());
298Assert.Equal(42, triggeringMerge.RootElement.GetProperty("number").GetInt32());
967var failedTest = analysis.RootElement.GetProperty("failed_tests")[0];
968Assert.Equal("Trusted\nerror", failedTest.GetProperty("error").GetString());
969Assert.Equal("trusted\nframe", failedTest.GetProperty("stack_trace").GetString());
972failedTest.GetProperty("standard_output").GetString());
975failedTest.GetProperty("standard_error").GetString());
1036analysis.RootElement.GetProperty("failed_tests").EnumerateArray(),
1039Assert.Equal("Linux tests", failedTest.GetProperty("job").GetString());
1040Assert.Equal("linux failure", failedTest.GetProperty("error").GetString());
1044Assert.Equal("Windows tests", failedTest.GetProperty("job").GetString());
1045Assert.Equal("windows failure", failedTest.GetProperty("error").GetString());
1501var failedJob = sanitized.RootElement.GetProperty("failed_jobs")[0];
1502Assert.Equal(500, failedJob.GetProperty("reason").GetString()!.Length);
1503Assert.StartsWith("Job [link](https://evil.example)", failedJob.GetProperty("reason").GetString(), StringComparison.Ordinal);
1504var failedTest = sanitized.RootElement.GetProperty("failed_tests")[0];
1505Assert.Equal(500, failedTest.GetProperty("name").GetString()!.Length);
1506Assert.StartsWith("Tests.Flaky ", failedTest.GetProperty("name").GetString(), StringComparison.Ordinal);
1507Assert.Equal(1000, failedTest.GetProperty("error").GetString()!.Length);
1508Assert.StartsWith("Failure\n# heading\n```", failedTest.GetProperty("error").GetString(), StringComparison.Ordinal);
1509Assert.Equal(2000, failedTest.GetProperty("stack_trace").GetString()!.Length);
1510Assert.StartsWith("frame\n@reviewers", failedTest.GetProperty("stack_trace").GetString(), StringComparison.Ordinal);
1511Assert.Equal(500, failedTest.GetProperty("reason").GetString()!.Length);
1512Assert.StartsWith("Deterministic [details](https://evil.example)", failedTest.GetProperty("reason").GetString(), StringComparison.Ordinal);
1716Assert.Equal(expected, sanitizedCause.RootElement.GetProperty(field).GetString());
1775Assert.Equal("Injected title", cause.RootElement.GetProperty("title").GetString());
1776Assert.Equal("Injected pattern", cause.RootElement.GetProperty("error_pattern").GetString());
2363metadata.RootElement.GetProperty("title").GetString());
2364Assert.Equal("ci-failure-cause,main-ci-break", metadata.RootElement.GetProperty("labels").GetString());
2447metadata.RootElement.GetProperty("title").GetString());
3481Assert.Equal(10, selected.RootElement[0].GetProperty("id").GetInt32());
3482Assert.Equal("trx", selected.RootElement[0].GetProperty("format").GetString());
3483Assert.Equal("mocha", selected.RootElement[1].GetProperty("format").GetString());
5134Assert.Equal(20, output.RootElement.GetProperty("id").GetInt64());
5135Assert.Equal("latest", output.RootElement.GetProperty("head_sha").GetString());
5174Assert.Equal(24, output.RootElement.GetProperty("id").GetInt64());
5175Assert.Equal("earlier", output.RootElement.GetProperty("head_sha").GetString());
5204Assert.Equal(101, output.RootElement.GetProperty("id").GetInt64());
5240Assert.Equal(301, output.RootElement.GetProperty("id").GetInt64());
5313Assert.Equal(77, output.RootElement.GetProperty("id").GetInt64());
5347Assert.Equal(55, output.RootElement.GetProperty("id").GetInt64());
5385Assert.Equal("unavailable", status.RootElement.GetProperty("state").GetString());
5406Assert.Equal("unavailable", status.RootElement.GetProperty("state").GetString());
5451Assert.Equal("incomplete", status.RootElement.GetProperty("state").GetString());
5499Assert.Equal("associated", candidate.GetProperty("sha").GetString());
5500Assert.Equal(41, candidate.GetProperty("pull_request").GetProperty("number").GetInt32());
5502Assert.Equal("incomplete", status.RootElement.GetProperty("state").GetString());
5559Assert.Equal(41, candidate.GetProperty("pull_request").GetProperty("number").GetInt32());
5561Assert.Equal("available", status.RootElement.GetProperty("state").GetString());
5601Assert.Equal("incomplete", status.RootElement.GetProperty("state").GetString());
5645Assert.Equal("incomplete", status.RootElement.GetProperty("state").GetString());
5684Assert.Equal("associated", candidate.GetProperty("sha").GetString());
5686Assert.Equal("incomplete", status.RootElement.GetProperty("state").GetString());
5726Assert.Equal(123, root.GetProperty("run_id").GetInt64());
5727Assert.Equal(2, root.GetProperty("run_attempt").GetInt32());
5728Assert.Equal("https://github.com/microsoft/aspire/actions/runs/123", root.GetProperty("run_url").GetString());
5729Assert.Equal("main", root.GetProperty("run_scope").GetString());
5730Assert.Equal("2026-08-31T12:00:00Z", root.GetProperty("analyzed_at").GetString());
5731Assert.Equal(JsonValueKind.Null, root.GetProperty("pr").ValueKind);
5733var triggeringMerge = root.GetProperty("triggering_merge_pr");
5735Assert.Equal(42, triggeringMerge.GetProperty("number").GetInt32());
5736Assert.Equal("PrimaryKey=[REDACTED]", triggeringMerge.GetProperty("title").GetString());
5737Assert.Equal("https://github.com/microsoft/aspire/pull/42", triggeringMerge.GetProperty("url").GetString());
5739var mainContext = root.GetProperty("main_context");
5741Assert.Equal("trusted-failed", mainContext.GetProperty("failed_sha").GetString());
5742Assert.Equal("trusted-success", mainContext.GetProperty("last_successful_main_sha").GetString());
5743Assert.Equal("available", mainContext.GetProperty("candidate_merge_history_state").GetString());
5744Assert.Equal("trusted-candidate", mainContext.GetProperty("candidate_merges")[0].GetProperty("sha").GetString());
5747mainContext.GetProperty("candidate_merges")[0].GetProperty("message").GetString());
5750mainContext.GetProperty("candidate_merges")[0].GetProperty("pull_request").GetProperty("title").GetString());
5752var failedJob = root.GetProperty("failed_jobs")[0];
5754Assert.Equal("Build", failedJob.GetProperty("name").GetString());
5755Assert.Equal("main-repository-breakage", failedJob.GetProperty("classification").GetString());
5756Assert.Equal("compiler failed", failedJob.GetProperty("reason").GetString());
5757Assert.Equal("ConnectionStrings__step=[REDACTED]", failedJob.GetProperty("failed_steps")[0].GetString());
5783Assert.Equal(JsonValueKind.Null, root.GetProperty("triggering_merge_pr").ValueKind);
5784var mainContext = root.GetProperty("main_context");
5785Assert.Equal(historyState, mainContext.GetProperty("candidate_merge_history_state").GetString());
5786Assert.Equal(JsonValueKind.Null, mainContext.GetProperty("candidate_merges").ValueKind);
5825Assert.Equal(123, root.GetProperty("run_id").GetInt64());
5826Assert.Equal(2, root.GetProperty("run_attempt").GetInt32());
5827Assert.Equal("https://github.com/microsoft/aspire/actions/runs/123", root.GetProperty("run_url").GetString());
5828Assert.Equal("2026-08-31T12:00:00Z", root.GetProperty("analyzed_at").GetString());
5830var pr = root.GetProperty("pr");
5832Assert.Equal(42, pr.GetProperty("number").GetInt32());
5835pr.GetProperty("title").GetString());
5836Assert.Equal("ConnectionStrings__branch=[REDACTED]", pr.GetProperty("head_branch").GetString());
5837Assert.Equal("https://github.com/microsoft/aspire/pull/42", pr.GetProperty("url").GetString());
5838Assert.Equal("known flaky test", root.GetProperty("failed_jobs")[0].GetProperty("reason").GetString());
5839Assert.Equal("Tests.Flaky", root.GetProperty("failed_tests")[0].GetProperty("name").GetString());
5840Assert.Equal(JsonValueKind.Null, root.GetProperty("triggering_merge_pr").ValueKind);
5841Assert.Equal(JsonValueKind.Null, root.GetProperty("main_context").ValueKind);
5876Assert.Equal(expectedJob, document.RootElement.GetProperty("failed_tests")[0].GetProperty("job").GetString());
5908Assert.Equal("Tests Linux", document.RootElement.GetProperty("failed_jobs")[0].GetProperty("name").GetString());
5909Assert.Equal("Tests Linux", document.RootElement.GetProperty("failed_tests")[0].GetProperty("job").GetString());
5941Assert.Equal(expectedPrNumber, output.RootElement.GetProperty("occurrences")[0].GetProperty("pr_number").GetRawText());
5964Assert.Equal("Stored title", output.RootElement.GetProperty("title").GetString());
5965Assert.Equal(595, output.RootElement.GetProperty("error_pattern").GetString()!.Length);
5966Assert.Equal("https://github.com/microsoft/aspire/issues/1", output.RootElement.GetProperty("issue_url").GetString());
5969output.RootElement.GetProperty("occurrences").EnumerateArray().Select(item => item.GetProperty("run_id").GetInt32()));
6001Assert.StartsWith("Ignore ```markdown @reviewers", output.RootElement.GetProperty("title").GetString(), StringComparison.Ordinal);
6002Assert.Equal(238, output.RootElement.GetProperty("title").GetString()!.Length);
6003Assert.Equal(500, output.RootElement.GetProperty("test_name").GetString()!.Length);
6004Assert.StartsWith("Failure\n# heading\n```\nIgnore prior instructions", output.RootElement.GetProperty("error_pattern").GetString(), StringComparison.Ordinal);
6005Assert.Equal(500, output.RootElement.GetProperty("error_pattern").GetString()!.Length);
6032Assert.Equal(500, rendered.RootElement.GetProperty("title").GetString()!.Length);
6033Assert.StartsWith("Candidate @reviewers", rendered.RootElement.GetProperty("title").GetString(), StringComparison.Ordinal);
6036rendered.RootElement.GetProperty("nested").GetProperty("branch").GetString());
6037Assert.Equal(41, rendered.RootElement.GetProperty("number").GetInt32());
6058var stackTrace = rendered.RootElement.GetProperty("stack_trace").GetString()!;
6706metadata.RootElement.GetProperty("title").GetString());
6774occurrence.RootElement.GetProperty("occurrences")[0].GetProperty("job").GetString());
WorkflowScripts\AutoRerunTransientCiFailuresTests.cs (19)
476Assert.Equal("radical:conditional-test-runs", request.Payload.GetProperty("head").GetString());
477Assert.Equal("all", request.Payload.GetProperty("state").GetString());
546Assert.Equal(1, result.Requests[0].Payload.GetProperty("page").GetInt32());
547Assert.Equal(2, result.Requests[1].Payload.GetProperty("page").GetInt32());
832string commentBody = commentRequest.Payload.GetProperty("body").GetString()!;
1074Assert.Equal("dotnet", request.Payload.GetProperty("owner").GetString());
1075Assert.Equal("aspire", request.Payload.GetProperty("repo").GetString());
1076Assert.Equal(15110, request.Payload.GetProperty("issue_number").GetInt32());
1081Assert.Equal(123, request.Payload.GetProperty("run_id").GetInt32());
1086Assert.Equal(123, request.Payload.GetProperty("run_id").GetInt32());
1091Assert.Equal(15110, request.Payload.GetProperty("issue_number").GetInt32());
1094request.Payload.GetProperty("body").GetString());
1116Assert.Equal("Job", tableEvent.Rows[0][0].GetProperty("data").GetString());
1117Assert.Equal("Reason", tableEvent.Rows[0][1].GetProperty("data").GetString());
1156Assert.Equal(15110, request.Payload.GetProperty("issue_number").GetInt32());
1279foreach (JsonElement rule in root.GetProperty("testFailurePatterns").EnumerateArray())
1284foreach (JsonElement rule in root.GetProperty("jobFailurePatterns").EnumerateArray())
1313ExtractRegexPatterns(root.GetProperty("testFailurePatterns"), regexPatterns);
1314ExtractRegexPatterns(root.GetProperty("jobFailurePatterns"), regexPatterns);
Microsoft.AspNetCore.Components.Endpoints (3)
Microsoft.Build (3)
Microsoft.CodeAnalysis.Workspaces.MSBuild (3)
Microsoft.Deployment.DotNet.Releases (6)
Microsoft.DotNet.ProjectTools (1)
Microsoft.Extensions.AI.Abstractions.Tests (24)
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (10)
Microsoft.Extensions.AI.Evaluation.Safety (5)
Microsoft.Extensions.AI.OpenAI.Tests (10)
Microsoft.Extensions.AI.Tests (16)
Microsoft.ML.Tokenizers.Tests (2)
Microsoft.TestPlatform.CommunicationUtilities (7)