23 instantiations of AppHostInfo
Aspire.Tray.Tests (23)
AppHostIdTests.cs (1)
12var host = new AppHostInfo(path, 42, null) { ProcessStartTimeUnixMilliseconds = 1000 };
AppHostPresentationTests.cs (8)
13var host = new AppHostInfo(Path.GetFullPath("worktree-a/apphost/apphost.cs"), 42, null); 31var host = new AppHostInfo(Path.GetFullPath(path), 42, null); 40var first = new AppHostInfo(Path.GetFullPath("worktree-a/Shop.AppHost/Shop.AppHost.csproj"), 42, null); 41var second = new AppHostInfo(Path.GetFullPath("worktree-b/Shop.AppHost/Shop.AppHost.csproj"), 43, null); 58var host = new AppHostInfo(Path.GetFullPath($"{name}/apphost.cs"), 42, null); 75var host = new AppHostInfo(path, 42, null); 94Assert.Null(new AppHostInfo(Path.GetFullPath("apphost.cs"), 42, url).DashboardUri); 101Assert.Equal(Url, new AppHostInfo(Path.GetFullPath("apphost.cs"), 42, Url).DashboardUri?.AbsoluteUri);
CliAppHostCommandsTests.cs (1)
17var host = new AppHostInfo(path, 42, null) { ProcessStartTimeUnixMilliseconds = 1000 };
Helpers\TestAppHostClient.cs (1)
111public static AppHostInfo Host(int pid, long startedAt = 1000) => new(
Helpers\TrayPanelSamples.cs (2)
13var info = new AppHostInfo(path, pid, dashboard ? "https://localhost:17000" : null); 23var info = new AppHostInfo(path, 0, null);
src\Aspire.Tray\Common\CliProtocol.cs (1)
46var host = new AppHostInfo(item.AppHostPath, item.AppHostPid, item.DashboardUrl)
src\Aspire.Tray\Common\TrayController.cs (1)
637var host = new AppHostInfo(saved.AppHostPath, 0, null);
TrayControllerPinPruningTests.cs (5)
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); 147Assert.Equal(new AppHostInfo(path, 0, null).Id, Assert.Single(controller.State.RecentAppHosts).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 (1)
159private static string IdentityPath(string path) => new AppHostInfo(path, 0, null).Id.AppHostPath;
TrayControllerSavedStateTests.cs (2)
187Assert.Equal(new AppHostInfo(pinned, 0, null).Id, row.Id); 573private static string IdentityPath(string path) => new AppHostInfo(path, 0, null).Id.AppHostPath;
63 references to AppHostInfo
Aspire.Tray.Tests (63)
AppHostIdTests.cs (1)
12var host = new AppHostInfo(path, 42, null) { ProcessStartTimeUnixMilliseconds = 1000 };
AppHostPresentationTests.cs (6)
13var host = new AppHostInfo(Path.GetFullPath("worktree-a/apphost/apphost.cs"), 42, null); 31var host = new AppHostInfo(Path.GetFullPath(path), 42, null); 40var first = new AppHostInfo(Path.GetFullPath("worktree-a/Shop.AppHost/Shop.AppHost.csproj"), 42, null); 41var second = new AppHostInfo(Path.GetFullPath("worktree-b/Shop.AppHost/Shop.AppHost.csproj"), 43, null); 58var host = new AppHostInfo(Path.GetFullPath($"{name}/apphost.cs"), 42, null); 75var host = new AppHostInfo(path, 42, null);
CliAppHostCommandsTests.cs (1)
17var host = new AppHostInfo(path, 42, null) { ProcessStartTimeUnixMilliseconds = 1000 };
CliProtocolTests.cs (9)
32var original = Parse(Snapshot(Host(42))).AppHosts[0]; 33var updated = original with { DashboardUrl = "https://localhost:5678/" }; 34var replacement = original with { ProcessStartTimeUnixMilliseconds = 2000 }; 47var original = Assert.Single(Parse(Snapshot(Host(42))).AppHosts); 48var updated = Assert.Single(Parse(Snapshot(Host(42) with { Health = health })).AppHosts); 60var host = Assert.Single(Parse( 71var host = Parse(Snapshot(Host(42))).AppHosts[0]; 72var otherCase = host with { AppHostPath = host.AppHostPath.ToUpperInvariant() }; 135var host = Assert.Single(Parse(Snapshot(Host(42) with { ProcessStartTimeUnixMilliseconds = null })).AppHosts);
Helpers\TestAppHostClient.cs (1)
111public static AppHostInfo Host(int pid, long startedAt = 1000) => new(
Helpers\TrayPanelSamples.cs (2)
13var info = new AppHostInfo(path, pid, dashboard ? "https://localhost:17000" : null); 23var info = new AppHostInfo(path, 0, null);
src\Aspire.Tray\Common\AppHostPresentation.cs (6)
10public static string GetDisplayName(AppHostInfo host) 29public static string GetTitle(AppHostInfo host) => Compact(GetDisplayName(host), 44); 31public static string GetSubtitle(AppHostInfo host) => $"{Compact(GetLocation(host), 44)} \u00b7 PID {host.AppHostPid}"; 33public static string GetLabel(AppHostInfo host) 36public static string GetDirectory(AppHostInfo host) => Path.GetDirectoryName(host.AppHostPath) ?? host.AppHostPath; 38private static string GetLocation(AppHostInfo host) => GetLocation(host.AppHostPath);
src\Aspire.Tray\Common\CliProtocol.cs (2)
37var hosts = new List<AppHostInfo>(message.AppHosts.Count); 46var host = new AppHostInfo(item.AppHostPath, item.AppHostPid, item.DashboardUrl)
src\Aspire.Tray\Common\IAppHostClient.cs (1)
41internal sealed record AppHostSnapshot(IReadOnlyList<AppHostInfo> AppHosts, DiscoveryState Discovery);
src\Aspire.Tray\Common\TrayController.cs (5)
91public AppHostInfo RequireLiveInstance(AppHostId id) 119var host = RequireLiveInstanceLocked(id); 262private AppHostInfo RequireLiveInstanceLocked(AppHostId id) 331foreach (var host in snapshot.AppHosts) 637var host = new AppHostInfo(saved.AppHostPath, 0, null);
TrayControllerPinPruningTests.cs (2)
86var host = Host(42) with { AppHostPath = path, Health = AppHostHealth.Healthy }; 178var host = Host(42) with { AppHostPath = path };
TrayControllerPreferencesTests.cs (1)
142var host = Host(42) with { AppHostPath = path };
TrayControllerSavedStateTests.cs (14)
83var running = Host(42) with { AppHostPath = path }; 214var first = Host(42) with { AppHostPath = path, Health = AppHostHealth.Healthy }; 247var replacement = Host(43, 2000) with { AppHostPath = path, Health = AppHostHealth.Warning }; 270var first = Host(42) with { AppHostPath = path }; 271var second = Host(43) with { AppHostPath = path }; 296var host = Host(42) with { AppHostPath = path }; 315var replacement = Host(42, 2000) with { AppHostPath = path }; 334foreach (var host in hosts) 373var running = Host(42) with { AppHostPath = path, Health = AppHostHealth.Unhealthy }; 414var running = Host(42) with { AppHostPath = first }; 454var host = Host(42) with { AppHostPath = path, Health = AppHostHealth.Unknown }; 507var host = Host(42); 524var host = Host(42); 543var replacement = Host(42, 2000);
TrayControllerTests.cs (12)
54var first = Host(42); 55var second = Host(43); 92var first = Host(42); 93var second = Host(43); 98var updated = first with { DashboardUrl = "https://localhost:5678/" }; 104var replacement = Host(42, 2000); 121var known = Host(42); 122var unknown = Host(43) with { ProcessStartTimeUnixMilliseconds = null }; 151var first = Host(42); 152var second = Host(43); 178var first = Host(42); 179var second = Host(43);