21 instantiations of AppHostInfo
Aspire.Tray.Tests (21)
AppHostIdTests.cs (1)
12
var host = new
AppHostInfo
(path, 42, null) { ProcessStartTimeUnixMilliseconds = 1000 };
AppHostPresentationTests.cs (8)
152
var host = new
AppHostInfo
(Path.GetFullPath("worktree-a/apphost/apphost.cs"), 42, null);
170
var host = new
AppHostInfo
(Path.GetFullPath(path), 42, null);
179
var first = new
AppHostInfo
(Path.GetFullPath("worktree-a/Shop.AppHost/Shop.AppHost.csproj"), 42, null);
180
var second = new
AppHostInfo
(Path.GetFullPath("worktree-b/Shop.AppHost/Shop.AppHost.csproj"), 43, null);
197
var host = new
AppHostInfo
(Path.GetFullPath($"{name}/apphost.cs"), 42, null);
214
var host = new
AppHostInfo
(path, 42, null);
233
Assert.Null(new
AppHostInfo
(Path.GetFullPath("apphost.cs"), 42, url).DashboardUri);
240
Assert.Equal(Url, new
AppHostInfo
(Path.GetFullPath("apphost.cs"), 42, Url).DashboardUri?.AbsoluteUri);
CliAppHostCommandsTests.cs (1)
17
var host = new
AppHostInfo
(path, 42, null) { ProcessStartTimeUnixMilliseconds = 1000 };
Helpers\TestAppHostClient.cs (1)
111
public static AppHostInfo Host(int pid, long startedAt = 1000) =>
new
(
src\Aspire.Tray\Common\CliProtocol.cs (1)
46
var host = new
AppHostInfo
(item.AppHostPath, item.AppHostPid, item.DashboardUrl)
src\Aspire.Tray\Common\TrayController.cs (1)
653
var host = new
AppHostInfo
(saved.AppHostPath, 0, null);
TrayControllerPinPruningTests.cs (5)
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);
148
Assert.Equal(new
AppHostInfo
(path, 0, null).Id, Assert.Single(controller.State.RecentAppHosts).Id);
252
Assert.Single(controller.State.RecentAppHosts, host => host.Id == new
AppHostInfo
(restricted, 0, null).Id).Subtitle);
254
Assert.Single(controller.State.RecentAppHosts, host => host.Id == new
AppHostInfo
(deleted, 0, null).Id).Subtitle);
TrayControllerPreferencesTests.cs (1)
213
private static string IdentityPath(string path) => new
AppHostInfo
(path, 0, null).Id.AppHostPath;
TrayControllerSavedStateTests.cs (2)
191
Assert.Equal(new
AppHostInfo
(pinned, 0, null).Id, row.Id);
590
private static string IdentityPath(string path) => new
AppHostInfo
(path, 0, null).Id.AppHostPath;
61 references to AppHostInfo
Aspire.Tray.Tests (61)
AppHostIdTests.cs (1)
12
var
host = new AppHostInfo(path, 42, null) { ProcessStartTimeUnixMilliseconds = 1000 };
AppHostPresentationTests.cs (6)
152
var
host = new AppHostInfo(Path.GetFullPath("worktree-a/apphost/apphost.cs"), 42, null);
170
var
host = new AppHostInfo(Path.GetFullPath(path), 42, null);
179
var
first = new AppHostInfo(Path.GetFullPath("worktree-a/Shop.AppHost/Shop.AppHost.csproj"), 42, null);
180
var
second = new AppHostInfo(Path.GetFullPath("worktree-b/Shop.AppHost/Shop.AppHost.csproj"), 43, null);
197
var
host = new AppHostInfo(Path.GetFullPath($"{name}/apphost.cs"), 42, null);
214
var
host = new AppHostInfo(path, 42, null);
CliAppHostCommandsTests.cs (1)
17
var
host = new AppHostInfo(path, 42, null) { ProcessStartTimeUnixMilliseconds = 1000 };
CliProtocolTests.cs (9)
32
var
original = Parse(Snapshot(Host(42))).AppHosts[0];
33
var
updated = original with { DashboardUrl = "https://localhost:5678/" };
34
var
replacement = original with { ProcessStartTimeUnixMilliseconds = 2000 };
47
var
original = Assert.Single(Parse(Snapshot(Host(42))).AppHosts);
48
var
updated = Assert.Single(Parse(Snapshot(Host(42) with { Health = health })).AppHosts);
60
var
host = Assert.Single(Parse(
71
var
host = Parse(Snapshot(Host(42))).AppHosts[0];
72
var
otherCase = host with { AppHostPath = host.AppHostPath.ToUpperInvariant() };
135
var
host = Assert.Single(Parse(Snapshot(Host(42) with { ProcessStartTimeUnixMilliseconds = null })).AppHosts);
Helpers\TestAppHostClient.cs (1)
111
public static
AppHostInfo
Host(int pid, long startedAt = 1000) => new(
src\Aspire.Tray\Common\AppHostPresentation.cs (6)
10
public static string GetDisplayName(
AppHostInfo
host)
29
public static string GetTitle(
AppHostInfo
host) => Compact(GetDisplayName(host), 44);
40
public static string GetSubtitle(
AppHostInfo
host) => $"{Compact(GetLocation(host), 44)} \u00b7 PID {host.AppHostPid}";
42
public static string GetLabel(
AppHostInfo
host)
45
public static string GetDirectory(
AppHostInfo
host) => Path.GetDirectoryName(host.AppHostPath) ?? host.AppHostPath;
47
private static string GetLocation(
AppHostInfo
host)
src\Aspire.Tray\Common\CliProtocol.cs (2)
37
var hosts = new List<
AppHostInfo
>(message.AppHosts.Count);
46
var
host = new AppHostInfo(item.AppHostPath, item.AppHostPid, item.DashboardUrl)
src\Aspire.Tray\Common\IAppHostClient.cs (1)
41
internal sealed record AppHostSnapshot(IReadOnlyList<
AppHostInfo
> AppHosts, DiscoveryState Discovery);
src\Aspire.Tray\Common\TrayController.cs (5)
111
public
AppHostInfo
RequireLiveInstance(AppHostId id)
139
var
host = RequireLiveInstanceLocked(id);
282
private
AppHostInfo
RequireLiveInstanceLocked(AppHostId id)
351
foreach (
var
host in snapshot.AppHosts)
653
var
host = new AppHostInfo(saved.AppHostPath, 0, null);
TrayControllerPinPruningTests.cs (2)
87
var
host = Host(42) with { AppHostPath = path, Health = AppHostHealth.Healthy };
179
var
host = Host(42) with { AppHostPath = path };
TrayControllerPreferencesTests.cs (1)
196
var
host = Host(42) with { AppHostPath = path };
TrayControllerSavedStateTests.cs (14)
84
var
running = Host(42) with { AppHostPath = path };
218
var
first = Host(42) with { AppHostPath = path, Health = AppHostHealth.Healthy };
251
var
replacement = Host(43, 2000) with { AppHostPath = path, Health = AppHostHealth.Warning };
274
var
first = Host(42) with { AppHostPath = path };
275
var
second = Host(43) with { AppHostPath = path };
300
var
host = Host(42) with { AppHostPath = path };
319
var
replacement = Host(42, 2000) with { AppHostPath = path };
338
foreach (
var
host in hosts)
377
var
running = Host(42) with { AppHostPath = path, Health = AppHostHealth.Unhealthy };
418
var
running = Host(42) with { AppHostPath = first };
458
var
host = Host(42) with { AppHostPath = path, Health = AppHostHealth.Unknown };
512
var
host = Host(42);
531
var
host = Host(42);
557
var
replacement = Host(42, 2000);
TrayControllerTests.cs (12)
35
var
first = Host(42);
36
var
second = Host(43);
73
var
first = Host(42);
74
var
second = Host(43);
79
var
updated = first with { DashboardUrl = "https://localhost:5678/" };
85
var
replacement = Host(42, 2000);
102
var
known = Host(42);
103
var
unknown = Host(43) with { ProcessStartTimeUnixMilliseconds = null };
132
var
first = Host(42);
133
var
second = Host(43);
159
var
first = Host(42);
160
var
second = Host(43);