21 instantiations of AppHostInfo
Aspire.Tray.Tests (21)
AppHostIdTests.cs (1)
12var host = new AppHostInfo(path, 42, null) { ProcessStartTimeUnixMilliseconds = 1000 };
AppHostPresentationTests.cs (8)
152var host = new AppHostInfo(Path.GetFullPath("worktree-a/apphost/apphost.cs"), 42, null); 170var host = new AppHostInfo(Path.GetFullPath(path), 42, null); 179var first = new AppHostInfo(Path.GetFullPath("worktree-a/Shop.AppHost/Shop.AppHost.csproj"), 42, null); 180var second = new AppHostInfo(Path.GetFullPath("worktree-b/Shop.AppHost/Shop.AppHost.csproj"), 43, null); 197var host = new AppHostInfo(Path.GetFullPath($"{name}/apphost.cs"), 42, null); 214var host = new AppHostInfo(path, 42, null); 233Assert.Null(new AppHostInfo(Path.GetFullPath("apphost.cs"), 42, url).DashboardUri); 240Assert.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(
src\Aspire.Tray\Common\CliProtocol.cs (1)
46var host = new AppHostInfo(item.AppHostPath, item.AppHostPid, item.DashboardUrl)
src\Aspire.Tray\Common\TrayController.cs (1)
653var 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); 148Assert.Equal(new AppHostInfo(path, 0, null).Id, Assert.Single(controller.State.RecentAppHosts).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 (1)
213private static string IdentityPath(string path) => new AppHostInfo(path, 0, null).Id.AppHostPath;
TrayControllerSavedStateTests.cs (2)
191Assert.Equal(new AppHostInfo(pinned, 0, null).Id, row.Id); 590private static string IdentityPath(string path) => new AppHostInfo(path, 0, null).Id.AppHostPath;
61 references to AppHostInfo
Aspire.Tray.Tests (61)
AppHostIdTests.cs (1)
12var host = new AppHostInfo(path, 42, null) { ProcessStartTimeUnixMilliseconds = 1000 };
AppHostPresentationTests.cs (6)
152var host = new AppHostInfo(Path.GetFullPath("worktree-a/apphost/apphost.cs"), 42, null); 170var host = new AppHostInfo(Path.GetFullPath(path), 42, null); 179var first = new AppHostInfo(Path.GetFullPath("worktree-a/Shop.AppHost/Shop.AppHost.csproj"), 42, null); 180var second = new AppHostInfo(Path.GetFullPath("worktree-b/Shop.AppHost/Shop.AppHost.csproj"), 43, null); 197var host = new AppHostInfo(Path.GetFullPath($"{name}/apphost.cs"), 42, null); 214var 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(
src\Aspire.Tray\Common\AppHostPresentation.cs (6)
10public static string GetDisplayName(AppHostInfo host) 29public static string GetTitle(AppHostInfo host) => Compact(GetDisplayName(host), 44); 40public static string GetSubtitle(AppHostInfo host) => $"{Compact(GetLocation(host), 44)} \u00b7 PID {host.AppHostPid}"; 42public static string GetLabel(AppHostInfo host) 45public static string GetDirectory(AppHostInfo host) => Path.GetDirectoryName(host.AppHostPath) ?? host.AppHostPath; 47private static string GetLocation(AppHostInfo host)
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)
111public AppHostInfo RequireLiveInstance(AppHostId id) 139var host = RequireLiveInstanceLocked(id); 282private AppHostInfo RequireLiveInstanceLocked(AppHostId id) 351foreach (var host in snapshot.AppHosts) 653var host = new AppHostInfo(saved.AppHostPath, 0, null);
TrayControllerPinPruningTests.cs (2)
87var host = Host(42) with { AppHostPath = path, Health = AppHostHealth.Healthy }; 179var host = Host(42) with { AppHostPath = path };
TrayControllerPreferencesTests.cs (1)
196var host = Host(42) with { AppHostPath = path };
TrayControllerSavedStateTests.cs (14)
84var running = Host(42) with { AppHostPath = path }; 218var first = Host(42) with { AppHostPath = path, Health = AppHostHealth.Healthy }; 251var replacement = Host(43, 2000) with { AppHostPath = path, Health = AppHostHealth.Warning }; 274var first = Host(42) with { AppHostPath = path }; 275var second = Host(43) with { AppHostPath = path }; 300var host = Host(42) with { AppHostPath = path }; 319var replacement = Host(42, 2000) with { AppHostPath = path }; 338foreach (var host in hosts) 377var running = Host(42) with { AppHostPath = path, Health = AppHostHealth.Unhealthy }; 418var running = Host(42) with { AppHostPath = first }; 458var host = Host(42) with { AppHostPath = path, Health = AppHostHealth.Unknown }; 512var host = Host(42); 531var host = Host(42); 557var replacement = Host(42, 2000);
TrayControllerTests.cs (12)
35var first = Host(42); 36var second = Host(43); 73var first = Host(42); 74var second = Host(43); 79var updated = first with { DashboardUrl = "https://localhost:5678/" }; 85var replacement = Host(42, 2000); 102var known = Host(42); 103var unknown = Host(43) with { ProcessStartTimeUnixMilliseconds = null }; 132var first = Host(42); 133var second = Host(43); 159var first = Host(42); 160var second = Host(43);