231 writes to State
Aspire.Cli.Tests (231)
Backchannel\ResourceSnapshotMapperTests.cs (25)
42State = "Running", 138State = "Running", 162State = "Running", 188State = "Running", 216State = "Running", 243State = "Running", 286State = "Running", 315State = "Running" 323State = "Waiting", 341State = "Waiting", 373State = "Running" 380State = "Running" 388State = "Waiting", 403new() { Name = "cache-zuyppzgw", DisplayName = "cache", ResourceType = "Container", State = "Running" }, 404new() { Name = "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running" } 418new() { Name = "cache-zuyppzgw", DisplayName = "cache", ResourceType = "Container", State = "Running" }, 419new() { Name = "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running" } 433new() { Name = "cache-abc12345", DisplayName = "cache", ResourceType = "Container", State = "Running" }, 434new() { Name = "cache-def67890", DisplayName = "cache", ResourceType = "Container", State = "Running" }, 435new() { Name = "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running" } 448new() { Name = "cache-abc12345", DisplayName = "cache", ResourceType = "Container", State = "Running" }, 449new() { Name = "cache-def67890", DisplayName = "cache", ResourceType = "Container", State = "Running" }, 450new() { Name = "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running" } 464new() { Name = "cache-zuyppzgw", DisplayName = "cache", ResourceType = "Container", State = "Running" } 477new() { 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 (10)
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 } 82[.. resources, new() { Name = "api", State = "Running", HealthStatus = "Healthy" }])); 92new() { Name = "api", State = "Running", HealthStatus = "Healthy" }, 93new() { Name = "worker", State = "Waiting" }, 94new() { Name = "database", State = "Running", HealthStatus = "Unhealthy" }
Backchannel\TrayWatchStreamTests.cs (14)
674new() { Name = "api", State = "Starting", Version = 1 }, 675new() { Name = "cache", State = "Running", HealthStatus = "Healthy", Version = 1 } 700resourceUpdates.Writer.TryWrite(new() { Name = "api", State = "Running", HealthStatus = "Healthy", Version = 2 }); 703resourceUpdates.Writer.TryWrite(new() { Name = "cache", State = "Running", HealthStatus = "Degraded", Version = 2 }); 706resourceUpdates.Writer.TryWrite(new() { Name = "cache", State = "Running", HealthStatus = "Unhealthy", Version = 3 }); 709resourceUpdates.Writer.TryWrite(new() { Name = "cache", State = "Running", HealthStatus = "Healthy", Version = 4 }); 712resourceUpdates.Writer.TryWrite(new() { Name = "api", State = "Running", HealthStatus = "Unhealthy", Version = 1 }); 713resourceUpdates.Writer.TryWrite(new() { Name = "cache", State = "FailedToStart", Version = 5 }); 716resourceUpdates.Writer.TryWrite(new() { Name = "cache", State = "FailedToStart", IsHidden = true, Version = 6 }); 766connection.ResourceSnapshots = [new() { Name = "api", State = "Running", HealthStatus = "Healthy" }]; 807initial.ResourceSnapshots = [new() { Name = "api", State = "Running", HealthStatus = "Healthy" }]; 810replacement.ResourceSnapshots = [new() { Name = "api", State = "Waiting" }]; 873initial.ResourceSnapshots = [new() { Name = "api", State = "Running", HealthStatus = "Healthy" }]; 876replacement.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 (50)
276new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 284new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 286new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Stopping" }, 288new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Stopping" }, 333State = "Starting" 343State = "Running" 350State = "Running" 408new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 444new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 445new ResourceSnapshot { Name = "postgres", DisplayName = "postgres", ResourceType = "Container", State = "Running" }, 446new ResourceSnapshot { Name = "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running" }, 476State = "Running", 537new ResourceSnapshot { Name = "redis", Version = 1, DisplayName = "redis", ResourceType = "Container", State = "Starting" }, 576new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 585new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 587new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Stopping" }, 589new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Stopping" }, 620new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 650new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 674new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 702new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 735State = "Running", 772new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 803new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 804new ResourceSnapshot { Name = "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" }, 805new ResourceSnapshot { Name = "hidden-svc", DisplayName = "hidden-svc", ResourceType = "Project", State = "Running", IsHidden = true }, 829new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 830new ResourceSnapshot { Name = "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" }, 831new ResourceSnapshot { Name = "hidden-svc", DisplayName = "hidden-svc", ResourceType = "Project", State = "Running", IsHidden = true }, 857new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 858new ResourceSnapshot { Name = "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" }, 882new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 883new ResourceSnapshot { Name = "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" }, 910new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 911new ResourceSnapshot { Name = "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" }, 942Name = "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running", 955new ResourceSnapshot { Name = "api-2", DisplayName = "api", ResourceType = "Project", State = "Running" }, 956new ResourceSnapshot { Name = "api-1", DisplayName = "api", ResourceType = "Project", State = "Running" }, 957new ResourceSnapshot { Name = "cache", DisplayName = "cache", ResourceType = "Container", State = "Running", IsHidden = true }, 958new ResourceSnapshot { Name = "connection", DisplayName = "connection", ResourceType = "Parameter", State = "Running" } 977Name = "end", DisplayName = "api\" # & <b> \\ `\nnext", ResourceType = "Project", State = "Running", 999Name = "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running", 1002new ResourceSnapshot { Name = "api-2", DisplayName = "api", ResourceType = "Project", State = "Running" }, 1003new ResourceSnapshot { Name = "api-1", DisplayName = "api", ResourceType = "Project", State = "Running" } 1020new ResourceSnapshot { Name = "cache", DisplayName = "cache", ResourceType = "Container", State = "Hidden" }, 1021new ResourceSnapshot { Name = "connection", DisplayName = "connection", ResourceType = "Parameter", State = "Running" } 1052new ResourceSnapshot { Name = "cache", DisplayName = "cache", ResourceType = "Container", State = "Running" } 1134State = "Running" 1200State = "Running", 1213State = "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)
798State = "Running"
Commands\TerminalTapePlayCommandTests.cs (1)
508new 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)
80State = "Running" 107State = "Running", 127State = "Running" 134State = "Running" 141State = "Running" 177State = "Running", 192State = "Running" 199State = "Hidden" 234State = "Running", 242State = "Running" 249State = "Hidden" 314State = "Running" 321State = "Running" 328State = "Starting" 390State = "Running" 393connection.ResourceSnapshots.Insert(1, new ResourceSnapshot { Name = "hidden-state", State = "Hidden" }); 641State = state 669State = index == 0 ? longText : "Running", 728State = "Running", 738State = "Running", 766State = "Running", 777State = "Running", 788State = "Running", 817State = "Running", 844State = "Running", 889State = "Running", 968State = "Running", 979State = "Running", 989State = "Running", 999State = "Running", 1057State = "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" });
16 references to State
aspire (9)
Backchannel\ResourceSnapshotMapper.cs (4)
152State = snapshot.State, 353if (string.Equals(item.State, "Hidden", StringComparison.OrdinalIgnoreCase)) 376/// or its <see cref="ResourceSnapshot.State"/> is "Hidden". 380return snapshot.IsHidden || string.Equals(snapshot.State, "Hidden", StringComparison.OrdinalIgnoreCase);
Backchannel\TrayResourceHealth.cs (2)
63if (completed || ((string.IsNullOrEmpty(resource.State) || IsState(resource, KnownResourceStates.Active)) 83=> string.Equals(resource.State, state, StringComparisons.ResourceState);
Commands\DescribeCommand.cs (2)
384var stateText = ColorState(snapshot.State); 412return new ResourceDisplayState(displayName, snapshot.State, snapshot.HealthStatus, endpoints);
Mcp\Tools\ListResourcesTool.cs (1)
207State = 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 })