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

Rename data class

This commit is contained in:
Dean Herbert 2020-03-11 00:36:56 +09:00
parent 66a0f3334d
commit 0be423183d
5 changed files with 18 additions and 18 deletions

View File

@ -20,11 +20,11 @@ namespace osu.Game.Rulesets.Catch.Tests.Mods
[TestCase(false)] [TestCase(false)]
[TestCase(true)] [TestCase(true)]
public void TestBananaShower(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestCase(new BananaShower { StartTime = 1000, EndTime = 3000 }, false), shouldMiss); public void TestBananaShower(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestData(new BananaShower { StartTime = 1000, EndTime = 3000 }, false), shouldMiss);
[TestCase(false)] [TestCase(false)]
[TestCase(true)] [TestCase(true)]
public void TestFruit(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestCase(new Fruit { StartTime = 1000 }), shouldMiss); public void TestFruit(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestData(new Fruit { StartTime = 1000 }), shouldMiss);
[TestCase(false)] [TestCase(false)]
[TestCase(true)] [TestCase(true)]
@ -40,15 +40,15 @@ namespace osu.Game.Rulesets.Catch.Tests.Mods
}) })
}; };
CreateHitObjectTest(new HitObjectTestCase(stream), shouldMiss); CreateHitObjectTest(new HitObjectTestData(stream), shouldMiss);
} }
// We only care about testing misses, hits are tested via JuiceStream // We only care about testing misses, hits are tested via JuiceStream
[TestCase(true)] [TestCase(true)]
public void TestDroplet(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestCase(new Droplet { StartTime = 1000 }), shouldMiss); public void TestDroplet(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestData(new Droplet { StartTime = 1000 }), shouldMiss);
// We only care about testing misses, hits are tested via JuiceStream // We only care about testing misses, hits are tested via JuiceStream
[TestCase(true)] [TestCase(true)]
public void TestTinyDroplet(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestCase(new TinyDroplet { StartTime = 1000 }), shouldMiss); public void TestTinyDroplet(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestData(new TinyDroplet { StartTime = 1000 }), shouldMiss);
} }
} }

View File

@ -17,10 +17,10 @@ namespace osu.Game.Rulesets.Mania.Tests.Mods
[TestCase(false)] [TestCase(false)]
[TestCase(true)] [TestCase(true)]
public void TestNote(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestCase(new Note { StartTime = 1000 }), shouldMiss); public void TestNote(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestData(new Note { StartTime = 1000 }), shouldMiss);
[TestCase(false)] [TestCase(false)]
[TestCase(true)] [TestCase(true)]
public void TestHoldNote(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestCase(new HoldNote { StartTime = 1000, EndTime = 3000 }), shouldMiss); public void TestHoldNote(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestData(new HoldNote { StartTime = 1000, EndTime = 3000 }), shouldMiss);
} }
} }

View File

@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Mods
[TestCase(false)] [TestCase(false)]
[TestCase(true)] [TestCase(true)]
public void TestHitCircle(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestCase(new HitCircle { StartTime = 1000 }), shouldMiss); public void TestHitCircle(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestData(new HitCircle { StartTime = 1000 }), shouldMiss);
[TestCase(false)] [TestCase(false)]
[TestCase(true)] [TestCase(true)]
@ -32,7 +32,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Mods
Path = new SliderPath(PathType.Linear, new[] { Vector2.Zero, new Vector2(100, 0), }) Path = new SliderPath(PathType.Linear, new[] { Vector2.Zero, new Vector2(100, 0), })
}; };
CreateHitObjectTest(new HitObjectTestCase(slider), shouldMiss); CreateHitObjectTest(new HitObjectTestData(slider), shouldMiss);
} }
[TestCase(false)] [TestCase(false)]
@ -46,7 +46,7 @@ namespace osu.Game.Rulesets.Osu.Tests.Mods
Position = new Vector2(256, 192) Position = new Vector2(256, 192)
}; };
CreateHitObjectTest(new HitObjectTestCase(spinner), shouldMiss); CreateHitObjectTest(new HitObjectTestData(spinner), shouldMiss);
} }
} }
} }

View File

@ -19,15 +19,15 @@ namespace osu.Game.Rulesets.Taiko.Tests.Mods
[TestCase(false)] [TestCase(false)]
[TestCase(true)] [TestCase(true)]
public void TestHit(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestCase(new CentreHit { StartTime = 1000 }), shouldMiss); public void TestHit(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestData(new CentreHit { StartTime = 1000 }), shouldMiss);
[TestCase(false)] [TestCase(false)]
[TestCase(true)] [TestCase(true)]
public void TestDrumRoll(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestCase(new DrumRoll { StartTime = 1000, EndTime = 3000 }), shouldMiss); public void TestDrumRoll(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestData(new DrumRoll { StartTime = 1000, EndTime = 3000 }), shouldMiss);
[TestCase(false)] [TestCase(false)]
[TestCase(true)] [TestCase(true)]
public void TestSwell(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestCase(new Swell { StartTime = 1000, EndTime = 3000 }), shouldMiss); public void TestSwell(bool shouldMiss) => CreateHitObjectTest(new HitObjectTestData(new Swell { StartTime = 1000, EndTime = 3000 }), shouldMiss);
private class TestTaikoRuleset : TaikoRuleset private class TestTaikoRuleset : TaikoRuleset
{ {

View File

@ -20,16 +20,16 @@ namespace osu.Game.Tests.Visual
this.mod = mod; this.mod = mod;
} }
protected void CreateHitObjectTest(HitObjectTestCase testCaseData, bool shouldMiss) => CreateModTest(new ModTestData protected void CreateHitObjectTest(HitObjectTestData testData, bool shouldMiss) => CreateModTest(new ModTestData
{ {
Mod = mod, Mod = mod,
Beatmap = new Beatmap Beatmap = new Beatmap
{ {
BeatmapInfo = { Ruleset = ruleset.RulesetInfo }, BeatmapInfo = { Ruleset = ruleset.RulesetInfo },
HitObjects = { testCaseData.HitObject } HitObjects = { testData.HitObject }
}, },
Autoplay = !shouldMiss, Autoplay = !shouldMiss,
PassCondition = () => ((PerfectModTestPlayer)Player).CheckFailed(shouldMiss && testCaseData.FailOnMiss) PassCondition = () => ((PerfectModTestPlayer)Player).CheckFailed(shouldMiss && testData.FailOnMiss)
}); });
protected override TestPlayer CreateModPlayer(Ruleset ruleset) => new PerfectModTestPlayer(); protected override TestPlayer CreateModPlayer(Ruleset ruleset) => new PerfectModTestPlayer();
@ -52,12 +52,12 @@ namespace osu.Game.Tests.Visual
} }
} }
protected class HitObjectTestCase protected class HitObjectTestData
{ {
public readonly HitObject HitObject; public readonly HitObject HitObject;
public readonly bool FailOnMiss; public readonly bool FailOnMiss;
public HitObjectTestCase(HitObject hitObject, bool failOnMiss = true) public HitObjectTestData(HitObject hitObject, bool failOnMiss = true)
{ {
HitObject = hitObject; HitObject = hitObject;
FailOnMiss = failOnMiss; FailOnMiss = failOnMiss;