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-07 20:05:55 +08:00
|
|
|
|
public TestCaseBeatmapDetails()
|
2017-03-25 06:02:24 +08:00
|
|
|
|
{
|
2017-09-09 01:25:41 +08:00
|
|
|
|
BeatmapDetails details;
|
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-09-09 01:15:28 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
AddStep("beatmap all metrics", () => details.Beatmap = new BeatmapInfo
|
|
|
|
|
{
|
|
|
|
|
Version = "All Metrics",
|
|
|
|
|
Metadata = new BeatmapMetadata
|
|
|
|
|
{
|
|
|
|
|
Source = "osu!lazer",
|
|
|
|
|
Tags = "this beatmap has all the metrics",
|
|
|
|
|
},
|
|
|
|
|
Difficulty = new BeatmapDifficulty
|
|
|
|
|
{
|
|
|
|
|
CircleSize = 7,
|
|
|
|
|
DrainRate = 1,
|
|
|
|
|
OverallDifficulty = 5.7f,
|
|
|
|
|
ApproachRate = 3.5f,
|
|
|
|
|
},
|
|
|
|
|
StarDifficulty = 5.3f,
|
|
|
|
|
Metrics = new BeatmapMetrics
|
|
|
|
|
{
|
|
|
|
|
Ratings = Enumerable.Range(0, 10),
|
|
|
|
|
Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6),
|
|
|
|
|
Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6),
|
2017-03-25 06:02:24 +08:00
|
|
|
|
},
|
|
|
|
|
});
|
2017-03-29 02:18:56 +08:00
|
|
|
|
|
2017-09-09 01:15:28 +08:00
|
|
|
|
AddStep("beatmap ratings", () => details.Beatmap = new BeatmapInfo
|
|
|
|
|
{
|
|
|
|
|
Version = "Only Ratings",
|
|
|
|
|
Metadata = new BeatmapMetadata
|
|
|
|
|
{
|
|
|
|
|
Source = "osu!lazer",
|
|
|
|
|
Tags = "this beatmap has ratings metrics but not retries or fails",
|
|
|
|
|
},
|
|
|
|
|
Difficulty = new BeatmapDifficulty
|
|
|
|
|
{
|
|
|
|
|
CircleSize = 6,
|
|
|
|
|
DrainRate = 9,
|
|
|
|
|
OverallDifficulty = 6,
|
|
|
|
|
ApproachRate = 6,
|
|
|
|
|
},
|
|
|
|
|
StarDifficulty = 4.8f,
|
|
|
|
|
Metrics = new BeatmapMetrics
|
|
|
|
|
{
|
|
|
|
|
Ratings = Enumerable.Range(0, 10),
|
|
|
|
|
},
|
|
|
|
|
});
|
2017-03-29 20:48:43 +08:00
|
|
|
|
|
2017-09-09 01:15:28 +08:00
|
|
|
|
AddStep("beatmap fails retries", () => details.Beatmap = new BeatmapInfo
|
|
|
|
|
{
|
|
|
|
|
Version = "Only Retries and Fails",
|
|
|
|
|
Metadata = new BeatmapMetadata
|
|
|
|
|
{
|
|
|
|
|
Source = "osu!lazer",
|
|
|
|
|
Tags = "this beatmap has retries and fails but no ratings",
|
|
|
|
|
},
|
|
|
|
|
Difficulty = new BeatmapDifficulty
|
|
|
|
|
{
|
|
|
|
|
CircleSize = 3.7f,
|
|
|
|
|
DrainRate = 6,
|
|
|
|
|
OverallDifficulty = 6,
|
|
|
|
|
ApproachRate = 7,
|
|
|
|
|
},
|
|
|
|
|
StarDifficulty = 2.91f,
|
|
|
|
|
Metrics = new BeatmapMetrics
|
|
|
|
|
{
|
|
|
|
|
Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6),
|
|
|
|
|
Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6),
|
|
|
|
|
},
|
|
|
|
|
});
|
2017-03-29 20:48:43 +08:00
|
|
|
|
|
2017-09-09 01:15:28 +08:00
|
|
|
|
AddStep("beatmap no metrics", () => details.Beatmap = new BeatmapInfo
|
|
|
|
|
{
|
|
|
|
|
Version = "No Metrics",
|
|
|
|
|
Metadata = new BeatmapMetadata
|
|
|
|
|
{
|
|
|
|
|
Source = "osu!lazer",
|
|
|
|
|
Tags = "this beatmap has no metrics",
|
|
|
|
|
},
|
|
|
|
|
Difficulty = new BeatmapDifficulty
|
|
|
|
|
{
|
|
|
|
|
CircleSize = 5,
|
|
|
|
|
DrainRate = 5,
|
|
|
|
|
OverallDifficulty = 5.5f,
|
|
|
|
|
ApproachRate = 6.5f,
|
|
|
|
|
},
|
|
|
|
|
StarDifficulty = 1.97f,
|
|
|
|
|
Metrics = new BeatmapMetrics(),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
AddStep("null beatmap", () => details.Beatmap = null);
|
2017-03-25 06:02:24 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2017-09-09 01:15:28 +08:00
|
|
|
|
}
|