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