141 writes to Name
Aspire.Cli.Tests (141)
Backchannel\AppHostAuxiliaryBackchannelTests.cs (1)
200
Name
= "api",
Backchannel\ResourceSnapshotMapperTests.cs (25)
39
Name
= "frontend",
135
Name
= "frontend",
159
Name
= "frontend",
185
Name
= "parameter",
213
Name
= "parameter",
240
Name
= "frontend",
283
Name
= "frontend",
312
Name
= "messaging-abcxyz",
320
Name
= "frontend",
338
Name
= "frontend",
370
Name
= "messaging-abcxyz",
377
Name
= "messaging-defuvw",
385
Name
= "frontend",
403
new() {
Name
= "cache-zuyppzgw", DisplayName = "cache", ResourceType = "Container", State = "Running" },
404
new() {
Name
= "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running" }
418
new() {
Name
= "cache-zuyppzgw", DisplayName = "cache", ResourceType = "Container", State = "Running" },
419
new() {
Name
= "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running" }
433
new() {
Name
= "cache-abc12345", DisplayName = "cache", ResourceType = "Container", State = "Running" },
434
new() {
Name
= "cache-def67890", DisplayName = "cache", ResourceType = "Container", State = "Running" },
435
new() {
Name
= "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running" }
448
new() {
Name
= "cache-abc12345", DisplayName = "cache", ResourceType = "Container", State = "Running" },
449
new() {
Name
= "cache-def67890", DisplayName = "cache", ResourceType = "Container", State = "Running" },
450
new() {
Name
= "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running" }
464
new() {
Name
= "cache-zuyppzgw", DisplayName = "cache", ResourceType = "Container", State = "Running" }
477
new() {
Name
= "Cache-Zuyppzgw", DisplayName = "Cache", ResourceType = "Container", State = "Running" }
Backchannel\ResourceSnapshotWatcherTests.cs (12)
112
Name
= "api",
124
Name
= "api",
157
Name
= "api",
170
Name
= "api",
204
Name
= "api",
217
Name
= "api",
251
Name
= "api",
263
Name
= "api",
273
Name
= "api",
398
Name
= $"resource-{resourceIndex}",
469
Name
= "resource-0",
495
Name
= $"resource-{resourceIndex}",
Commands\AgentMcpCommandTests.cs (5)
148
Name
= "test-resource-abcd1234",
216
Name
= "my-resource-abcd1234",
291
Name
= "db1-mcp-ypnvhwvw",
406
Name
= "db-mcp-abcd1234",
491
Name
= "db-mcp-xyz",
Commands\DescribeCommandTests.cs (38)
276
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
284
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
286
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Stopping" },
288
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Stopping" },
330
Name
= $"resource-{index}",
340
Name
= initialSnapshots[0].Name,
347
Name
= initialSnapshots[^1].Name,
408
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
444
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
445
new ResourceSnapshot {
Name
= "postgres", DisplayName = "postgres", ResourceType = "Container", State = "Running" },
446
new ResourceSnapshot {
Name
= "frontend", DisplayName = "frontend", ResourceType = "Project", State = "Running" },
473
Name
= "redis",
537
new ResourceSnapshot {
Name
= "redis", Version = 1, DisplayName = "redis", ResourceType = "Container", State = "Starting" },
576
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
585
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
587
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Stopping" },
589
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Stopping" },
620
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
650
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
674
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
702
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
732
Name
= "postgres",
772
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
803
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
804
new ResourceSnapshot {
Name
= "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" },
805
new ResourceSnapshot {
Name
= "hidden-svc", DisplayName = "hidden-svc", ResourceType = "Project", State = "Running", IsHidden = true },
829
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
830
new ResourceSnapshot {
Name
= "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" },
831
new ResourceSnapshot {
Name
= "hidden-svc", DisplayName = "hidden-svc", ResourceType = "Project", State = "Running", IsHidden = true },
857
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
858
new ResourceSnapshot {
Name
= "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" },
882
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
883
new ResourceSnapshot {
Name
= "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" },
910
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
911
new ResourceSnapshot {
Name
= "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" },
978
Name
= "redis",
1044
Name
= "redis",
1057
Name
= "redis",
Commands\ExportCommandTests.cs (26)
50
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
51
new ResourceSnapshot {
Name
= "apiservice", DisplayName = "apiservice", ResourceType = "Project", State = "Running" },
127
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
204
new ResourceSnapshot {
Name
= "other-resource", DisplayName = "other-resource", ResourceType = "Project", State = "Running" },
227
new ResourceSnapshot {
Name
= "target-resource", DisplayName = "target-resource", ResourceType = "Container", State = "Running" },
330
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
331
new ResourceSnapshot {
Name
= "apiservice-abc", DisplayName = "apiservice", ResourceType = "Project", State = "Running" },
332
new ResourceSnapshot {
Name
= "apiservice-def", DisplayName = "apiservice", ResourceType = "Project", State = "Running" },
450
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
451
new ResourceSnapshot {
Name
= "apiservice", DisplayName = "apiservice", ResourceType = "Project", State = "Running" },
507
new ResourceSnapshot {
Name
= "apiservice", DisplayName = "apiservice", ResourceType = "Project", State = "Running" },
508
new ResourceSnapshot {
Name
= "webfrontend", DisplayName = "webfrontend", ResourceType = "Project", State = "Running" },
565
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
566
new ResourceSnapshot {
Name
= "apiservice-abc", DisplayName = "apiservice", ResourceType = "Project", State = "Running" },
567
new ResourceSnapshot {
Name
= "apiservice-def", DisplayName = "apiservice", ResourceType = "Project", State = "Running" },
615
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
616
new ResourceSnapshot {
Name
= "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" },
617
new ResourceSnapshot {
Name
= "hidden-svc", DisplayName = "hidden-svc", ResourceType = "Project", State = "Running", IsHidden = true },
659
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
660
new ResourceSnapshot {
Name
= "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" },
703
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
704
new ResourceSnapshot {
Name
= "aspire-dashboard", DisplayName = "aspire-dashboard", ResourceType = "Executable", State = "Hidden" },
745
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
781
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
824
new ResourceSnapshot {
Name
= "redis", DisplayName = "redis", ResourceType = "Container", State = "Running" },
825
new ResourceSnapshot {
Name
= "apiservice", DisplayName = "apiservice", ResourceType = "Project", State = "Running" },
Commands\LogsCommandTests.cs (12)
735
Name
= "redis",
742
Name
= "aspire-dashboard",
825
Name
= "redis",
856
Name
= "redis",
866
Name
= "redis",
873
Name
= "late-hidden",
992
Name
= "redis",
999
Name
= "aspire-dashboard",
1556
Name
= "redis",
1564
Name
= "apiservice-abc123",
1571
Name
= "apiservice-def456",
1635
Name
= "late-hidden",
Commands\ResourceCommandTests.cs (1)
2311
Name
= name,
Commands\TerminalCommandTests.cs (1)
648
Name
= name,
Mcp\ExcludeFromMcpTests.cs (15)
30
Name
= "test",
42
Name
= "test",
57
Name
= "test",
72
Name
= "test",
87
Name
= "test",
107
Name
= ApiServiceName,
114
Name
= SecretServiceName,
147
Name
= SecretServiceName,
179
Name
= SecretServiceName,
217
Name
= ApiServiceName,
251
Name
= SecretServiceName,
390
Name
= ApiServiceName,
397
Name
= SecretServiceName,
438
Name
= ApiServiceName,
445
Name
= SecretServiceName,
Mcp\ListResourcesToolTests.cs (5)
60
Name
= "api-service",
67
Name
= "redis",
74
Name
= "postgres",
106
Name
= "api-service",
145
Name
= "api-service",
56 references to Name
aspire (43)
Backchannel\AppHostAuxiliaryBackchannel.cs (4)
367
return snapshots.OrderBy(s => s.
Name
, StringComparer.OrdinalIgnoreCase).ToList();
389
return snapshots.OrderBy(s => s.
Name
, StringComparer.OrdinalIgnoreCase).ToList();
622
snapshots = snapshots.Where(s => s.
Name
.Contains(filter, StringComparison.OrdinalIgnoreCase)).ToList();
662
if (!string.IsNullOrEmpty(filter) && !snapshot.
Name
.Contains(filter, StringComparison.OrdinalIgnoreCase))
Backchannel\ResourceSnapshotMapper.cs (10)
20
/// <see cref="ResourceSnapshot.
Name
"/> and <see cref="ResourceSnapshot.DisplayName"/>.
24
return snapshots.Where(s => string.Equals(s.
Name
, resourceName, StringComparisons.ResourceName)
106
ResourceName = match.
Name
143
var resourcePath = DashboardUrls.ResourcesUrl(snapshot.
Name
);
149
Name = snapshot.
Name
,
292
/// First tries an exact match on <see cref="ResourceSnapshot.
Name
"/>, then falls back
302
var exactMatches = snapshots.Where(s => string.Equals(s.
Name
, resourceName, StringComparison.OrdinalIgnoreCase)).ToList();
356
return resource.
Name
;
361
return resource.DisplayName ?? resource.
Name
;
393
: new HashSet<string>(allSnapshots.Where(IsHiddenResource).Select(s => s.
Name
), StringComparers.ResourceName);
Backchannel\ResourceSnapshotWatcher.cs (10)
79
_resources[snapshot.
Name
] = snapshot;
124
if (!_resources.TryGetValue(snapshot.
Name
, out var currentSnapshot) ||
127
_resources[snapshot.
Name
] = snapshot;
158
_resources.TryGetValue(snapshot.
Name
, out var currentSnapshot) &&
170
_resources[snapshot.
Name
] = snapshot;
174
if (_pendingUpdates.ContainsKey(snapshot.
Name
) || _pendingUpdates.Count < UpdateBufferCapacity)
176
_pendingUpdates[snapshot.
Name
] = update;
195
snapshot.
Name
,
246
.OrderBy(update => update.Snapshot.
Name
, StringComparer.OrdinalIgnoreCase)
342
.OrderBy(snapshot => snapshot.
Name
, StringComparer.OrdinalIgnoreCase)
Commands\DescribeCommand.cs (10)
250
if (!resolved.Any(r => string.Equals(r.
Name
, snapshot.
Name
, StringComparison.OrdinalIgnoreCase)))
268
if (lastDisplayedContent.TryGetValue(snapshot.
Name
, out var lastValue) && lastValue is string lastJson && lastJson == json)
273
lastDisplayedContent[snapshot.
Name
] = json;
280
if (lastDisplayedContent.TryGetValue(snapshot.
Name
, out var lastValue) && lastValue.Equals(displayState))
285
lastDisplayedContent[snapshot.
Name
] = displayState;
293
.Select((snapshot, index) => (snapshot.
Name
, index))
306
if (snapshotIndexes.TryGetValue(snapshot.
Name
, out var index))
317
snapshotIndexes.Add(snapshot.
Name
, currentSnapshots.Count);
366
var 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)
240
if (matchingNames is not null && !matchingNames.Contains(snapshot.
Name
))
278
var snapshot = snapshots.FirstOrDefault(s => string.Equals(s.
Name
, name, StringComparisons.ResourceName));
Commands\LogsCommand.cs (1)
500
var snapshot = snapshots.FirstOrDefault(s => string.Equals(s.
Name
, resourceName, StringComparisons.ResourceName));
Commands\McpToolsCommand.cs (2)
77
var resourceName = r.DisplayName ?? r.
Name
;
103
var resourceName = resource.DisplayName ?? resource.
Name
;
Commands\TerminalAttachCommand.cs (1)
128
: matches[0].
Name
;
Mcp\McpResourceToolRefreshService.cs (1)
102
var routedResourceName = resource.DisplayName ?? resource.
Name
;
Mcp\Tools\McpToolHelpers.cs (1)
220
excludedNames.Add(snapshot.
Name
);
Aspire.Cli.Tests (13)
Backchannel\AppHostAuxiliaryBackchannelTests.cs (2)
27
Assert.Equal("api", snapshot.
Name
);
46
Assert.Equal("api", resource.
Name
);
Backchannel\ResourceSnapshotMapperTests.cs (3)
410
Assert.Equal("cache-zuyppzgw", result[0].
Name
);
425
Assert.Equal("cache-zuyppzgw", result[0].
Name
);
456
Assert.Equal("cache-abc12345", result[0].
Name
);
Backchannel\ResourceSnapshotWatcherTests.cs (3)
434
.Select(update => new { update.
Name
, update.DisplayName, update.State })
517
snapshot.
Name
,
532
Assert.Same(firstSnapshot, watcher.GetResource(firstSnapshot.
Name
));
Commands\DescribeCommandTests.cs (5)
340
Name = initialSnapshots[0].
Name
,
347
Name = initialSnapshots[^1].
Name
,
392
var expectedStates = changedSnapshots.Any(changed => StringComparers.ResourceName.Equals(changed.
Name
, snapshot.
Name
))
395
Assert.Equal(expectedStates, resourcesByName[snapshot.
Name
]);