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