34 references to AppHostPresentation
Aspire.Tray.Tests (34)
AppHostPresentationTests.cs (29)
20
Assert.Equal($"{Path} \u00b7 {subtitle}",
AppHostPresentation
.GetMenuDetailsText(Path, subtitle));
27
AppHostPresentation
.GetMenuDetailsText("C:\\src\\A&B\tShop\\AppHost.cs", "Stop failed.\r\nTry again.\u2028More details."));
39
var full =
AppHostPresentation
.GetMenuDetailsText(path, "Stopped");
41
var label =
AppHostPresentation
.GetMenuDetailsLabel(full);
55
var full =
AppHostPresentation
.GetMenuDetailsText(path, "Stopped");
58
var label =
AppHostPresentation
.GetMenuDetailsLabel(full);
76
var label =
AppHostPresentation
.GetPathLabel(path);
92
var label =
AppHostPresentation
.GetPathLabel(path);
103
=> Assert.Equal(expected,
AppHostPresentation
.GetPathLabel(path));
125
Assert.Equal("Shop",
AppHostPresentation
.GetCompactMenuLabel(host));
143
var label =
AppHostPresentation
.GetCompactMenuLabel(host);
154
Assert.Equal("worktree-a",
AppHostPresentation
.GetTitle(host));
155
Assert.Equal($"{Path.Combine("worktree-a", "apphost")} \u00b7 PID 42",
AppHostPresentation
.GetSubtitle(host));
156
Assert.Equal($"apphost - {Path.Combine("worktree-a", "apphost")} (PID 42)",
AppHostPresentation
.GetLabel(host));
157
Assert.Equal(Path.GetFullPath("worktree-a/apphost"),
AppHostPresentation
.GetDirectory(host));
172
Assert.Equal(expected,
AppHostPresentation
.GetDisplayName(host));
173
Assert.Equal(expected,
AppHostPresentation
.GetTitle(host));
182
Assert.Equal("Shop",
AppHostPresentation
.GetTitle(first));
183
Assert.Equal("Shop",
AppHostPresentation
.GetTitle(second));
184
Assert.Equal($"{Path.Combine("worktree-a", "Shop.AppHost")} \u00b7 PID 42",
AppHostPresentation
.GetSubtitle(first));
185
Assert.Equal($"{Path.Combine("worktree-b", "Shop.AppHost")} \u00b7 PID 43",
AppHostPresentation
.GetSubtitle(second));
202
Assert.Equal(name,
AppHostPresentation
.GetDisplayName(host));
203
Assert.Equal(expected,
AppHostPresentation
.GetTitle(host));
204
Assert.Equal(Math.Min(count, 44), StringInfo.ParseCombiningCharacters(
AppHostPresentation
.GetTitle(host)).Length);
217
Assert.Equal(expected,
AppHostPresentation
.GetDisplayName(host));
218
Assert.Equal(expected,
AppHostPresentation
.GetTitle(host));
219
Assert.Equal($"{location} \u00b7 PID 42",
AppHostPresentation
.GetSubtitle(host));
220
Assert.Equal($"{expected} - {location} (PID 42)",
AppHostPresentation
.GetLabel(host));
222
Assert.Equal(Path.GetDirectoryName(path),
AppHostPresentation
.GetDirectory(host));
src\Aspire.Tray\Common\TrayController.cs (5)
600
: stopped ? "Stopped; waiting for discovery." :
AppHostPresentation
.GetSubtitle(host));
601
return new AppHostMenuItem(host.Id,
AppHostPresentation
.GetTitle(host), subtitle,
602
AppHostPresentation
.GetDisplayName(host),
659
return new(host.Id,
AppHostPresentation
.GetTitle(host), subtitle,
AppHostPresentation
.GetDisplayName(host),