1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-27 03:23:03 +08:00

Remove weird override logic in TestCase methods

This commit is contained in:
Dean Herbert 2021-05-31 20:00:47 +09:00
parent e78391db7a
commit f60e9cb085
3 changed files with 20 additions and 30 deletions

View File

@ -32,28 +32,28 @@ namespace osu.Game.Rulesets.Catch.Tests
[TestCase(true, false)]
[TestCase(false, true)]
[TestCase(false, false)]
public override void TestBeatmapComboColours(bool userHasCustomColours, bool useBeatmapSkin)
public void TestBeatmapComboColours(bool userHasCustomColours, bool useBeatmapSkin)
{
PrepareBeatmap(() => new CatchCustomSkinWorkingBeatmap(audio, true));
base.TestBeatmapComboColours(userHasCustomColours, useBeatmapSkin);
ConfigureTest(useBeatmapSkin, true, userHasCustomColours);
AddAssert("is beatmap skin colours", () => TestPlayer.UsableComboColours.SequenceEqual(TestBeatmapSkin.Colours));
}
[TestCase(true)]
[TestCase(false)]
public override void TestBeatmapComboColoursOverride(bool useBeatmapSkin)
public void TestBeatmapComboColoursOverride(bool useBeatmapSkin)
{
PrepareBeatmap(() => new CatchCustomSkinWorkingBeatmap(audio, true));
base.TestBeatmapComboColoursOverride(useBeatmapSkin);
ConfigureTest(useBeatmapSkin, false, true);
AddAssert("is user custom skin colours", () => TestPlayer.UsableComboColours.SequenceEqual(TestSkin.Colours));
}
[TestCase(true)]
[TestCase(false)]
public override void TestBeatmapComboColoursOverrideWithDefaultColours(bool useBeatmapSkin)
public void TestBeatmapComboColoursOverrideWithDefaultColours(bool useBeatmapSkin)
{
PrepareBeatmap(() => new CatchCustomSkinWorkingBeatmap(audio, true));
base.TestBeatmapComboColoursOverrideWithDefaultColours(useBeatmapSkin);
ConfigureTest(useBeatmapSkin, false, false);
AddAssert("is default user skin colours", () => TestPlayer.UsableComboColours.SequenceEqual(SkinConfiguration.DefaultComboColours));
}
@ -61,10 +61,10 @@ namespace osu.Game.Rulesets.Catch.Tests
[TestCase(false, true)]
[TestCase(true, false)]
[TestCase(false, false)]
public override void TestBeatmapNoComboColours(bool useBeatmapSkin, bool useBeatmapColour)
public void TestBeatmapNoComboColours(bool useBeatmapSkin, bool useBeatmapColour)
{
PrepareBeatmap(() => new CatchCustomSkinWorkingBeatmap(audio, false));
base.TestBeatmapNoComboColours(useBeatmapSkin, useBeatmapColour);
ConfigureTest(useBeatmapSkin, useBeatmapColour, false);
AddAssert("is default user skin colours", () => TestPlayer.UsableComboColours.SequenceEqual(SkinConfiguration.DefaultComboColours));
}
@ -72,10 +72,10 @@ namespace osu.Game.Rulesets.Catch.Tests
[TestCase(false, true)]
[TestCase(true, false)]
[TestCase(false, false)]
public override void TestBeatmapNoComboColoursSkinOverride(bool useBeatmapSkin, bool useBeatmapColour)
public void TestBeatmapNoComboColoursSkinOverride(bool useBeatmapSkin, bool useBeatmapColour)
{
PrepareBeatmap(() => new CatchCustomSkinWorkingBeatmap(audio, false));
base.TestBeatmapNoComboColoursSkinOverride(useBeatmapSkin, useBeatmapColour);
ConfigureTest(useBeatmapSkin, useBeatmapColour, true);
AddAssert("is custom user skin colours", () => TestPlayer.UsableComboColours.SequenceEqual(TestSkin.Colours));
}

View File

