87 references to Id
Aspire.Tray.Tests (87)
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);
src\Aspire.Tray\Common\TrayController.cs (7)
293return _snapshot.AppHosts.SingleOrDefault(host => host.Id == id) 343var arrivingPaths = snapshot.AppHosts.Where(host => !_lastLiveIds.Contains(host.Id)) 346_lastLiveIds = snapshot.AppHosts.Select(host => host.Id).ToHashSet(); 374var liveIds = _snapshot.AppHosts.Select(host => host.Id).ToHashSet(); 594_stops.TryGetValue(host.Id, out var stop); 601return new AppHostMenuItem(host.Id, AppHostPresentation.GetTitle(host), subtitle, 659return 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); 92Assert.Equal(host.Id, row.Id); 98Assert.Equal(host.Id, Assert.Single(controller.State.AppHosts).Id); 148Assert.Equal(new AppHostInfo(path, 0, null).Id, Assert.Single(controller.State.RecentAppHosts).Id); 181Assert.Equal(host.Id, Assert.Single(controller.State.AppHosts).Id); 252Assert.Single(controller.State.RecentAppHosts, host => host.Id == new AppHostInfo(restricted, 0, null).Id).Subtitle); 254Assert.Single(controller.State.RecentAppHosts, host => host.Id == new AppHostInfo(deleted, 0, null).Id).Subtitle);
TrayControllerPreferencesTests.cs (2)
198Assert.Equal(host.Id, Assert.Single(controller.State.AppHosts).Id); 213private static string IdentityPath(string path) => new AppHostInfo(path, 0, null).Id.AppHostPath;
TrayControllerSavedStateTests.cs (27)
87Assert.Equal(running.Id, row.Id); 191Assert.Equal(new AppHostInfo(pinned, 0, null).Id, row.Id); 230controller.RequestStop(first.Id); 232client.CompleteStop(first.Id, new(StopOutcome.Stopped, 0)); 253Assert.Equal(replacement.Id, Assert.Single(controller.State.AppHosts).Id); 278Assert.Equal([first.Id, second.Id], controller.State.AppHosts.Select(host => host.Id)); 283Assert.Equal(second.Id, Assert.Single(controller.State.AppHosts).Id); 287Assert.Equal(first.Id.AppHostPath, Assert.Single(controller.State.RecentAppHosts).Id.AppHostPath); 323Assert.Equal(host.Id.AppHostPath, Assert.Single(controller.State.RecentAppHosts).Id.AppHostPath); 342Assert.Equal(hosts[^1].Id, Assert.Single(controller.State.AppHosts).Id); 343Assert.Equal(hosts.Skip(15).SkipLast(1).Reverse().Select(host => host.Id.AppHostPath), 347Assert.Equal([hosts[^1].Id.AppHostPath, hosts[10].Id.AppHostPath], controller.State.AppHosts.Select(host => host.Id.AppHostPath)); 348Assert.Equal(hosts.Skip(15).SkipLast(1).Reverse().Select(host => host.Id.AppHostPath), 352Assert.Equal(hosts[10].Id.AppHostPath, Assert.Single(controller.State.AppHosts).Id.AppHostPath); 353Assert.Equal(hosts.Skip(15).Reverse().Select(host => host.Id.AppHostPath), 384Assert.Equal(running.DashboardUri, controller.GetDashboardUri(running.Id)); 420Assert.Equal(running.Id, Assert.Single(controller.State.AppHosts).Id); 464Assert.Equal(host.Id, row.Id); 515Assert.Equal(host.Id, Assert.Single(controller.State.AppHosts).Id); 538controller.GetDashboardUri(host.Id); 541controller.RequestStop(host.Id); 544client.CompleteStop(host.Id, new(StopOutcome.Failed, 7)); 549controller.RequestStop(host.Id); 552client.CompleteStop(host.Id, new(StopOutcome.Stopped, 0)); 590private static string IdentityPath(string path) => new AppHostInfo(path, 0, null).Id.AppHostPath;
TrayControllerTests.cs (30)
41controller.RequestStop(first.Id); 42Assert.Equal(first.Id, await client.NextStopAsync()); 46Assert.Throws<InvalidOperationException>(() => controller.RequestStop(first.Id)); 48controller.RequestStop(second.Id); 49Assert.Equal(second.Id, await client.NextStopAsync()); 53client.CompleteStop(second.Id, new(StopOutcome.Stopped, 0)); 59client.CompleteStop(first.Id, new(StopOutcome.Stopped, 0)); 61Assert.Throws<InvalidOperationException>(() => controller.GetDashboardUri(first.Id)); 64Assert.Equal([first.Id, second.Id], client.Requests.ToArray()); 81await WaitForStateAsync(controller, state => state.AppHosts[0].Id == second.Id); 82Assert.Same(updated, controller.RequireLiveInstance(first.Id)); 83Assert.Equal("https://localhost:5678/", controller.GetDashboardUri(first.Id).AbsoluteUri); 87await WaitForStateAsync(controller, state => state.AppHosts[0].Id == replacement.Id); 88Assert.Throws<InvalidOperationException>(() => controller.RequestStop(first.Id)); 89Assert.Throws<InvalidOperationException>(() => controller.GetDashboardUri(first.Id)); 92controller.RequestStop(replacement.Id); 93Assert.Equal(replacement.Id, await client.NextStopAsync()); 110Assert.Equal(unknown.DashboardUri, controller.GetDashboardUri(unknown.Id)); 112Assert.Throws<InvalidOperationException>(() => controller.RequestStop(unknown.Id)); 121Assert.Throws<InvalidOperationException>(() => controller.RequestStop(known.Id)); 122Assert.Throws<InvalidOperationException>(() => controller.GetDashboardUri(known.Id)); 137controller.RequestStop(first.Id); 139client.CompleteStop(first.Id, new(StopOutcome.TimedOut, null)); 144Assert.Equal(first.DashboardUri, controller.GetDashboardUri(first.Id)); 148controller.RequestStop(first.Id); 149Assert.Equal(first.Id, await client.NextStopAsync()); 166controller.RequestStop(first.Id); 167controller.RequestStop(second.Id); 175Assert.Throws<ObjectDisposedException>(() => controller.RequestStop(first.Id));