249 writes to Name
Aspire.Cli.Tests (249)
Backchannel\AppHostAuxiliaryBackchannelTests.cs (1)
242Name = "api",
Backchannel\ResourceSnapshotMapperTests.cs (25)
39Name = "frontend", 135Name = "frontend", 159Name = "frontend", 185Name = "parameter", 213Name = "parameter", 240Name = "frontend", 283Name = "frontend", 312Name = "messaging-abcxyz", 320Name = "frontend", 338Name = "frontend", 370Name = "messaging-abcxyz", 377Name = "messaging-defuvw", 385Name = "frontend", 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)
201Name = "api", 213Name = "api", 246Name = "api", 259Name = "api", 293Name = "api", 306Name = "api", 340Name = "api", 352Name = "api", 362Name = "api", 487Name = $"resource-{resourceIndex}", 558Name = "resource-0", 584Name = $"resource-{resourceIndex}",
Backchannel\TrayResourceHealthTests.cs (11)
36Name = "resource", 55Name = "api", 73new() { Name = "hidden-state", State = "Hidden", HealthStatus = "Unhealthy" }, 74new() { Name = "hidden-flag", State = "FailedToStart", IsHidden = true }, 75new() { Name = "parameter", ResourceType = "Parameter", State = "Active" }, 76new() { Name = "connection", ResourceType = "ConnectionString" }, 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)
239Name = "test-resource-abcd1234", 303Name = "annotated-resource-runtime", 380Name = "my-resource-abcd1234", 513Name = "db1-mcp-ypnvhwvw", 664Name = "unrelated-db-xyz", 709Name = "pinned-db-xyz", 806Name = "unrelated", 835Name = "api", 927Name = "pinned-db-xyz", 1125Name = "pinned-db-xyz", 1206Name = "db-mcp-abcd1234", 1408Name = "db-mcp-xyz", 1837Name = $"{displayName}-runtime", 1952Name = "contract-resource-runtime",
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" }, 330Name = $"resource-{index}", 340Name = initialSnapshots[0].Name, 347Name = initialSnapshots[^1].Name, 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" }, 473Name = "redis", 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" }, 732Name = "postgres", 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" } 1131Name = "redis", 1197Name = "redis", 1210Name = "redis",
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)
735Name = "redis", 742Name = "aspire-dashboard", 825Name = "redis", 856Name = "redis", 866Name = "redis", 873Name = "late-hidden", 992Name = "redis", 999Name = "aspire-dashboard", 1556Name = "redis", 1564Name = "apiservice-abc123", 1571Name = "apiservice-def456", 1635Name = "late-hidden",
Commands\ResourceCommandTests.cs (1)
2351Name = name,
Commands\TerminalCommandTests.cs (1)
795Name = name,
Commands\TerminalTapePlayCommandTests.cs (1)
508new ResourceSnapshot { Name = "shell-0", DisplayName = "shell", ResourceType = "Executable", State = "Running" }
Mcp\ExcludeFromMcpTests.cs (15)
31Name = "test", 43Name = "test", 58Name = "test", 73Name = "test", 88Name = "test", 109Name = ApiServiceName, 125Name = SecretServiceName, 167Name = SecretServiceName, 213Name = SecretServiceName, 251Name = ApiServiceName, 285Name = SecretServiceName, 424Name = ApiServiceName, 431Name = SecretServiceName, 472Name = ApiServiceName, 479Name = SecretServiceName,
Mcp\ListResourcesToolTests.cs (42)
78Name = "api-service", 104Name = "api", 124Name = "redis-instance-1", 131Name = "redis-instance-2", 138Name = "redis-instance-3", 174Name = "api", 189Name = "redis-visible", 196Name = "redis-hidden", 231Name = "api", 239Name = "redis-visible", 246Name = "redis-hidden", 311Name = "api-service", 318Name = "redis", 325Name = "postgres", 389Name = name, 392connection.ResourceSnapshots.Insert(0, new ResourceSnapshot { Name = "hidden", IsHidden = true }); 393connection.ResourceSnapshots.Insert(1, new ResourceSnapshot { Name = "hidden-state", State = "Hidden" }); 396Name = "excluded", 445new ResourceSnapshot { Name = "first" }, 446new ResourceSnapshot { Name = "second" }, 447new ResourceSnapshot { Name = "third" })); 476Name = $"resource-{index:D3}" 480Name = "api", 487snapshots.Add(new ResourceSnapshot { Name = "redis-visible", DisplayName = "Redis" }); 488snapshots.Add(new ResourceSnapshot { Name = "redis-hidden", DisplayName = "Redis", IsHidden = true }); 508Name = "api", 590monitor.AddConnection("hash1", "socket.hash1", CreateConnection(new ResourceSnapshot { Name = "api", Commands = commands })); 639Name = "model", 666Name = name, 726Name = "api-service", 736Name = "worker", 764Name = "project", 775Name = "executable", 786Name = "container", 815Name = "unicode-source", 842Name = "endpoints", 886Name = "api-service", 965Name = "redis-instance", 977Name = "worker", 987Name = "custom", 997Name = "case-mismatched-project", 1055Name = "custom",
Mcp\WaitForResourcesToolTests.cs (24)
91Name = "api", 98Name = "hidden-proxy", 104Name = "secret-store", 157Name = $"resource-{index}", 185Name = resourceName, 219Name = resourceName, 256Name = "hidden-proxy", 262Name = "secret-store", 309Name = "api-runtime", 315Name = "worker-runtime", 364Name = "hidden-runtime", 371Name = "excluded-runtime", 382Name = "replica-a", 388Name = "replica-b", 485Name = name, 540new ResourceSnapshot { Name = "ready", State = "Running" }, 541new ResourceSnapshot { Name = "slow", State = "Starting" }); 570Name = "api", 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" });
76 references to Name
aspire (63)
Backchannel\AppHostAuxiliaryBackchannel.cs (4)
412return snapshots.OrderBy(s => s.Name, StringComparer.OrdinalIgnoreCase).ToList(); 434return snapshots.OrderBy(s => s.Name, StringComparer.OrdinalIgnoreCase).ToList(); 667snapshots = snapshots.Where(s => s.Name.Contains(filter, StringComparison.OrdinalIgnoreCase)).ToList(); 707if (!string.IsNullOrEmpty(filter) && !snapshot.Name.Contains(filter, StringComparison.OrdinalIgnoreCase))
Backchannel\ResourceSnapshotMapper.cs (10)
20/// <see cref="ResourceSnapshot.Name"/> and <see cref="ResourceSnapshot.DisplayName"/>. 24return snapshots.Where(s => string.Equals(s.Name, resourceName, StringComparisons.ResourceName) 106ResourceName = match.Name 143var resourcePath = DashboardUrls.ResourcesUrl(snapshot.Name); 149Name = snapshot.Name, 301/// First tries an exact match on <see cref="ResourceSnapshot.Name"/>, then falls back 311var exactMatches = snapshots.Where(s => string.Equals(s.Name, resourceName, StringComparison.OrdinalIgnoreCase)).ToList(); 365return resource.Name; 370return resource.DisplayName ?? resource.Name; 402: new HashSet<string>(allSnapshots.Where(IsHiddenResource).Select(s => s.Name), StringComparers.ResourceName);
Backchannel\ResourceSnapshotWatcher.cs (10)
113_resources[snapshot.Name] = snapshot; 159if (!_resources.TryGetValue(snapshot.Name, out var currentSnapshot) || 162_resources[snapshot.Name] = snapshot; 181_resources.TryGetValue(snapshot.Name, out var currentSnapshot) && 193_resources[snapshot.Name] = snapshot; 197if (_pendingUpdates.ContainsKey(snapshot.Name) || _pendingUpdates.Count < UpdateBufferCapacity) 199_pendingUpdates[snapshot.Name] = update; 218snapshot.Name, 269.OrderBy(update => update.Snapshot.Name, StringComparer.OrdinalIgnoreCase) 365.OrderBy(snapshot => snapshot.Name, StringComparer.OrdinalIgnoreCase)
Commands\DescribeCommand.cs (12)
232r => r.Name, 237.Select(target => target.Name)); 274if (!resolved.Any(r => string.Equals(r.Name, snapshot.Name, StringComparison.OrdinalIgnoreCase))) 292if (lastDisplayedContent.TryGetValue(snapshot.Name, out var lastValue) && lastValue is string lastJson && lastJson == json) 297lastDisplayedContent[snapshot.Name] = json; 304if (lastDisplayedContent.TryGetValue(snapshot.Name, out var lastValue) && lastValue.Equals(displayState)) 309lastDisplayedContent[snapshot.Name] = displayState; 317.Select((snapshot, index) => (snapshot.Name, index)) 330if (snapshotIndexes.TryGetValue(snapshot.Name, out var index)) 341snapshotIndexes.Add(snapshot.Name, currentSnapshots.Count); 390var resourceUrl = DashboardUrls.CombineUrl(dashboardBaseUrl, DashboardUrls.ResourcesUrl(resource: snapshot.Name));
Commands\ExportCommand.cs (3)
235? new HashSet<string>(ResourceSnapshotMapper.WhereMatchesResourceName(snapshots, resourceName).Select(s => s.Name), StringComparers.ResourceName) 240if (matchingNames is not null && !matchingNames.Contains(snapshot.Name)) 278var snapshot = snapshots.FirstOrDefault(s => string.Equals(s.Name, name, StringComparisons.ResourceName));
Commands\LogsCommand.cs (1)
500var snapshot = snapshots.FirstOrDefault(s => string.Equals(s.Name, resourceName, StringComparisons.ResourceName));
Commands\McpToolsCommand.cs (2)
77var resourceName = r.DisplayName ?? r.Name; 103var resourceName = resource.DisplayName ?? resource.Name;
Commands\TerminalResourceResolver.cs (1)
37: matches[0].Name;
Mcp\McpResourceToolRefreshService.cs (1)
106var routedResourceName = resource.DisplayName ?? resource.Name;
Mcp\Tools\ListResourcesTool.cs (13)
189.OrderBy(snapshot => snapshot.Name, StringComparer.Ordinal) 204Name = GetBoundedText(snapshot.Name), 354identities[snapshot.Name] = ( 355hasDuplicateDisplayName ? snapshot.Name : snapshot.DisplayName ?? snapshot.Name, 356snapshot.Name); 368: (displayName, snapshot.Name); 378.Select(snapshot => snapshot.Name) 386targets[snapshot.Name] = [snapshot.Name]; 402if (!displayTargets.Contains(snapshot.Name, StringComparers.ResourceName)) 404displayTargets.Add(snapshot.Name); 495var dashboardUrl = DashboardUrls.CombineUrl(dashboardBaseUrl, DashboardUrls.ResourcesUrl(snapshot.Name));
Mcp\Tools\McpToolHelpers.cs (1)
467excludedNames.Add(snapshot.Name);
Mcp\Tools\WaitForResourcesTool.cs (5)
144.Select(static snapshot => snapshot.Name) 166.DistinctBy(static target => target.Name, StringComparers.ResourceName) 173validTargets.Select(static target => target.Name).ToArray(), 181target.Failure ?? MapWaitResult(waitResultsByName[target.Resource!.Name])).ToArray(); 342string.Equals(snapshot.Name, resourceName, StringComparisons.ResourceName));
Aspire.Cli.Tests (13)
Backchannel\AppHostAuxiliaryBackchannelTests.cs (2)
28Assert.Equal("api", snapshot.Name); 47Assert.Equal("api", resource.Name);
Backchannel\ResourceSnapshotMapperTests.cs (3)
410Assert.Equal("cache-zuyppzgw", result[0].Name); 425Assert.Equal("cache-zuyppzgw", result[0].Name); 456Assert.Equal("cache-abc12345", result[0].Name);
Backchannel\ResourceSnapshotWatcherTests.cs (3)
523.Select(update => new { update.Name, update.DisplayName, update.State }) 606snapshot.Name, 621Assert.Same(firstSnapshot, watcher.GetResource(firstSnapshot.Name));
Commands\DescribeCommandTests.cs (5)
340Name = initialSnapshots[0].Name, 347Name = initialSnapshots[^1].Name, 392var expectedStates = changedSnapshots.Any(changed => StringComparers.ResourceName.Equals(changed.Name, snapshot.Name)) 395Assert.Equal(expectedStates, resourcesByName[snapshot.Name]);