1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 01:52:55 +08:00

Use TestWorkingBeatmap in BeatmapDetailsArea tests

This commit is contained in:
iiSaLMaN 2019-09-09 19:52:31 +03:00
parent 570e211db0
commit 22fabef344

View File

@ -9,6 +9,7 @@ using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Screens.Select; using osu.Game.Screens.Select;
using osu.Game.Tests.Beatmaps;
using osuTK; using osuTK;
namespace osu.Game.Tests.Visual.SongSelect namespace osu.Game.Tests.Visual.SongSelect
@ -30,45 +31,44 @@ namespace osu.Game.Tests.Visual.SongSelect
Size = new Vector2(550f, 450f), Size = new Vector2(550f, 450f),
}); });
AddStep("all metrics", () => detailsArea.Beatmap = new DummyWorkingBeatmap(null, null) AddStep("all metrics", () => detailsArea.Beatmap = new TestWorkingBeatmap(new Beatmap
{
BeatmapInfo =
{ {
BeatmapSetInfo = BeatmapSet = new BeatmapSetInfo
{ {
Metrics = new BeatmapSetMetrics { Ratings = Enumerable.Range(0, 11).ToArray() } Metrics = new BeatmapSetMetrics { Ratings = Enumerable.Range(0, 11).ToArray() }
}, },
BeatmapInfo = Version = "All Metrics",
Metadata = new BeatmapMetadata
{ {
Version = "All Metrics", Source = "osu!lazer",
Metadata = new BeatmapMetadata Tags = "this beatmap has all the metrics",
{ },
Source = "osu!lazer", BaseDifficulty = new BeatmapDifficulty
Tags = "this beatmap has all the metrics", {
}, CircleSize = 7,
BaseDifficulty = new BeatmapDifficulty DrainRate = 1,
{ OverallDifficulty = 5.7f,
CircleSize = 7, ApproachRate = 3.5f,
DrainRate = 1, },
OverallDifficulty = 5.7f, StarDifficulty = 5.3f,
ApproachRate = 3.5f, Metrics = new BeatmapMetrics
}, {
StarDifficulty = 5.3f, Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6).ToArray(),
Metrics = new BeatmapMetrics Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6).ToArray(),
{ },
Fails = Enumerable.Range(1, 100).Select(i => i % 12 - 6).ToArray(),
Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6).ToArray(),
},
}
} }
); }));
AddStep("all except source", () => detailsArea.Beatmap = new DummyWorkingBeatmap(null, null) AddStep("all except source", () => detailsArea.Beatmap = new TestWorkingBeatmap(new Beatmap
{ {
BeatmapSetInfo =
{
Metrics = new BeatmapSetMetrics { Ratings = Enumerable.Range(0, 11).ToArray() }
},
BeatmapInfo = BeatmapInfo =
{ {
BeatmapSet = new BeatmapSetInfo
{
Metrics = new BeatmapSetMetrics { Ratings = Enumerable.Range(0, 11).ToArray() }
},
Version = "All Metrics", Version = "All Metrics",
Metadata = new BeatmapMetadata Metadata = new BeatmapMetadata
{ {
@ -88,16 +88,16 @@ namespace osu.Game.Tests.Visual.SongSelect
Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6).ToArray(), Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6).ToArray(),
}, },
} }
}); }));
AddStep("ratings", () => detailsArea.Beatmap = new DummyWorkingBeatmap(null, null) AddStep("ratings", () => detailsArea.Beatmap = new TestWorkingBeatmap(new Beatmap
{ {
BeatmapSetInfo =
{
Metrics = new BeatmapSetMetrics { Ratings = Enumerable.Range(0, 11).ToArray() }
},
BeatmapInfo = BeatmapInfo =
{ {
BeatmapSet = new BeatmapSetInfo
{
Metrics = new BeatmapSetMetrics { Ratings = Enumerable.Range(0, 11).ToArray() }
},
Version = "Only Ratings", Version = "Only Ratings",
Metadata = new BeatmapMetadata Metadata = new BeatmapMetadata
{ {
@ -113,9 +113,9 @@ namespace osu.Game.Tests.Visual.SongSelect
}, },
StarDifficulty = 4.8f StarDifficulty = 4.8f
} }
}); }));
AddStep("fails+retries", () => detailsArea.Beatmap = new DummyWorkingBeatmap(null, null) AddStep("fails+retries", () => detailsArea.Beatmap = new TestWorkingBeatmap(new Beatmap
{ {
BeatmapInfo = BeatmapInfo =
{ {
@ -139,9 +139,9 @@ namespace osu.Game.Tests.Visual.SongSelect
Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6).ToArray(), Retries = Enumerable.Range(-2, 100).Select(i => i % 12 - 6).ToArray(),
}, },
} }
}); }));
AddStep("null metrics", () => detailsArea.Beatmap = new DummyWorkingBeatmap(null, null) AddStep("null metrics", () => detailsArea.Beatmap = new TestWorkingBeatmap(new Beatmap
{ {
BeatmapInfo = BeatmapInfo =
{ {
@ -160,7 +160,7 @@ namespace osu.Game.Tests.Visual.SongSelect
}, },
StarDifficulty = 1.97f, StarDifficulty = 1.97f,
} }
}); }));
AddStep("null beatmap", () => detailsArea.Beatmap = null); AddStep("null beatmap", () => detailsArea.Beatmap = null);
} }