Further simplified beatmap colouring tests.

This commit is contained in:
Mysfit
2021-01-16 02:09:35 -05:00
parent 112967c1e8
commit a3535f4b79
3 changed files with 35 additions and 169 deletions

View File

@ -77,35 +77,13 @@ namespace osu.Game.Rulesets.Osu.Tests
AddAssert("is custom user skin colours", () => TestPlayer.UsableComboColours.SequenceEqual(TestSkin.Colours));
}
protected override ExposedPlayer CreateTestPlayer(bool userHasCustomColours) => new OsuExposedPlayer(userHasCustomColours);
private class OsuExposedPlayer : ExposedPlayer
{
public OsuExposedPlayer(bool userHasCustomColours)
: base(userHasCustomColours)
{
}
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
{
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
dependencies.CacheAs<ISkinSource>(new OsuTestSkin(UserHasCustomColours));
return dependencies;
}
}
private class OsuCustomSkinWorkingBeatmap : CustomSkinWorkingBeatmap
{
private readonly bool hasColours;
public OsuCustomSkinWorkingBeatmap(AudioManager audio, bool hasColours)
: base(createBeatmap(), audio, hasColours)
{
this.hasColours = hasColours;
}
protected override ISkin GetSkin() => new OsuTestBeatmapSkin(BeatmapInfo, hasColours);
private static IBeatmap createBeatmap() =>
new Beatmap
{
@ -117,21 +95,5 @@ namespace osu.Game.Rulesets.Osu.Tests
HitObjects = { new HitCircle { Position = new Vector2(256, 192) } }
};
}
private class OsuTestBeatmapSkin : TestBeatmapSkin
{
public OsuTestBeatmapSkin(BeatmapInfo beatmap, bool hasColours)
: base(beatmap, hasColours)
{
}
}
private class OsuTestSkin : TestSkin
{
public OsuTestSkin(bool hasCustomColours)
: base(hasCustomColours)
{
}
}
}
}