mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Add beatmap update button
This commit is contained in:
@ -11,6 +11,7 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Configuration;
|
||||
@ -43,6 +44,29 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
this.rulesets = rulesets;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestBeatmapWithOnlineUpdates()
|
||||
{
|
||||
var testBeatmapSetInfo = TestResources.CreateTestBeatmapSetInfo();
|
||||
|
||||
createCarousel(new List<BeatmapSetInfo>
|
||||
{
|
||||
testBeatmapSetInfo,
|
||||
});
|
||||
|
||||
AddAssert("update button not visible", () => !carousel.ChildrenOfType<UpdateBeatmapSetButton>().Any());
|
||||
|
||||
AddStep("update online hash", () =>
|
||||
{
|
||||
testBeatmapSetInfo.Beatmaps.First().OnlineMD5Hash = "different hash";
|
||||
testBeatmapSetInfo.Beatmaps.First().LastOnlineUpdate = DateTimeOffset.Now;
|
||||
|
||||
carousel.UpdateBeatmapSet(testBeatmapSetInfo);
|
||||
});
|
||||
|
||||
AddUntilStep("update button visible", () => carousel.ChildrenOfType<UpdateBeatmapSetButton>().Any());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestExternalRulesetChange()
|
||||
{
|
||||
@ -825,7 +849,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
checkVisibleItemCount(true, 15);
|
||||
}
|
||||
|
||||
private void loadBeatmaps(List<BeatmapSetInfo> beatmapSets = null, Func<FilterCriteria> initialCriteria = null, Action<BeatmapCarousel> carouselAdjust = null, int? count = null, bool randomDifficulties = false)
|
||||
private void loadBeatmaps(List<BeatmapSetInfo> beatmapSets = null, Func<FilterCriteria> initialCriteria = null, Action<BeatmapCarousel> carouselAdjust = null, int? count = null,
|
||||
bool randomDifficulties = false)
|
||||
{
|
||||
bool changed = false;
|
||||
|
||||
|
Reference in New Issue
Block a user