mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
Add failing test
This commit is contained in:
parent
4adf967801
commit
bca1be0bfa
@ -57,23 +57,6 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
typeof(DrawableCarouselBeatmapSet),
|
typeof(DrawableCarouselBeatmapSet),
|
||||||
};
|
};
|
||||||
|
|
||||||
private class TestSongSelect : PlaySongSelect
|
|
||||||
{
|
|
||||||
public Action StartRequested;
|
|
||||||
|
|
||||||
public new Bindable<RulesetInfo> Ruleset => base.Ruleset;
|
|
||||||
|
|
||||||
public WorkingBeatmap CurrentBeatmap => Beatmap.Value;
|
|
||||||
public WorkingBeatmap CurrentBeatmapDetailsBeatmap => BeatmapDetails.Beatmap;
|
|
||||||
public new BeatmapCarousel Carousel => base.Carousel;
|
|
||||||
|
|
||||||
protected override bool OnStart()
|
|
||||||
{
|
|
||||||
StartRequested?.Invoke();
|
|
||||||
return base.OnStart();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private TestSongSelect songSelect;
|
private TestSongSelect songSelect;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -101,6 +84,17 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
manager?.Delete(manager.GetAllUsableBeatmapSets());
|
manager?.Delete(manager.GetAllUsableBeatmapSets());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestSingleFilterOnEnter()
|
||||||
|
{
|
||||||
|
addRulesetImportStep(0);
|
||||||
|
addRulesetImportStep(0);
|
||||||
|
|
||||||
|
createSongSelect();
|
||||||
|
|
||||||
|
AddAssert("filter count is 1", () => songSelect.FilterCount == 1);
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestAudioResuming()
|
public void TestAudioResuming()
|
||||||
{
|
{
|
||||||
@ -357,5 +351,30 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
base.Dispose(isDisposing);
|
base.Dispose(isDisposing);
|
||||||
rulesets?.Dispose();
|
rulesets?.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class TestSongSelect : PlaySongSelect
|
||||||
|
{
|
||||||
|
public Action StartRequested;
|
||||||
|
|
||||||
|
public new Bindable<RulesetInfo> Ruleset => base.Ruleset;
|
||||||
|
|
||||||
|
public WorkingBeatmap CurrentBeatmap => Beatmap.Value;
|
||||||
|
public WorkingBeatmap CurrentBeatmapDetailsBeatmap => BeatmapDetails.Beatmap;
|
||||||
|
public new BeatmapCarousel Carousel => base.Carousel;
|
||||||
|
|
||||||
|
protected override bool OnStart()
|
||||||
|
{
|
||||||
|
StartRequested?.Invoke();
|
||||||
|
return base.OnStart();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int FilterCount;
|
||||||
|
|
||||||
|
protected override void ApplyFilterToCarousel(FilterCriteria criteria)
|
||||||
|
{
|
||||||
|
FilterCount++;
|
||||||
|
base.ApplyFilterToCarousel(criteria);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -165,7 +165,7 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Height = FilterControl.HEIGHT,
|
Height = FilterControl.HEIGHT,
|
||||||
FilterChanged = c => Carousel.Filter(c),
|
FilterChanged = ApplyFilterToCarousel,
|
||||||
Background = { Width = 2 },
|
Background = { Width = 2 },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -217,6 +217,8 @@ namespace osu.Game.Screens.Select
|
|||||||
BeatmapDetails.Leaderboard.ScoreSelected += score => this.Push(new SoloResults(score));
|
BeatmapDetails.Leaderboard.ScoreSelected += score => this.Push(new SoloResults(score));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected virtual void ApplyFilterToCarousel(FilterCriteria criteria) => Carousel.Filter(criteria);
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
private void load(BeatmapManager beatmaps, AudioManager audio, DialogOverlay dialog, OsuColour colours, SkinManager skins, ScoreManager scores)
|
private void load(BeatmapManager beatmaps, AudioManager audio, DialogOverlay dialog, OsuColour colours, SkinManager skins, ScoreManager scores)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user