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