88 references to Id
Aspire.Tray.Tests (88)
AppHostIdTests.cs (3)
14
Assert.Equal(path, host.
Id
.AppHostPath);
15
Assert.Equal(42, host.
Id
.AppHostPid);
16
Assert.Equal(1000, host.
Id
.ProcessStartTimeUnixMilliseconds);
CliAppHostCommandsTests.cs (1)
19
var startInfo = CliAppHostCommands.CreateStopStartInfo(Path.GetFullPath("aspire"), host.
Id
);
CliProtocolTests.cs (9)
35
Assert.Equal(original.
Id
, updated.
Id
);
36
Assert.NotEqual(original.
Id
, replacement.
Id
);
51
Assert.Equal(original.
Id
, updated.
Id
);
73
Assert.Equal(OperatingSystem.IsWindows(), host.
Id
== otherCase.
Id
);
136
Assert.Null(host.
Id
.ProcessStartTimeUnixMilliseconds);
Helpers\TrayPanelSamples.cs (1)
24
return new(info.
Id
, AppHostPresentation.GetTitle(info), error ?? subtitle, AppHostPresentation.GetDisplayName(info),
src\Aspire.Tray\Common\TrayController.cs (7)
273
return _snapshot.AppHosts.SingleOrDefault(host => host.
Id
== id)
323
var arrivingPaths = snapshot.AppHosts.Where(host => !_lastLiveIds.Contains(host.
Id
))
326
_lastLiveIds = snapshot.AppHosts.Select(host => host.
Id
).ToHashSet();
354
var liveIds = _snapshot.AppHosts.Select(host => host.
Id
).ToHashSet();
574
_stops.TryGetValue(host.
Id
, out var stop);
581
return new AppHostMenuItem(host.
Id
, AppHostPresentation.GetTitle(host), subtitle,
643
return new(host.
Id
, AppHostPresentation.GetTitle(host), subtitle, AppHostPresentation.GetDisplayName(host),
TrayControllerPinPruningTests.cs (8)
38
Assert.Equal(new AppHostInfo(retained, 0, null).
Id
, Assert.Single(controller.State.AppHosts).Id);
39
Assert.Equal(new AppHostInfo(recent, 0, null).
Id
, Assert.Single(controller.State.RecentAppHosts).Id);
91
Assert.Equal(host.
Id
, row.Id);
97
Assert.Equal(host.
Id
, Assert.Single(controller.State.AppHosts).Id);
147
Assert.Equal(new AppHostInfo(path, 0, null).
Id
, Assert.Single(controller.State.RecentAppHosts).Id);
180
Assert.Equal(host.
Id
, Assert.Single(controller.State.AppHosts).Id);
249
Assert.Single(controller.State.RecentAppHosts, host => host.Id == new AppHostInfo(restricted, 0, null).
Id
).Subtitle);
251
Assert.Single(controller.State.RecentAppHosts, host => host.Id == new AppHostInfo(deleted, 0, null).
Id
).Subtitle);
TrayControllerPreferencesTests.cs (2)
144
Assert.Equal(host.
Id
, Assert.Single(controller.State.AppHosts).Id);
159
private static string IdentityPath(string path) => new AppHostInfo(path, 0, null).
Id
.AppHostPath;
TrayControllerSavedStateTests.cs (27)
86
Assert.Equal(running.
Id
, row.Id);
187
Assert.Equal(new AppHostInfo(pinned, 0, null).
Id
, row.Id);
226
controller.RequestStop(first.
Id
);
228
client.CompleteStop(first.
Id
, new(StopOutcome.Stopped, 0));
249
Assert.Equal(replacement.
Id
, Assert.Single(controller.State.AppHosts).Id);
274
Assert.Equal([first.
Id
, second.
Id
], controller.State.AppHosts.Select(host => host.Id));
279
Assert.Equal(second.
Id
, Assert.Single(controller.State.AppHosts).Id);
283
Assert.Equal(first.
Id
.AppHostPath, Assert.Single(controller.State.RecentAppHosts).Id.AppHostPath);
319
Assert.Equal(host.
Id
.AppHostPath, Assert.Single(controller.State.RecentAppHosts).Id.AppHostPath);
338
Assert.Equal(hosts[^1].
Id
, Assert.Single(controller.State.AppHosts).Id);
339
Assert.Equal(hosts.Skip(15).SkipLast(1).Reverse().Select(host => host.
Id
.AppHostPath),
343
Assert.Equal([hosts[^1].
Id
.AppHostPath, hosts[10].
Id
.AppHostPath], controller.State.AppHosts.Select(host => host.Id.AppHostPath));
344
Assert.Equal(hosts.Skip(15).SkipLast(1).Reverse().Select(host => host.
Id
.AppHostPath),
348
Assert.Equal(hosts[10].
Id
.AppHostPath, Assert.Single(controller.State.AppHosts).Id.AppHostPath);
349
Assert.Equal(hosts.Skip(15).Reverse().Select(host => host.
Id
.AppHostPath),
380
Assert.Equal(running.DashboardUri, controller.GetDashboardUri(running.
Id
));
416
Assert.Equal(running.
Id
, Assert.Single(controller.State.AppHosts).Id);
460
Assert.Equal(host.
Id
, row.Id);
510
Assert.Equal(host.
Id
, Assert.Single(controller.State.AppHosts).Id);
529
controller.GetDashboardUri(host.
Id
);
531
controller.RequestStop(host.
Id
);
533
client.CompleteStop(host.
Id
, new(StopOutcome.Failed, 7));
537
controller.RequestStop(host.
Id
);
539
client.CompleteStop(host.
Id
, new(StopOutcome.Stopped, 0));
573
private static string IdentityPath(string path) => new AppHostInfo(path, 0, null).
Id
.AppHostPath;
TrayControllerTests.cs (30)
60
controller.RequestStop(first.
Id
);
61
Assert.Equal(first.
Id
, await client.NextStopAsync());
65
Assert.Throws<InvalidOperationException>(() => controller.RequestStop(first.
Id
));
67
controller.RequestStop(second.
Id
);
68
Assert.Equal(second.
Id
, await client.NextStopAsync());
72
client.CompleteStop(second.
Id
, new(StopOutcome.Stopped, 0));
78
client.CompleteStop(first.
Id
, new(StopOutcome.Stopped, 0));
80
Assert.Throws<InvalidOperationException>(() => controller.GetDashboardUri(first.
Id
));
83
Assert.Equal([first.
Id
, second.
Id
], client.Requests.ToArray());
100
await WaitForStateAsync(controller, state => state.AppHosts[0].Id == second.
Id
);
101
Assert.Same(updated, controller.RequireLiveInstance(first.
Id
));
102
Assert.Equal("https://localhost:5678/", controller.GetDashboardUri(first.
Id
).AbsoluteUri);
106
await WaitForStateAsync(controller, state => state.AppHosts[0].Id == replacement.
Id
);
107
Assert.Throws<InvalidOperationException>(() => controller.RequestStop(first.
Id
));
108
Assert.Throws<InvalidOperationException>(() => controller.GetDashboardUri(first.
Id
));
111
controller.RequestStop(replacement.
Id
);
112
Assert.Equal(replacement.
Id
, await client.NextStopAsync());
129
Assert.Equal(unknown.DashboardUri, controller.GetDashboardUri(unknown.
Id
));
131
Assert.Throws<InvalidOperationException>(() => controller.RequestStop(unknown.
Id
));
140
Assert.Throws<InvalidOperationException>(() => controller.RequestStop(known.
Id
));
141
Assert.Throws<InvalidOperationException>(() => controller.GetDashboardUri(known.
Id
));
156
controller.RequestStop(first.
Id
);
158
client.CompleteStop(first.
Id
, new(StopOutcome.TimedOut, null));
163
Assert.Equal(first.DashboardUri, controller.GetDashboardUri(first.
Id
));
167
controller.RequestStop(first.
Id
);
168
Assert.Equal(first.
Id
, await client.NextStopAsync());
185
controller.RequestStop(first.
Id
);
186
controller.RequestStop(second.
Id
);
194
Assert.Throws<ObjectDisposedException>(() => controller.RequestStop(first.
Id
));