@ -30,28 +30,28 @@ namespace osu.Game.Rulesets.Osu.Tests
[TestCase(true, false)]
[TestCase(false, true)]
[TestCase(false, false)]
public override void TestBeatmapComboColours(bool userHasCustomColours, bool useBeatmapSkin)
public void TestBeatmapComboColours(bool userHasCustomColours, bool useBeatmapSkin)
{
PrepareBeatmap(() => new OsuCustomSkinWorkingBeatmap(audio, true));
base.TestBeatmapComboColours(userHasCustomColours, useBeatmapSkin);
ConfigureTest(useBeatmapSkin, true, userHasCustomColours);
AddAssert("is beatmap skin colours", () => TestPlayer.UsableComboColours.SequenceEqual(TestBeatmapSkin.Colours));
}
[TestCase(true)]
[TestCase(false)]
public override void TestBeatmapComboColoursOverride(bool useBeatmapSkin)
public void TestBeatmapComboColoursOverride(bool useBeatmapSkin)
{
PrepareBeatmap(() => new OsuCustomSkinWorkingBeatmap(audio, true));
base.TestBeatmapComboColoursOverride(useBeatmapSkin);
ConfigureTest(useBeatmapSkin, false, true);
AddAssert("is user custom skin colours", () => TestPlayer.UsableComboColours.SequenceEqual(TestSkin.Colours));
}
[TestCase(true)]
[TestCase(false)]
public override void TestBeatmapComboColoursOverrideWithDefaultColours(bool useBeatmapSkin)
public void TestBeatmapComboColoursOverrideWithDefaultColours(bool useBeatmapSkin)
{
PrepareBeatmap(() => new OsuCustomSkinWorkingBeatmap(audio, true));
base.TestBeatmapComboColoursOverrideWithDefaultColours(useBeatmapSkin);
ConfigureTest(useBeatmapSkin, false, false);
AddAssert("is default user skin colours", () => TestPlayer.UsableComboColours.SequenceEqual(SkinConfiguration.DefaultComboColours));
}
@ -59,10 +59,10 @@ namespace osu.Game.Rulesets.Osu.Tests
[TestCase(false, true)]
[TestCase(true, false)]
[TestCase(false, false)]
public override void TestBeatmapNoComboColours(bool useBeatmapSkin, bool useBeatmapColour)
public void TestBeatmapNoComboColours(bool useBeatmapSkin, bool useBeatmapColour)
{
PrepareBeatmap(() => new OsuCustomSkinWorkingBeatmap(audio, false));
base.TestBeatmapNoComboColours(useBeatmapSkin, useBeatmapColour);
ConfigureTest(useBeatmapSkin, useBeatmapColour, false);
AddAssert("is default user skin colours", () => TestPlayer.UsableComboColours.SequenceEqual(SkinConfiguration.DefaultComboColours));
}
@ -70,10 +70,10 @@ namespace osu.Game.Rulesets.Osu.Tests
[TestCase(false, true)]
[TestCase(true, false)]
[TestCase(false, false)]
public override void TestBeatmapNoComboColoursSkinOverride(bool useBeatmapSkin, bool useBeatmapColour)
public void TestBeatmapNoComboColoursSkinOverride(bool useBeatmapSkin, bool useBeatmapColour)
{
PrepareBeatmap(() => new OsuCustomSkinWorkingBeatmap(audio, false));
base.TestBeatmapNoComboColoursSkinOverride(useBeatmapSkin, useBeatmapColour);
ConfigureTest(useBeatmapSkin, useBeatmapColour, true);
AddAssert("is custom user skin colours", () => TestPlayer.UsableComboColours.SequenceEqual(TestSkin.Colours));
}

View File

@ -26,16 +26,6 @@ namespace osu.Game.Tests.Beatmaps
private WorkingBeatmap testBeatmap;
public virtual void TestBeatmapComboColours(bool userHasCustomColours, bool useBeatmapSkin) => ConfigureTest(useBeatmapSkin, true, userHasCustomColours);
public virtual void TestBeatmapComboColoursOverride(bool useBeatmapSkin) => ConfigureTest(useBeatmapSkin, false, true);
public virtual void TestBeatmapComboColoursOverrideWithDefaultColours(bool useBeatmapSkin) => ConfigureTest(useBeatmapSkin, false, false);
public virtual void TestBeatmapNoComboColours(bool useBeatmapSkin, bool useBeatmapColour) => ConfigureTest(useBeatmapSkin, useBeatmapColour, false);
public virtual void TestBeatmapNoComboColoursSkinOverride(bool useBeatmapSkin, bool useBeatmapColour) => ConfigureTest(useBeatmapSkin, useBeatmapColour, true);
protected void PrepareBeatmap(Func<WorkingBeatmap> createBeatmap) => AddStep("prepare beatmap", () => testBeatmap = createBeatmap());
protected void ConfigureTest(bool useBeatmapSkin, bool useBeatmapColours, bool userHasCustomColours)