7 writes to RecentAppHosts
Aspire.Tray.Tests (7)
Helpers\TrayPanelSamples.cs (3)
43RecentAppHosts = 53RecentAppHosts = 88RecentAppHosts = [Offline("/Users/dev/src/todo/Todo.AppHost/Todo.AppHost.csproj", pinned: false)],
LinuxTrayTests.cs (2)
45"Empty" => TrayPanelSamples.Empty() with { RecentAppHosts = [], CanClearRecent = false }, 483var state = new TrayViewState(DiscoveryState.Live, [host], "One AppHost") { RecentAppHosts = [recent] };
src\Aspire.Tray\Common\TrayController.cs (1)
628RecentAppHosts = recent,
TrayPanelTests.cs (1)
725panel.Update(state with { RecentAppHosts = state.RecentAppHosts.Take(1).ToArray() });
75 references to RecentAppHosts
Aspire.Tray.Tests (75)
LinuxTrayTests.cs (2)
334var host = Assert.Single(controller.State.RecentAppHosts); 534Assert.Equal(kept, Assert.Single(controller.State.RecentAppHosts).Id.AppHostPath);
src\Aspire.Tray\Common\TrayIconStatus.cs (2)
28: state.StartingAppHostCount > 0 || state.AppHosts.Concat(state.RecentAppHosts).Any(host => host.IsStarting) 61|| state.AppHosts.Concat(state.RecentAppHosts).Any(host => host.Error is not null
src\Aspire.Tray\Common\TrayPanel.cs (7)
856AddSection(PanelSection.Recent, state.RecentAppHosts, IsRecentExpanded); 1251_ => $"RECENT · {state.RecentAppHosts.Count}" 1269var count = state.RecentAppHosts.Count; 1358_ => IsRecentExpanded ? _state.RecentAppHosts : [] 1455PanelConfirmKind.RemoveMissing => _state.RecentAppHosts.FirstOrDefault(host => host.Id == confirm.Host!.Id), 1709var visibleStarting = state.AppHosts.Concat(state.RecentAppHosts).Count(host => host.IsStarting); 1712var attention = state.AppHosts.Concat(state.RecentAppHosts).Count(host => host.Error is not null
src\Aspire.Tray\Linux\LinuxTrayMenu.cs (3)
40if (state.RecentAppHosts.Count > 0) 43var recent = state.RecentAppHosts.Select(host => Host(host, recent: true)).ToList(); 46items.Add(new($"Recently opened \u00b7 {state.RecentAppHosts.Count}", Children: recent));
TrayControllerPinPruningTests.cs (10)
39Assert.Equal(new AppHostInfo(recent, 0, null).Id, Assert.Single(controller.State.RecentAppHosts).Id); 68Assert.Empty(controller.State.RecentAppHosts); 101Assert.Empty(controller.State.RecentAppHosts); 124Assert.Empty(controller.State.RecentAppHosts); 147Assert.Equal(new AppHostInfo(path, 0, null).Id, Assert.Single(controller.State.RecentAppHosts).Id); 151Assert.Empty(controller.State.RecentAppHosts); 184Assert.Empty(controller.State.RecentAppHosts); 249Assert.Single(controller.State.RecentAppHosts, host => host.Id == new AppHostInfo(restricted, 0, null).Id).Subtitle); 251Assert.Single(controller.State.RecentAppHosts, host => host.Id == new AppHostInfo(deleted, 0, null).Id).Subtitle); 277Assert.Empty(controller.State.RecentAppHosts);
TrayControllerPreferencesTests.cs (6)
63Assert.Equal(10, controller.State.RecentAppHosts.Count); 75Assert.Single(controller.State.RecentAppHosts); 103Assert.Equal(paths.Take(limit).Select(IdentityPath), controller.State.RecentAppHosts.Select(host => host.Id.AppHostPath)); 109Assert.Empty(controller.State.RecentAppHosts); 129Assert.Empty(controller.State.RecentAppHosts); 148Assert.Empty(controller.State.RecentAppHosts);
TrayControllerSavedStateTests.cs (39)
42await WaitForStateAsync(controller, state => state.AppHosts.Concat(state.RecentAppHosts).Any(row => row.CanStart)); 43var row = Assert.Single(controller.State.AppHosts.Concat(controller.State.RecentAppHosts)); 52row = Assert.Single(controller.State.AppHosts.Concat(controller.State.RecentAppHosts)); 79await WaitForStateAsync(controller, state => state.RecentAppHosts.SingleOrDefault()?.Error == 81Assert.False(Assert.Single(controller.State.RecentAppHosts).CanStart); 91Assert.Empty(controller.State.RecentAppHosts); 110await WaitForStateAsync(controller, state => state.RecentAppHosts.Count == 0); 115Assert.Empty(controller.State.RecentAppHosts); 138await WaitForStateAsync(controller, state => state.RecentAppHosts.Count == 0); 177await WaitForStateAsync(controller, state => state.RecentAppHosts.Count == 0); 183var row = Assert.Single(controller.State.RecentAppHosts); 235Assert.Equal(recent, Assert.Single(controller.State.RecentAppHosts).Id.AppHostPath); 242Assert.True(Assert.Single(controller.State.RecentAppHosts).CanStart); 265Assert.Empty(controller.State.RecentAppHosts); 285Assert.Empty(controller.State.RecentAppHosts); 293Assert.Empty(controller.State.RecentAppHosts); 299Assert.Equal(path, Assert.Single(controller.State.RecentAppHosts).Id.AppHostPath); 317Assert.Empty(controller.State.RecentAppHosts); 324Assert.Equal(first.Id.AppHostPath, Assert.Single(controller.State.RecentAppHosts).Id.AppHostPath); 354Assert.Empty(controller.State.RecentAppHosts); 360Assert.Equal(host.Id.AppHostPath, Assert.Single(controller.State.RecentAppHosts).Id.AppHostPath); 381controller.State.RecentAppHosts.Select(host => host.Id.AppHostPath)); 386controller.State.RecentAppHosts.Select(host => host.Id.AppHostPath)); 391controller.State.RecentAppHosts.Select(host => host.Id.AppHostPath)); 408await WaitForStateAsync(controller, state => state.RecentAppHosts.Single().Error is not null); 409var timedOut = Assert.Single(controller.State.RecentAppHosts); 422Assert.Empty(controller.State.RecentAppHosts); 443Assert.All(controller.State.RecentAppHosts, row => 455await WaitForStateAsync(controller, state => state.RecentAppHosts.Count == 1); 459Assert.Equal(IdentityPath(second), Assert.Single(controller.State.RecentAppHosts).Id.AppHostPath); 465Assert.Equal(IdentityPath(second), Assert.Single(controller.State.RecentAppHosts).Id.AppHostPath); 486Assert.Empty(controller.State.RecentAppHosts); 529await WaitForStateAsync(controller, state => state.RecentAppHosts[0].Error is not null); 530Assert.Equal("Unable to start AppHost.", Assert.Single(controller.State.RecentAppHosts).Error); 531Assert.True(controller.State.RecentAppHosts[0].CanStart); 535Assert.Null(Assert.Single(controller.State.RecentAppHosts).Error); 537await WaitForStateAsync(controller, state => state.RecentAppHosts[0].Error is not null); 539Assert.Single(controller.State.RecentAppHosts).Error); 540Assert.False(controller.State.RecentAppHosts[0].CanStart);
TrayPanelTests.cs (6)
48Click(panel, Target(panel, PanelTargetKind.More, state.RecentAppHosts[0]).HitBounds); 54panel.ConfirmRemoveMissing(state.RecentAppHosts[1]); 292var recent = state.RecentAppHosts[0]; 723panel.ConfirmRemoveMissing(state.RecentAppHosts[1]); 725panel.Update(state with { RecentAppHosts = state.RecentAppHosts.Take(1).ToArray() }); 755var missing = state.RecentAppHosts[1];