234 writes to State
Aspire.Cli.Tests (234)
Backchannel\ResourceSnapshotMapperTests.cs (26)
43State = "Running", 75State = "Running", 171State = "Running", 195State = "Running", 221State = "Running", 249State = "Running", 276State = "Running", 319State = "Running", 348State = "Running" 356State = "Waiting", 374State = "Waiting", 406State = "Running" 413State = "Running" 421State = "Waiting", 436new() { Name = "cache-zuyppzgw", DisplayName = "cache", ResourceType = "Container", State = "Running" }, 437new() { Name = "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running" } 451new() { Name = "cache-zuyppzgw", DisplayName = "cache", ResourceType = "Container", State = "Running" }, 452new() { Name = "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running" } 466new() { Name = "cache-abc12345", DisplayName = "cache", ResourceType = "Container", State = "Running" }, 467new() { Name = "cache-def67890", DisplayName = "cache", ResourceType = "Container", State = "Running" }, 468new() { Name = "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running" } 481new() { Name = "cache-abc12345", DisplayName = "cache", ResourceType = "Container", State = "Running" }, 482new() { Name = "cache-def67890", DisplayName = "cache", ResourceType = "Container", State = "Running" }, 483new() { Name = "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running" } 497new() { Name = "cache-zuyppzgw", DisplayName = "cache", ResourceType = "Container", State = "Running" } 510new() { 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 } 82[.. resources, new() { Name = "api", State = "Running", HealthStatus = "Healthy" }])); 90new() { Name = "api", State = "Running", HealthStatus = "Healthy" }, 94Name = "generator", State = "NotStarted", HealthStatus = "Unhealthy", 110new() { Name = "api", State = "Running", HealthStatus = "Healthy" }, 111new() { Name = "worker", State = "Waiting" }, 112new() { Name = "database", State = "Running", HealthStatus = "Unhealthy" }
Backchannel\TrayWatchStreamTests.cs (14)
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 }); 824connection.ResourceSnapshots = [new() { Name = "api", State = "Running", HealthStatus = "Healthy" }]; 865initial.ResourceSnapshots = [new() { Name = "api", State = "Running", HealthStatus = "Healthy" }]; 868replacement.ResourceSnapshots = [new() { Name = "api", State = "Waiting" }]; 931initial.ResourceSnapshots = [new() { Name = "api", State = "Running", HealthStatus = "Healthy" }]; 934replacement.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)
386new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 394new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 396new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Stopping" }, 398new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Stopping" }, 443State = "Starting" 453State = "Running" 460State = "Running" 518new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 554new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 555new ResourceSnapshot { Name = "postgres", DisplayName = "postgres", ResourceType = "Container", State = "Running" }, 556new ResourceSnapshot { Name = "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running" }, 586State = "Running", 647new ResourceSnapshot { Name = "redis", Version = 1, DisplayName = "redis", ResourceType = "Container", State = "Starting" }, 686new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 695new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 697new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Stopping" }, 699new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Stopping" }, 730new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 760new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 784new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 812new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 845State = "Running", 882new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 913new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 914new ResourceSnapshot { Name = "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" }, 915new ResourceSnapshot { Name = "hidden-svc", DisplayName = "hidden-svc", ResourceType = "Project", State = "Running", IsHidden = true }, 939new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 940new ResourceSnapshot { Name = "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" }, 941new ResourceSnapshot { Name = "hidden-svc", DisplayName = "hidden-svc", ResourceType = "Project", State = "Running", IsHidden = true }, 967new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 968new ResourceSnapshot { Name = "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" }, 992new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 993new ResourceSnapshot { Name = "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" }, 1020new ResourceSnapshot { Name = "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" }, 1021new ResourceSnapshot { Name = "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" }, 1052Name = "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running", 1065new ResourceSnapshot { Name = "api-2", DisplayName = "api", ResourceType = "Project", State = "Running" }, 1066new ResourceSnapshot { Name = "api-1", DisplayName = "api", ResourceType = "Project", State = "Running" }, 1067new ResourceSnapshot { Name = "cache", DisplayName = "cache", ResourceType = "Container", State = "Running", IsHidden = true }, 1068new ResourceSnapshot { Name = "connection", DisplayName = "connection", ResourceType = "Parameter", State = "Running" } 1087Name = "end", DisplayName = "api\" # & <b> \\ `\nnext", ResourceType = "Project", State = "Running", 1109Name = "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running", 1112new ResourceSnapshot { Name = "api-2", DisplayName = "api", ResourceType = "Project", State = "Running" }, 1113new ResourceSnapshot { Name = "api-1", DisplayName = "api", ResourceType = "Project", State = "Running" } 1130new ResourceSnapshot { Name = "cache", DisplayName = "cache", ResourceType = "Container", State = "Hidden" }, 1131new ResourceSnapshot { Name = "connection", DisplayName = "connection", ResourceType = "Parameter", State = "Running" } 1162new ResourceSnapshot { Name = "cache", DisplayName = "cache", ResourceType = "Container", State = "Running" } 1292State = "Running" 1358State = "Running", 1371State = "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)
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)
72if (completed || ((string.IsNullOrEmpty(resource.State) || IsState(resource, KnownResourceStates.Active)) 92=> string.Equals(resource.State, state, StringComparisons.ResourceState);
Commands\DescribeCommand.cs (2)
405var stateText = ColorState(snapshot.State); 433return 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 })