27 instantiations of SavedAppHost
Aspire.Tray.Tests (27)
src\Aspire.Tray\Common\TraySavedState.cs (2)
39AppHosts = [new(appHostPath, existing?.IsPinned ?? false, true), 49return pinned ? this with { AppHosts = [.. AppHosts, new(appHostPath, true, false)] } : this;
TrayControllerPinPruningTests.cs (7)
43Assert.Equal([new SavedAppHost(recent, false, true), new SavedAppHost(retained, true, true)], reloaded.AppHosts); 65Assert.Equal([new SavedAppHost(path, true, true)], new FileTraySavedStateStore(directory.StatePath).Load().AppHosts); 96Assert.Equal([new SavedAppHost(path, true, true)], new FileTraySavedStateStore(directory.StatePath).Load().AppHosts); 149Assert.Equal([new SavedAppHost(path, false, true)], new FileTraySavedStateStore(directory.StatePath).Load().AppHosts); 173Assert.Equal([new SavedAppHost(path, true, true)], store.Load().AppHosts); 217Assert.Equal([new SavedAppHost(path, true, true)], new FileTraySavedStateStore(directory.StatePath).Load().AppHosts);
TrayControllerPreferencesTests.cs (3)
77var saved = new TraySavedState(paths.Select(path => new SavedAppHost(path, true, true)).ToArray()) { ConfirmStop = false }; 96.Select(index => new SavedAppHost(Path.GetFullPath($"project-{index}/apphost.cs"), index == 19, true)).ToArray()); 116var saved = new TraySavedState(paths.Select(path => new SavedAppHost(path, false, true)).ToArray()) { ConfirmStop = false };
TrayControllerSavedStateTests.cs (1)
307Assert.Equal([new SavedAppHost(host.AppHostPath, true, false)], store.Load().AppHosts);
TraySavedStateTests.cs (13)
51Assert.Equal(new SavedAppHost(paths[0], true, false), saved.AppHosts.Single(host => host.IsPinned)); 76Assert.Equal(new SavedAppHost(paths[0], true, false), Assert.Single(state.AppHosts, host => host.IsPinned)); 129var state = new TraySavedState(paths.Select(path => new SavedAppHost(path, false, true)).ToArray()); 140.Select(index => new SavedAppHost(Path.GetFullPath($"project-{index}/apphost.cs"), false, true)).ToArray()); 158? [new(differentlyCased, true, true)] 159: [new(differentlyCased, false, true), new(original, true, true)]; 176Assert.Equal([new SavedAppHost(missing, true, false)], saved.ClearRecent().AppHosts); 177Assert.Equal([new SavedAppHost(recent, false, true), new SavedAppHost(missing, true, false)], 182Assert.Equal([new SavedAppHost(missing, true, false)], new FileTraySavedStateStore(directory.StatePath).Load().AppHosts); 196Assert.Equal([new SavedAppHost(retained, true, true), new SavedAppHost(recent, false, true)],
TrayUserPreferencesTests.cs (1)
27var saved = new TraySavedState([new(host, true, true)]) { ConfirmStop = false };
9 references to SavedAppHost
Aspire.Tray.Tests (9)
src\Aspire.Tray\Common\FileTraySavedStateStore.cs (1)
173foreach (var host in state.AppHosts)
src\Aspire.Tray\Common\TrayController.cs (3)
520foreach (var host in _savedState.AppHosts.Where(host => host.IsPinned && !protectedPaths.Contains(host.AppHostPath))) 614foreach (var saved in _savedState.AppHosts.Where(host => host.IsPinned && !listedPaths.Contains(host.AppHostPath))) 651private AppHostMenuItem CreateSavedMenuItem(SavedAppHost saved, bool live)
src\Aspire.Tray\Common\TraySavedState.cs (4)
11internal sealed record TraySavedState(IReadOnlyList<SavedAppHost> AppHosts) 22public TraySavedState(IReadOnlyList<SavedAppHost> appHosts, bool confirmStop = true) : this(appHosts) 36var existing = AppHosts.SingleOrDefault(host => TrayAppHostPath.Comparer.Equals(host.AppHostPath, appHostPath)); 46var existing = AppHosts.SingleOrDefault(host => TrayAppHostPath.Comparer.Equals(host.AppHostPath, appHostPath));
TraySavedStateTests.cs (1)
157SavedAppHost[] expected = OperatingSystem.IsWindows()