253 writes to State
Aspire.Cli.Tests (253)
Backchannel\ResourceSnapshotMapperTests.cs (26)
59State = "Running", 91State = "Running", 187State = "Running", 211State = "Running", 237State = "Running", 265State = "Running", 292State = "Running", 335State = "Running", 364State = "Running" 372State = "Waiting", 390State = "Waiting", 422State = "Running" 429State = "Running" 437State = "Waiting", 452new() { Name = "cache-zuyppzgw", DisplayName = "cache", ResourceType = "Container", State = "Running" }, 453new() { Name = "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running" } 467new() { Name = "cache-zuyppzgw", DisplayName = "cache", ResourceType = "Container", State = "Running" }, 468new() { Name = "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running" } 482new() { Name = "cache-abc12345", DisplayName = "cache", ResourceType = "Container", State = "Running" }, 483new() { Name = "cache-def67890", DisplayName = "cache", ResourceType = "Container", State = "Running" }, 484new() { Name = "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running" } 497new() { Name = "cache-abc12345", DisplayName = "cache", ResourceType = "Container", State = "Running" }, 498new() { Name = "cache-def67890", DisplayName = "cache", ResourceType = "Container", State = "Running" }, 499new() { Name = "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running" } 513new() { Name = "cache-zuyppzgw", DisplayName = "cache", ResourceType = "Container", State = "Running" } 526new() { Name = "Cache-Zuyppzgw", DisplayName = "Cache", ResourceType = "Container", State = "Running" }
Backchannel\ResourceSnapshotWatcherTests.cs (12)
204State = "Starting", 216State = "Running", 249State = "Running", 262State = "Starting", 296State = "Starting", 309State = "Running", 343State = "Running", 355State = "Starting", 365State = "Finished", 490State = $"State-{updateIndex}" 561State = "State-1", 587State = $"State-{version}",
Backchannel\TrayResourceHealthTests.cs (12)
37State = state, 56State = "Running", 73new() { Name = "hidden-state", State = "Hidden", HealthStatus = "Unhealthy" }, 74new() { Name = "hidden-flag", State = "FailedToStart", IsHidden = true }, 75new() { Name = "parameter", ResourceType = "Parameter", State = "Active" }, 77new() { Name = "setup", State = "Finished", ExitCode = 0 } 83[.. resources, new() { Name = "api", State = "Running", HealthStatus = "Healthy" }])); 91new() { Name = "api", State = "Running", HealthStatus = "Healthy" }, 95Name = "generator", State = "NotStarted", HealthStatus = "Unhealthy", 111new() { Name = "api", State = "Running", HealthStatus = "Healthy" }, 112new() { Name = "worker", State = "Waiting" }, 113new() { Name = "database", State = "Running", HealthStatus = "Unhealthy" }
Backchannel\TrayWatchStreamTests.cs (17)
732new() { Name = "api", State = "Starting", Version = 1 }, 733new() { Name = "cache", State = "Running", HealthStatus = "Healthy", Version = 1 } 758resourceUpdates.Writer.TryWrite(new() { Name = "api", State = "Running", HealthStatus = "Healthy", Version = 2 }); 761resourceUpdates.Writer.TryWrite(new() { Name = "cache", State = "Running", HealthStatus = "Degraded", Version = 2 }); 764resourceUpdates.Writer.TryWrite(new() { Name = "cache", State = "Running", HealthStatus = "Unhealthy", Version = 3 }); 767resourceUpdates.Writer.TryWrite(new() { Name = "cache", State = "Running", HealthStatus = "Healthy", Version = 4 }); 770resourceUpdates.Writer.TryWrite(new() { Name = "api", State = "Running", HealthStatus = "Unhealthy", Version = 1 }); 771resourceUpdates.Writer.TryWrite(new() { Name = "cache", State = "FailedToStart", Version = 5 }); 774resourceUpdates.Writer.TryWrite(new() { Name = "cache", State = "FailedToStart", IsHidden = true, Version = 6 }); 825? [new() { Name = "api", State = "Running", IsHidden = true }] 842resourceUpdates.Writer.TryWrite(new() { Name = "api", State = "Running" }); 845resourceUpdates.Writer.TryWrite(new() { Name = "api", State = "Running", IsHidden = true }); 874connection.ResourceSnapshots = [new() { Name = "api", State = "Running", HealthStatus = "Healthy" }]; 915initial.ResourceSnapshots = [new() { Name = "api", State = "Running", HealthStatus = "Healthy" }]; 918replacement.ResourceSnapshots = [new() { Name = "api", State = "Waiting" }]; 981initial.ResourceSnapshots = [new() { Name = "api", State = "Running", HealthStatus = "Healthy" }]; 984replacement.ResourceSnapshots = [new() { Name = "api", State = "Waiting" }];
Commands\AgentMcpCommandTests.cs (14)
242State = "Running", 306State = "Running", 383State = "Running", 516State = "Running", 667State = "Running", 712State = "Running", 808State = "Running" 838State = currentState, 930State = "Running", 1128State = "Running", 1209State = "Running", 1411State = "Running", 1840State = "Running", 1955State = "Running",
Commands\DescribeCommandTests.cs (66)
38var snapshot = new ResourceSnapshot { Name = "resource", State = state, ExitCode = exitCode }; 52new() { Name = "running", ResourceType = "Project", State = "Running", HealthStatus = "Healthy" }, 53new() { Name = "finished-positive", ResourceType = "Project", State = "Finished", ExitCode = 1 }, 54new() { Name = "finished-negative", ResourceType = "Project", State = "Finished", ExitCode = -532462766 }, 55new() { Name = "finished-zero", ResourceType = "Project", State = "Finished", ExitCode = 0 }, 56new() { Name = "finished-unknown", ResourceType = "Project", State = "Finished" }, 57new() { Name = "exited-positive", ResourceType = "Container", State = "Exited", ExitCode = 1 }, 58new() { Name = "exited-negative", ResourceType = "Container", State = "Exited", ExitCode = -532462766 }, 59new() { Name = "exited-zero", ResourceType = "Container", State = "Exited", ExitCode = 0 }, 60new() { Name = "exited-unknown", ResourceType = "Container", State = "Exited" } 78new() { Name = "api", ResourceType = "Project", State = "Finished", ExitCode = -532462766 } 103new() { Name = "api", ResourceType = "Project", State = "Finished", ExitCode = -532462766 } 122new ResourceSnapshot { Name = "cache", ResourceType = "Container", ResourceTypeDisplayName = "Redis", State = "Running" }, 123new ResourceSnapshot { Name = "postgres", ResourceType = "Container", ResourceTypeDisplayName = "PostgreSQL Server", State = "Running" }, 124new ResourceSnapshot { Name = "orders", ResourceType = "Project", ResourceTypeDisplayName = "ASP.NET Core", State = "Running" }, 125new ResourceSnapshot { Name = "generic", ResourceType = "Container", State = "Running" } 499new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 507new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 509new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Stopping" }, 511new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Stopping" }, 556State = "Starting" 566State = "Running" 573State = "Running" 631new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 667new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 668new ResourceSnapshot { Name = "postgres", DisplayName = "postgres", ResourceType = "Container", State = "Running" }, 669new ResourceSnapshot { Name = "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running" }, 699State = "Running", 760new ResourceSnapshot { Name = "redis", Version = 1, DisplayName = "redis", ResourceType = "Container", State = "Starting" }, 799new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 808new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 810new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Stopping" }, 812new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Stopping" }, 843new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 873new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 897new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 925new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 958State = "Running", 995new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 1026new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 1027new ResourceSnapshot { Name = "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" }, 1028new ResourceSnapshot { Name = "hidden-svc", DisplayName = "hidden-svc", ResourceType = "Project", State = "Running", IsHidden = true }, 1052new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 1053new ResourceSnapshot { Name = "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" }, 1054new ResourceSnapshot { Name = "hidden-svc", DisplayName = "hidden-svc", ResourceType = "Project", State = "Running", IsHidden = true }, 1080new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 1081new ResourceSnapshot { Name = "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" }, 1105new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 1106new ResourceSnapshot { Name = "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" }, 1133new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 1134new ResourceSnapshot { Name = "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" }, 1165Name = "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running", 1178new ResourceSnapshot { Name = "api-2", DisplayName = "api", ResourceType = "Project", State = "Running" }, 1179new ResourceSnapshot { Name = "api-1", DisplayName = "api", ResourceType = "Project", State = "Running" }, 1180new ResourceSnapshot { Name = "cache", DisplayName = "cache", ResourceType = "Container", State = "Running", IsHidden = true }, 1181new ResourceSnapshot { Name = "connection", DisplayName = "connection", ResourceType = "Parameter", State = "Running" } 1200Name = "end", DisplayName = "api\" # & <b> \\ `\nnext", ResourceType = "Project", State = "Running", 1222Name = "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running", 1225new ResourceSnapshot { Name = "api-2", DisplayName = "api", ResourceType = "Project", State = "Running" }, 1226new ResourceSnapshot { Name = "api-1", DisplayName = "api", ResourceType = "Project", State = "Running" } 1243new ResourceSnapshot { Name = "cache", DisplayName = "cache", ResourceType = "Container", State = "Hidden" }, 1244new ResourceSnapshot { Name = "connection", DisplayName = "connection", ResourceType = "Parameter", State = "Running" } 1275new ResourceSnapshot { Name = "cache", DisplayName = "cache", ResourceType = "Container", State = "Running" } 1405State = "Running" 1471State = "Running", 1484State = "Running"
Commands\ExportCommandTests.cs (26)
50new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 51new ResourceSnapshot { Name = "apiservice", DisplayName = "apiservice", ResourceType = "Project", State = "Running" }, 127new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 204new ResourceSnapshot { Name = "other-resource", DisplayName = "other-resource", ResourceType = "Project", State = "Running" }, 227new ResourceSnapshot { Name = "target-resource", DisplayName = "target-resource", ResourceType = "Container", State = "Running" }, 330new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 331new ResourceSnapshot { Name = "apiservice-abc", DisplayName = "apiservice", ResourceType = "Project", State = "Running" }, 332new ResourceSnapshot { Name = "apiservice-def", DisplayName = "apiservice", ResourceType = "Project", State = "Running" }, 450new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 451new ResourceSnapshot { Name = "apiservice", DisplayName = "apiservice", ResourceType = "Project", State = "Running" }, 507new ResourceSnapshot { Name = "apiservice", DisplayName = "apiservice", ResourceType = "Project", State = "Running" }, 508new ResourceSnapshot { Name = "webfrontend", DisplayName = "webfrontend", ResourceType = "Project", State = "Running" }, 565new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 566new ResourceSnapshot { Name = "apiservice-abc", DisplayName = "apiservice", ResourceType = "Project", State = "Running" }, 567new ResourceSnapshot { Name = "apiservice-def", DisplayName = "apiservice", ResourceType = "Project", State = "Running" }, 615new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 616new ResourceSnapshot { Name = "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" }, 617new ResourceSnapshot { Name = "hidden-svc", DisplayName = "hidden-svc", ResourceType = "Project", State = "Running", IsHidden = true }, 659new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 660new ResourceSnapshot { Name = "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" }, 703new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 704new ResourceSnapshot { Name = "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" }, 745new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 781new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 824new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 825new ResourceSnapshot { Name = "apiservice", DisplayName = "apiservice", ResourceType = "Project", State = "Running" },
Commands\LogsCommandTests.cs (12)
738State = "Running" 745State = "Hidden" 828State = "Running" 859State = "Running" 869State = "Running" 876State = "Hidden" 995State = "Running" 1002State = "Hidden" 1559State = "Running" 1567State = "Running" 1574State = "Running" 1638State = "Hidden"
Commands\ResourceCommandTests.cs (1)
2353State = state,
Commands\TerminalCommandTests.cs (1)
825State = "Running"
Commands\TerminalTapePlayCommandTests.cs (1)
567new ResourceSnapshot { Name = "shell-0", DisplayName = "shell", ResourceType = "Executable", State = "Running" }
Mcp\ExcludeFromMcpTests.cs (10)
112State = "Running", 128State = "Running", 170State = "Running", 216State = "Running", 254State = "Running" 288State = "Running", 427State = "Running" 434State = "Running" 475State = "Running" 482State = "Running",
Mcp\ListResourcesToolTests.cs (31)
81State = "Running" 109State = "Running", 129State = "Running" 136State = "Running" 143State = "Running" 179State = "Running", 194State = "Running" 201State = "Hidden" 236State = "Running", 244State = "Running" 251State = "Hidden" 316State = "Running" 323State = "Running" 330State = "Starting" 392State = "Running" 395connection.ResourceSnapshots.Insert(1, new ResourceSnapshot { Name = "hidden-state", State = "Hidden" }); 643State = state 671State = index == 0 ? longText : "Running", 730State = "Running", 740State = "Running", 768State = "Running", 779State = "Running", 790State = "Running", 819State = "Running", 846State = "Running", 891State = "Running", 970State = "Running", 981State = "Running", 991State = "Running", 1001State = "Running", 1059State = "Running",
Mcp\WaitForResourcesToolTests.cs (24)
93State = "Running", 99State = "Running", 105State = "Running", 159State = "Running" 187State = "Running" 221State = "Running" 257State = "Running", 263State = "Running", 311State = "Starting" 317State = "Starting" 366State = "Running", 373State = "Running", 384State = "Running" 390State = "Running" 486State = "Running" 540new ResourceSnapshot { Name = "ready", State = "Running" }, 541new ResourceSnapshot { Name = "slow", State = "Starting" }); 572State = "Starting" 611new ResourceSnapshot { Name = "api", State = "Starting" }, 612new ResourceSnapshot { Name = "worker", State = "Starting" }, 613new ResourceSnapshot { Name = "database", State = "Starting" }); 693new ResourceSnapshot { Name = "api", State = "Starting" }, 694new ResourceSnapshot { Name = "worker", State = "Starting" }); 775var connection = CreateConnection(new ResourceSnapshot { Name = "api", State = "Starting" });
18 references to State
aspire (11)
Backchannel\ResourceSnapshotMapper.cs (4)
153State = snapshot.State, 354if (string.Equals(item.State, "Hidden", StringComparison.OrdinalIgnoreCase)) 377/// or its <see cref="ResourceSnapshot.State"/> is "Hidden". 381return snapshot.IsHidden || string.Equals(snapshot.State, "Hidden", StringComparison.OrdinalIgnoreCase);
Backchannel\TrayResourceHealth.cs (2)
76if (completed || ((string.IsNullOrEmpty(resource.State) || IsState(resource, KnownResourceStates.Active)) 96=> string.Equals(resource.State, state, StringComparisons.ResourceState);
Commands\DescribeCommand.cs (4)
433return new ResourceDisplayState(displayName, snapshot.State, snapshot.HealthStatus, endpoints); 452if (snapshot.ExitCode is int exitCode && snapshot.State?.ToUpperInvariant() is "FINISHED" or "EXITED") 454var text = string.Format(CultureInfo.CurrentCulture, DescribeCommandStrings.StateWithExitCode, snapshot.State, exitCode).EscapeMarkup(); 458return ColorState(snapshot.State);
Mcp\Tools\ListResourcesTool.cs (1)
209State = McpToolHelpers.MapResourceState(snapshot.State),
Aspire.Cli.Tests (7)
Backchannel\ResourceSnapshotWatcherTests.cs (7)
228Assert.Equal("Running", snapshot.State); 274Assert.Equal("Running", snapshot.State); 321Assert.Equal("Running", snapshot.State); 385Assert.Equal("Running", retainedSnapshot.State); 399Assert.Equal("Finished", currentSnapshot.State); 404Assert.Equal("Finished", update.State); 523.Select(update => new { update.Name, update.DisplayName, update.State })