2017-03-26 06:33:03 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
2017-03-25 06:02:24 +08:00
|
|
|
|
using System.Linq;
|
2017-08-04 14:37:31 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
2017-07-26 12:22:46 +08:00
|
|
|
|
using osu.Game.Beatmaps;
|
2017-08-04 14:37:31 +08:00
|
|
|
|
using osu.Game.Screens.Select;
|
2017-03-25 06:02:24 +08:00
|
|
|
|
|
2017-08-04 14:37:31 +08:00
|
|
|
|
namespace osu.Desktop.Tests.Visual
|
2017-03-25 06:02:24 +08:00
|
|
|
|
{
|
2017-08-04 14:37:31 +08:00
|
|
|
|
internal class TestCaseBeatmapDetails : OsuTestCase
|
2017-03-25 06:02:24 +08:00
|
|
|
|
{
|
2017-03-30 23:32:18 +08:00
|
|
|
|
public override string Description => "BeatmapDetails tab of BeatmapDetailArea";
|
|
|
|
|
|
2017-07-08 17:17:47 +08:00
|
|
|
|
private readonly BeatmapDetails details;
|
2017-03-25 06:02:24 +08:00
|
|
|
|
|
2017-07-07 20:05:55 +08:00
|
|
|
|
public TestCaseBeatmapDetails()
|
2017-03-25 06:02:24 +08:00
|
|
|
|
{
|
2017-03-30 23:32:18 +08:00
|
|
|
|
Add(details = new BeatmapDetails
|
2017-03-25 06:02:24 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2017-03-29 02:18:56 +08:00
|
|
|
|
Padding = new MarginPadding(150),
|
2017-03-26 06:33:03 +08:00
|
|
|
|
Beatmap = new BeatmapInfo
|
2017-03-25 06:02:24 +08:00
|
|
|
|
{
|
2017-03-26 06:33:03 +08:00
|
|
|
|
Version = "VisualTest",
|
|
|
|
|
Metadata = new BeatmapMetadata
|
|
|
|
|
{
|
|
|
|
|
Source = "Some guy",
|
|
|
|
|
Tags = "beatmap metadata example with a very very long list of tags and not much creativity",
|
|
|
|
|
},
|
|
|
|
|
Difficulty = new BeatmapDifficulty
|
|
|
|
|
{
|
|
|
|
|
CircleSize = 7,
|
|
|
|
|
ApproachRate = 3.5f,
|
|
|
|
|
OverallDifficulty = 5.7f,
|
|
|
|
|
DrainRate = 1,
|
|
|
|
|
},
|
|
|
|
|
StarDifficulty = 5.3f,
|
2017-04-12 20:09:39 +08:00
|
|
|
|
Metrics = new BeatmapMetrics
|
2017-04-10 22:42:23 +08:00
|
|
|
|
{
|
2017-06-08 14:35:10 +08:00
|
|
|
|
Ratings = Enumerable.Range(0, 10),
|
2017-04-12 00:43:48 +08:00
|
|
|
|
Fails = Enumerable.Range(lastRange, 100).Select(i => i % 12 - 6),
|
|
|
|
|
Retries = Enumerable.Range(lastRange - 3, 100).Select(i => i % 12 - 6),
|
2017-04-10 22:42:23 +08:00
|
|
|
|
},
|
2017-03-25 06:02:24 +08:00
|
|
|
|
},
|
|
|
|
|
});
|
2017-03-29 02:18:56 +08:00
|
|
|
|
|
2017-04-10 22:42:23 +08:00
|
|
|
|
AddRepeatStep("fail values", newRetryAndFailValues, 10);
|
2017-03-29 20:48:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private int lastRange = 1;
|
|
|
|
|
|
|
|
|
|
private void newRetryAndFailValues()
|
|
|
|
|
{
|
2017-04-12 20:09:39 +08:00
|
|
|
|
details.Beatmap.Metrics.Fails = Enumerable.Range(lastRange, 100).Select(i => i % 12 - 6);
|
|
|
|
|
details.Beatmap.Metrics.Retries = Enumerable.Range(lastRange - 3, 100).Select(i => i % 12 - 6);
|
2017-04-12 00:43:48 +08:00
|
|
|
|
details.Beatmap = details.Beatmap;
|
2017-03-29 21:37:51 +08:00
|
|
|
|
lastRange += 100;
|
2017-03-25 06:02:24 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2017-04-04 23:27:08 +08:00
|
|
|
|
}
|