osu/osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs

116 lines
4.1 KiB
C#
Raw Normal View History

2018-01-05 11:21:19 +00:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
2017-09-18 13:32:49 +00:00
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.ComponentModel;
2017-09-18 13:32:49 +00: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-12-20 12:47:45 +00:00
public class TestCaseBeatmapDetails : OsuTestCase
2017-09-18 13:32:49 +00:00
{
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-05 21:23:26 +00:00
Metadata = new BeatmapMetadata
2017-09-18 13:32:49 +00:00
{
Source = "osu!lazer",
Tags = "this beatmap has all the metrics",
},
2017-10-19 05:05:11 +00:00
BaseDifficulty = new BeatmapDifficulty
2017-09-18 13:32:49 +00:00
{
CircleSize = 7,
DrainRate = 1,
OverallDifficulty = 5.7f,
ApproachRate = 3.5f,
},
StarDifficulty = 5.3f,
Metrics = new BeatmapMetrics
{
2017-11-15 06:48:40 +00:00
Ratings = Enumerable.Range(0, 11),
2017-09-18 13:32:49 +00: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-05 21:23:26 +00:00
Metadata = new BeatmapMetadata
2017-09-18 13:32:49 +00:00
{
Source = "osu!lazer",
Tags = "this beatmap has ratings metrics but not retries or fails",
},
2017-10-19 05:05:11 +00:00
BaseDifficulty = new BeatmapDifficulty
2017-09-18 13:32:49 +00:00
{
CircleSize = 6,
DrainRate = 9,
OverallDifficulty = 6,
ApproachRate = 6,
},
StarDifficulty = 4.8f,
Metrics = new BeatmapMetrics
{
2017-11-15 06:48:40 +00:00
Ratings = Enumerable.Range(0, 11),
2017-09-18 13:32:49 +00:00
},
});
AddStep("beatmap fails retries", () => details.Beatmap = new BeatmapInfo
{
Version = "Only Retries and Fails",
2017-10-05 21:23:26 +00:00
Metadata = new BeatmapMetadata
2017-09-18 13:32:49 +00:00
{
Source = "osu!lazer",
Tags = "this beatmap has retries and fails but no ratings",
},
2017-10-19 05:05:11 +00:00
BaseDifficulty = new BeatmapDifficulty
2017-09-18 13:32:49 +00: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-05 21:23:26 +00:00
Metadata = new BeatmapMetadata
2017-09-18 13:32:49 +00:00
{
Source = "osu!lazer",
Tags = "this beatmap has no metrics",
},
2017-10-19 05:05:11 +00:00
BaseDifficulty = new BeatmapDifficulty
2017-09-18 13:32:49 +00:00
{
CircleSize = 5,
DrainRate = 5,
OverallDifficulty = 5.5f,
ApproachRate = 6.5f,
},
StarDifficulty = 1.97f,
Metrics = new BeatmapMetrics(),
});
AddStep("null beatmap", () => details.Beatmap = null);
}
}
}