1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-19 03:52:55 +08:00
osu-lazer/osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs

116 lines
4.1 KiB
C#
Raw Normal View History

2017-09-18 21:32:49 +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
using System.ComponentModel;
2017-09-18 21:32:49 +08:00
using System.Linq;
using osu.Framework.Graphics;
using osu.Game.Beatmaps;
using osu.Game.Screens.Select;
namespace osu.Game.Tests.Visual
{
[Description("PlaySongSelect beatmap details")]
2017-09-18 21:32:49 +08:00
internal class TestCaseBeatmapDetails : OsuTestCase
{
public TestCaseBeatmapDetails()
{
BeatmapDetails details;
Add(details = new BeatmapDetails
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding(150),
});
AddStep("beatmap all metrics", () => details.Beatmap = new BeatmapInfo
{
Version = "All Metrics",
2017-10-06 05:23:26 +08:00
Metadata = new BeatmapMetadata
2017-09-18 21:32:49 +08:00
{
Source = "osu!lazer",
Tags = "this beatmap has all the metrics",
},
2017-10-19 13:05:11 +08:00
BaseDifficulty = new BeatmapDifficulty
2017-09-18 21:32:49 +08:00
{
CircleSize = 7,
DrainRate = 1,
OverallDifficulty = 5.7f,
ApproachRate = 3.5f,
},
StarDifficulty = 5.3f,
Metrics = new BeatmapMetrics
{
2017-11-15 14:48:40 +08:00
Ratings = Enumerable.Range(0, 11),
2017-09-18 21:32:49 +08:00
Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6),
Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6),
},
});
AddStep("beatmap ratings", () => details.Beatmap = new BeatmapInfo
{
Version = "Only Ratings",
2017-10-06 05:23:26 +08:00
Metadata = new BeatmapMetadata
2017-09-18 21:32:49 +08:00
{
Source = "osu!lazer",
Tags = "this beatmap has ratings metrics but not retries or fails",
},
2017-10-19 13:05:11 +08:00
BaseDifficulty = new BeatmapDifficulty
2017-09-18 21:32:49 +08:00
{
CircleSize = 6,
DrainRate = 9,
OverallDifficulty = 6,
ApproachRate = 6,
},
StarDifficulty = 4.8f,
Metrics = new BeatmapMetrics
{
2017-11-15 14:48:40 +08:00
Ratings = Enumerable.Range(0, 11),
2017-09-18 21:32:49 +08:00
},
});
AddStep("beatmap fails retries", () => details.Beatmap = new BeatmapInfo
{
Version = "Only Retries and Fails",
2017-10-06 05:23:26 +08:00
Metadata = new BeatmapMetadata
2017-09-18 21:32:49 +08:00
{
Source = "osu!lazer",
Tags = "this beatmap has retries and fails but no ratings",
},
2017-10-19 13:05:11 +08:00
BaseDifficulty = new BeatmapDifficulty
2017-09-18 21:32:49 +08:00
{
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),
},
});
AddStep("beatmap no metrics", () => details.Beatmap = new BeatmapInfo
{
Version = "No Metrics",
2017-10-06 05:23:26 +08:00
Metadata = new BeatmapMetadata
2017-09-18 21:32:49 +08:00
{
Source = "osu!lazer",
Tags = "this beatmap has no metrics",
},
2017-10-19 13:05:11 +08:00
BaseDifficulty = new BeatmapDifficulty
2017-09-18 21:32:49 +08:00
{
CircleSize = 5,
DrainRate = 5,
OverallDifficulty = 5.5f,
ApproachRate = 6.5f,
},
StarDifficulty = 1.97f,
Metrics = new BeatmapMetrics(),
});
AddStep("null beatmap", () => details.Beatmap = null);
}
}
}