1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 07:07:45 +08:00

Remove ModTestScene ruleset parameter on constructor and use CreateRuleset instead

This commit is contained in:
Salman Ahmed 2020-04-17 10:56:01 +03:00
parent 92df4e3a9e
commit 155bc8b49a
9 changed files with 20 additions and 29 deletions

View File

@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Catch.Tests.Mods
public class TestSceneCatchModPerfect : ModPerfectTestScene
{
public TestSceneCatchModPerfect()
: base(new CatchRuleset(), new CatchModPerfect())
: base(new CatchModPerfect())
{
}
@ -50,5 +50,7 @@ namespace osu.Game.Rulesets.Catch.Tests.Mods
// We only care about testing misses, hits are tested via JuiceStream
[TestCase(true)]
public void TestTinyDroplet(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestData(new TinyDroplet { StartTime = 1000 }), shouldMiss);
protected override Ruleset CreateRuleset() => new CatchRuleset();
}
}

View File

@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Mania.Tests.Mods
public class TestSceneManiaModPerfect : ModPerfectTestScene
{
public TestSceneManiaModPerfect()
: base(new ManiaRuleset(), new ManiaModPerfect())
: base(new ManiaModPerfect())
{
}
@ -22,5 +22,7 @@ namespace osu.Game.Rulesets.Mania.Tests.Mods
[TestCase(false)]
[TestCase(true)]
public void TestHoldNote(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestData(new HoldNote { StartTime = 1000, EndTime = 3000 }), shouldMiss);
protected override Ruleset CreateRuleset() => new ManiaRuleset();
}
}

View File

@ -15,11 +15,6 @@ namespace osu.Game.Rulesets.Osu.Tests.Mods
{
public class TestSceneOsuModDifficultyAdjust : ModTestScene
{
public TestSceneOsuModDifficultyAdjust()
: base(new OsuRuleset())
{
}
[Test]
public void TestNoAdjustment() => CreateModTest(new ModTestData
{
@ -82,5 +77,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Mods
{
return Player.ScoreProcessor.JudgedHits >= 2;
}
protected override Ruleset CreateRuleset() => new OsuRuleset();
}
}

View File

@ -10,11 +10,6 @@ namespace osu.Game.Rulesets.Osu.Tests.Mods
{
public class TestSceneOsuModDoubleTime : ModTestScene
{
public TestSceneOsuModDoubleTime()
: base(new OsuRuleset())
{
}
[TestCase(0.5)]
[TestCase(1.01)]
[TestCase(1.5)]
@ -31,5 +26,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Mods
Precision.AlmostEquals(Player.GameplayClockContainer.GameplayClock.Rate, mod.SpeedChange.Value)
});
}
protected override Ruleset CreateRuleset() => new OsuRuleset();
}
}

View File

@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Mods
public class TestSceneOsuModPerfect : ModPerfectTestScene
{
public TestSceneOsuModPerfect()
: base(new OsuRuleset(), new OsuModPerfect())
: base(new OsuModPerfect())
{
}
@ -48,5 +48,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Mods
CreateHitObjectTest(new HitObjectTestData(spinner), shouldMiss);
}
protected override Ruleset CreateRuleset() => new OsuRuleset();
}
}

View File

@ -19,11 +19,6 @@ namespace osu.Game.Rulesets.Osu.Tests
{
public class TestSceneMissHitWindowJudgements : ModTestScene
{
public TestSceneMissHitWindowJudgements()
: base(new OsuRuleset())
{
}
[Test]
public void TestMissViaEarlyHit()
{
@ -66,6 +61,8 @@ namespace osu.Game.Rulesets.Osu.Tests
});
}
protected override Ruleset CreateRuleset() => new OsuRuleset();
private class TestAutoMod : OsuModAutoplay
{
public override Score CreateReplayScore(IBeatmap beatmap) => new Score

View File

@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.Mods
public class TestSceneTaikoModPerfect : ModPerfectTestScene
{
public TestSceneTaikoModPerfect()
: base(new TestTaikoRuleset(), new TaikoModPerfect())
: base(new TaikoModPerfect())
{
}
@ -29,6 +29,8 @@ namespace osu.Game.Rulesets.Taiko.Tests.Mods
[TestCase(true)]
public void TestSwell(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestData(new Swell { StartTime = 1000, EndTime = 3000 }), shouldMiss);
protected override Ruleset CreateRuleset() => new TestTaikoRuleset();
private class TestTaikoRuleset : TaikoRuleset
{
public override HealthProcessor CreateHealthProcessor(double drainStartTime) => new TestTaikoHealthProcessor();

View File

@ -10,13 +10,10 @@ namespace osu.Game.Tests.Visual
{
public abstract class ModPerfectTestScene : ModTestScene
{
private readonly Ruleset ruleset;
private readonly ModPerfect mod;
protected ModPerfectTestScene(Ruleset ruleset, ModPerfect mod)
: base(ruleset)
protected ModPerfectTestScene(ModPerfect mod)
{
this.ruleset = ruleset;
this.mod = mod;
}
@ -25,7 +22,7 @@ namespace osu.Game.Tests.Visual
Mod = mod,
Beatmap = new Beatmap
{
BeatmapInfo = { Ruleset = ruleset.RulesetInfo },
BeatmapInfo = { Ruleset = Ruleset.Value },
HitObjects = { testData.HitObject }
},
Autoplay = !shouldMiss,

View File

@ -19,11 +19,6 @@ namespace osu.Game.Tests.Visual
typeof(ModTestScene)
};
protected ModTestScene(Ruleset ruleset)
: base(ruleset)
{
}
private ModTestData currentTestData;
protected void CreateModTest(ModTestData testData) => CreateTest(() =>