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