private void createResults(Func <ScoreInfo> getScore = null) { AddStep("load results", () => { LoadScreen(resultsScreen = new TestResultsScreen(getScore?.Invoke(), 1, new PlaylistItem { Beatmap = { Value = new TestBeatmap(new OsuRuleset().RulesetInfo).BeatmapInfo }, Ruleset = { Value = new OsuRuleset().RulesetInfo } })); }); AddUntilStep("wait for load", () => resultsScreen.ChildrenOfType <ScorePanelList>().FirstOrDefault()?.AllPanelsVisible == true); }
public void TestDownloadButtonInitiallyDisabled() { TestResultsScreen screen = null; AddStep("load results", () => Child = new TestResultsContainer(screen = createResultsScreen())); AddAssert("download button is disabled", () => !screen.ChildrenOfType <DownloadButton>().Last().Enabled.Value); AddStep("click contracted panel", () => { var contractedPanel = this.ChildrenOfType <ScorePanel>().First(p => p.State == PanelState.Contracted && p.ScreenSpaceDrawQuad.TopLeft.X > screen.ScreenSpaceDrawQuad.TopLeft.X); InputManager.MoveMouseTo(contractedPanel); InputManager.Click(MouseButton.Left); }); AddAssert("download button is enabled", () => screen.ChildrenOfType <DownloadButton>().Last().Enabled.Value); }