31 instantiations of SavedAppHost
Aspire.Tray.Tests (31)
src\Aspire.Tray\Common\TraySavedState.cs (2)
34AppHosts = [new(appHostPath, existing?.IsPinned ?? false, true), 44return pinned ? this with { AppHosts = [.. AppHosts, new(appHostPath, true, false)] } : this;
TrayControllerPinPruningTests.cs (7)
42Assert.Equal([new SavedAppHost(recent, false, true), new SavedAppHost(retained, true, true)], reloaded.AppHosts); 64Assert.Equal([new SavedAppHost(path, true, true)], new FileTraySavedStateStore(directory.StatePath).Load().AppHosts); 95Assert.Equal([new SavedAppHost(path, true, true)], new FileTraySavedStateStore(directory.StatePath).Load().AppHosts); 148Assert.Equal([new SavedAppHost(path, false, true)], new FileTraySavedStateStore(directory.StatePath).Load().AppHosts); 172Assert.Equal([new SavedAppHost(path, true, true)], store.Load().AppHosts); 215Assert.Equal([new SavedAppHost(path, true, true)], new FileTraySavedStateStore(directory.StatePath).Load().AppHosts);
TrayControllerPreferencesTests.cs (5)
27Assert.Equal(new SavedAppHost(TrayAppHostPath.Normalize(path), false, true), Assert.Single(new FileTraySavedStateStore(directory.StatePath).Load().AppHosts)); 39var saved = new TraySavedState(paths.Select(path => new SavedAppHost(path, true, true)).ToArray()); 56.Select(index => new SavedAppHost(Path.GetFullPath($"project-{index}/apphost.cs"), index == 19, true)).ToArray()); 71var saved = new TraySavedState(paths.Select(path => new SavedAppHost(path, false, true)).ToArray()); 81Assert.Equal([new SavedAppHost(paths[0], true, true)], store.Load().AppHosts);
TrayControllerSavedStateTests.cs (1)
303Assert.Equal([new SavedAppHost(host.AppHostPath, true, false)], store.Load().AppHosts);
TraySavedStateTests.cs (14)
51Assert.Equal(new SavedAppHost(paths[0], true, false), saved.AppHosts.Single(host => host.IsPinned)); 75Assert.Equal(new SavedAppHost(paths[0], true, false), Assert.Single(state.AppHosts, host => host.IsPinned)); 90Assert.Equal([new SavedAppHost(path, true, true)], loaded.AppHosts); 102var state = new TraySavedState(paths.Select(path => new SavedAppHost(path, false, true)).ToArray()); 113.Select(index => new SavedAppHost(Path.GetFullPath($"project-{index}/apphost.cs"), false, true)).ToArray()); 131? [new(differentlyCased, true, true)] 132: [new(differentlyCased, false, true), new(original, true, true)]; 149Assert.Equal([new SavedAppHost(missing, true, false)], saved.ClearRecent().AppHosts); 150Assert.Equal([new SavedAppHost(recent, false, true), new SavedAppHost(missing, true, false)], 155Assert.Equal([new SavedAppHost(missing, true, false)], new FileTraySavedStateStore(directory.StatePath).Load().AppHosts); 169Assert.Equal([new SavedAppHost(retained, true, true), new SavedAppHost(recent, false, true)],
TrayUserPreferencesTests.cs (2)
19Assert.Equal([new SavedAppHost(host, true, true)], new FileTraySavedStateStore(directory.UserStatePath).Load().AppHosts); 28var saved = new TraySavedState([new(host, true, true)]);
8 references to SavedAppHost
Aspire.Tray.Tests (8)
src\Aspire.Tray\Common\FileTraySavedStateStore.cs (1)
174foreach (var host in state.AppHosts)
src\Aspire.Tray\Common\TrayController.cs (3)
500foreach (var host in _savedState.AppHosts.Where(host => host.IsPinned && !protectedPaths.Contains(host.AppHostPath))) 595foreach (var saved in _savedState.AppHosts.Where(host => host.IsPinned && !listedPaths.Contains(host.AppHostPath))) 635private AppHostMenuItem CreateSavedMenuItem(SavedAppHost saved, bool live)
src\Aspire.Tray\Common\TraySavedState.cs (3)
11internal sealed record TraySavedState(IReadOnlyList<SavedAppHost> AppHosts) 31var existing = AppHosts.SingleOrDefault(host => TrayAppHostPath.Comparer.Equals(host.AppHostPath, appHostPath)); 41var existing = AppHosts.SingleOrDefault(host => TrayAppHostPath.Comparer.Equals(host.AppHostPath, appHostPath));
TraySavedStateTests.cs (1)
130SavedAppHost[] expected = OperatingSystem.IsWindows()