79 references to KnownResourceState
Aspire.Dashboard (26)
Components\Pages\Resources.razor.cs (1)
193.Any(r => r.KnownState != KnownResourceState.Running || r.HealthStatus is HealthStatus.Unhealthy or HealthStatus.Degraded);
Extensions\ResourceViewModelExtensions.cs (14)
12return resource.KnownState is KnownResourceState.Running; 17return resource.KnownState is KnownResourceState.Finished; 22return resource.KnownState is KnownResourceState.Exited; 27return resource.KnownState is KnownResourceState.Exited or KnownResourceState.Finished or KnownResourceState.FailedToStart; 32return resource.KnownState is KnownResourceState.Starting or KnownResourceState.Building or KnownResourceState.Waiting or KnownResourceState.Stopping; 37return resource.KnownState is KnownResourceState.RuntimeUnhealthy; 42return resource.KnownState is KnownResourceState.NotStarted; 47return resource.KnownState is KnownResourceState.Waiting; 50public static bool IsUnknownState(this ResourceViewModel resource) => resource.KnownState is KnownResourceState.Unknown;
Model\Assistant\AIHelpers.cs (3)
184.Where(r => r.KnownState != KnownResourceState.Hidden) 209return $"Health reports aren't evaluated until the resource is in a {KnownResourceState.Running} state"; 219return $"Health reports aren't evaluated until the resource is in a {KnownResourceState.Running} state";
Model\ResourceStateViewModel.cs (2)
119else if (resource is { KnownState: KnownResourceState.Running, HealthStatus: not HealthStatus.Healthy }) 147{ KnownState: KnownResourceState.Running, HealthStatus: not HealthStatus.Healthy } => $"{resource.State.Humanize()} ({(resource.HealthStatus ?? HealthStatus.Unhealthy).Humanize()})",
Model\ResourceViewModel.cs (5)
23private readonly KnownResourceState? _knownState; 96public KnownResourceState? KnownState 131return IsHidden || KnownState is KnownResourceState.Hidden; 134internal static HealthStatus? ComputeHealthStatus(ImmutableArray<HealthReportViewModel> healthReports, KnownResourceState? state) 136if (state != KnownResourceState.Running)
ServiceClient\Partials.cs (1)
38KnownState = HasState ? Enum.TryParse(State, out KnownResourceState knownState) ? knownState : null : null,
Aspire.Dashboard.Components.Tests (16)
Pages\ConsoleLogsTests.cs (14)
50var testResource = ModelTestHelpers.CreateResource(resourceName: "test-resource", state: KnownResourceState.Running); 100var testResource = ModelTestHelpers.CreateResource(resourceName: "test-resource", state: KnownResourceState.Running); 101var testResource2 = ModelTestHelpers.CreateResource(resourceName: "test-resource2", state: KnownResourceState.Running); 182var regularResource = ModelTestHelpers.CreateResource(resourceName: "regular-resource", state: KnownResourceState.Running); 183var hiddenResource = ModelTestHelpers.CreateResource(resourceName: "hidden-resource", state: KnownResourceState.Running, hidden: true); 289var testResource = ModelTestHelpers.CreateResource(resourceName: "test-resource", state: KnownResourceState.Running); 337var testResource = ModelTestHelpers.CreateResource(resourceName: "test-resource", state: KnownResourceState.Running); 386var testResource = ModelTestHelpers.CreateResource(resourceName: "test-resource", state: KnownResourceState.Running); 439var testResource = ModelTestHelpers.CreateResource(resourceName: "test-resource", state: KnownResourceState.Running); 496var testResource = ModelTestHelpers.CreateResource(resourceName: "test-resource", state: KnownResourceState.Running); 552state: KnownResourceState.Running, 596state: KnownResourceState.Running, 616state: KnownResourceState.Running, 677var testResource = ModelTestHelpers.CreateResource(resourceName: "test-resource", state: KnownResourceState.Running);
Pages\ResourcesTests.cs (1)
363KnownState = state is not null ? Enum.Parse<KnownResourceState>(state) : null,
tests\Shared\DashboardModel\ModelTestHelpers.cs (1)
15KnownResourceState? state = null,
Aspire.Dashboard.Tests (37)
ConsoleLogsTests\CreateResourceSelectModelsTests.cs (8)
21ModelTestHelpers.CreateResource(resourceName: "App1", state: KnownResourceState.Running, displayName: "App1") 54ModelTestHelpers.CreateResource(resourceName: "App1-r1", state: KnownResourceState.Running, displayName: "App1"), 58ModelTestHelpers.CreateResource(resourceName: "App2", state: KnownResourceState.Starting), 61ModelTestHelpers.CreateResource(resourceName: "App3", state: KnownResourceState.Finished), 64ModelTestHelpers.CreateResource(resourceName: "App4", state: KnownResourceState.Running) 143ModelTestHelpers.CreateResource(resourceName: "App1", state: KnownResourceState.Running, displayName: "App1"), 144ModelTestHelpers.CreateResource(resourceName: "App2", state: KnownResourceState.Running, displayName: "App2"), 145ModelTestHelpers.CreateResource(resourceName: "App3", state: KnownResourceState.Running, displayName: "App3")
Integration\Playwright\Infrastructure\MockDashboardClient.cs (1)
30state: KnownResourceState.Running);
Model\AIAssistant\AssistantChatDataContextTests.cs (1)
180var testResource = ModelTestHelpers.CreateResource(resourceName: "test-resource", state: KnownResourceState.Running);
Model\ResourceStateViewModelTests.cs (14)
20/* state */ "Container", KnownResourceState.Exited, null, null,null, 23/* state */ "Container", KnownResourceState.Exited, 3, null, null, 26/* state */ "Container", KnownResourceState.Exited, 0, null, null, 29/* state */ "Container", KnownResourceState.Finished, 0, null, null, 32/* state */ "CustomResource", KnownResourceState.Finished, null, null, null, 35/* state */ "Container", KnownResourceState.Unknown, null, null, null, 39/* state */ "Container", KnownResourceState.Running, null, "Healthy", null, 42/* state */ "Container", KnownResourceState.Running, null, "", null, 45/* state */ "Container", KnownResourceState.Running, null, "Unhealthy", null, 48/* state */ "Container", KnownResourceState.Running, null, "Healthy", "warning", 51/* state */ "Container", KnownResourceState.Running, null, "Healthy", "NOT_A_VALID_STATE_STYLE", 54/* state */ "Container", KnownResourceState.Running, null, null, "info", 57/* state */ "Container", KnownResourceState.RuntimeUnhealthy, null, null, null, 61KnownResourceState state,
Model\ResourceViewModelTests.cs (8)
19[InlineData(KnownResourceState.Starting, null, null)] 20[InlineData(KnownResourceState.Starting, null, new string[]{})] 21[InlineData(KnownResourceState.Starting, null, new string?[]{null})] 23[InlineData(KnownResourceState.Running, DiagnosticsHealthStatus.Healthy, new string[]{})] 24[InlineData(KnownResourceState.Running, DiagnosticsHealthStatus.Healthy, new string?[] {"Healthy"})] 25[InlineData(KnownResourceState.Running, DiagnosticsHealthStatus.Unhealthy, new string?[] {null})] 26[InlineData(KnownResourceState.Running, DiagnosticsHealthStatus.Degraded, new string?[] {"Healthy", "Degraded"})] 27public void Resource_WithHealthReportAndState_ReturnsCorrectHealthStatus(KnownResourceState? state, DiagnosticsHealthStatus? expectedStatus, string?[]? healthStatusStrings)
ResourceOutgoingPeerResolverTests.cs (4)
17private static ResourceViewModel CreateResource(string name, string? serviceAddress = null, int? servicePort = null, string? displayName = null, KnownResourceState? state = null) 156await sourceChannel.Writer.WriteAsync(new ResourceViewModelChange(ResourceViewModelChangeType.Upsert, CreateResource("test2", serviceAddress: "localhost", servicePort: 8080, state: KnownResourceState.Starting))); 164await sourceChannel.Writer.WriteAsync(new ResourceViewModelChange(ResourceViewModelChangeType.Upsert, CreateResource("test2", serviceAddress: "localhost", servicePort: 8081, state: KnownResourceState.Starting))); 172await sourceChannel.Writer.WriteAsync(new ResourceViewModelChange(ResourceViewModelChangeType.Upsert, CreateResource("test2", serviceAddress: "localhost", servicePort: 8081, state: KnownResourceState.Running)));
tests\Shared\DashboardModel\ModelTestHelpers.cs (1)
15KnownResourceState? state = null,