mirror of
https://github.com/osukey/osukey.git
synced 2025-06-07 20:37:57 +09:00
Rename base player test class to RateAdjustedBeatmap, refactor input tests
This commit is contained in:
parent
d80424b1d6
commit
d59ba8cfe9
@ -25,7 +25,7 @@ using osuTK;
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Tests
|
namespace osu.Game.Rulesets.Osu.Tests
|
||||||
{
|
{
|
||||||
public class TestCaseSliderInput : TestCasePlayerBase
|
public class TestCaseSliderInput : TestCaseRateAdjustedBeatmap
|
||||||
{
|
{
|
||||||
public override IReadOnlyList<Type> RequiredTypes => new[]
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||||
{
|
{
|
||||||
@ -47,7 +47,9 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
|
|
||||||
public TestCaseSliderInput()
|
public TestCaseSliderInput()
|
||||||
{
|
{
|
||||||
var slider = new Slider
|
Beatmap.Value = new TestWorkingBeatmap(new Beatmap<OsuHitObject>
|
||||||
|
{
|
||||||
|
HitObjects = { new Slider
|
||||||
{
|
{
|
||||||
StartTime = time_slider_start,
|
StartTime = time_slider_start,
|
||||||
Position = new Vector2(0, 0),
|
Position = new Vector2(0, 0),
|
||||||
@ -56,11 +58,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
Vector2.Zero,
|
Vector2.Zero,
|
||||||
new Vector2(25, 0),
|
new Vector2(25, 0),
|
||||||
}, 25),
|
}, 25),
|
||||||
};
|
}},
|
||||||
|
|
||||||
Beatmap.Value = new TestWorkingBeatmap(new Beatmap<OsuHitObject>
|
|
||||||
{
|
|
||||||
HitObjects = { slider },
|
|
||||||
ControlPointInfo =
|
ControlPointInfo =
|
||||||
{
|
{
|
||||||
DifficultyPoints = { new DifficultyControlPoint { SpeedMultiplier = 0.1f } }
|
DifficultyPoints = { new DifficultyControlPoint { SpeedMultiplier = 0.1f } }
|
||||||
@ -107,7 +105,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
performTest(frames);
|
performTest(frames);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep(() => allJudgedFired, "Wait for test 1");
|
waitForJudged();
|
||||||
AddAssert("Tracking lost", assertMidSliderJudgementFail);
|
AddAssert("Tracking lost", assertMidSliderJudgementFail);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,7 +132,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
performTest(frames);
|
performTest(frames);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep(() => allJudgedFired, "Wait for test 2");
|
waitForJudged();
|
||||||
AddAssert("Tracking retained", assertGreatJudge);
|
AddAssert("Tracking retained", assertGreatJudge);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,7 +159,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
performTest(frames);
|
performTest(frames);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep(() => allJudgedFired, "Wait for test 3");
|
waitForJudged();
|
||||||
AddAssert("Tracking retained", assertGreatJudge);
|
AddAssert("Tracking retained", assertGreatJudge);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,7 +186,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
performTest(frames);
|
performTest(frames);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep(() => allJudgedFired, "Wait for test 4");
|
waitForJudged();
|
||||||
AddAssert("Tracking retained", assertGreatJudge);
|
AddAssert("Tracking retained", assertGreatJudge);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,7 +210,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
performTest(frames);
|
performTest(frames);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep(() => allJudgedFired, "Wait for test 5");
|
waitForJudged();
|
||||||
AddAssert("Tracking retained, sliderhead miss", assertHeadMissTailTracked);
|
AddAssert("Tracking retained, sliderhead miss", assertHeadMissTailTracked);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,7 +240,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
performTest(frames);
|
performTest(frames);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep(() => allJudgedFired, "Wait for test 6");
|
waitForJudged();
|
||||||
AddAssert("Tracking re-acquired", assertMidSliderJudgements);
|
AddAssert("Tracking re-acquired", assertMidSliderJudgements);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -274,7 +272,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
performTest(frames);
|
performTest(frames);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep(() => allJudgedFired, "Wait for test 7");
|
waitForJudged();
|
||||||
AddAssert("Tracking lost", assertMidSliderJudgementFail);
|
AddAssert("Tracking lost", assertMidSliderJudgementFail);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -302,7 +300,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
performTest(frames);
|
performTest(frames);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep(() => allJudgedFired, "Wait for test 8");
|
waitForJudged();
|
||||||
AddAssert("Tracking acquired", assertMidSliderJudgements);
|
AddAssert("Tracking acquired", assertMidSliderJudgements);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -332,7 +330,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
performTest(frames);
|
performTest(frames);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep(() => allJudgedFired, "Wait for test 9");
|
waitForJudged();
|
||||||
AddAssert("Tracking acquired", assertMidSliderJudgements);
|
AddAssert("Tracking acquired", assertMidSliderJudgements);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -363,10 +361,12 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
performTest(frames);
|
performTest(frames);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep(() => allJudgedFired, "Wait for test 10");
|
waitForJudged();
|
||||||
AddAssert("Tracking acquired", assertMidSliderJudgements);
|
AddAssert("Tracking acquired", assertMidSliderJudgements);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void waitForJudged() => AddUntilStep(() => allJudgedFired, "Wait for all judged");
|
||||||
|
|
||||||
private bool assertGreatJudge()
|
private bool assertGreatJudge()
|
||||||
{
|
{
|
||||||
return judgementResults.Last().Type == HitResult.Great;
|
return judgementResults.Last().Type == HitResult.Great;
|
||||||
|
@ -16,7 +16,7 @@ using osuTK.Graphics;
|
|||||||
|
|
||||||
namespace osu.Game.Tests.Visual
|
namespace osu.Game.Tests.Visual
|
||||||
{
|
{
|
||||||
public abstract class TestCasePlayer : TestCasePlayerBase
|
public abstract class TestCasePlayer : TestCaseRateAdjustedBeatmap
|
||||||
{
|
{
|
||||||
private readonly Ruleset ruleset;
|
private readonly Ruleset ruleset;
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
namespace osu.Game.Tests.Visual
|
namespace osu.Game.Tests.Visual
|
||||||
{
|
{
|
||||||
public class TestCasePlayerBase : ScreenTestCase
|
public class TestCaseRateAdjustedBeatmap : ScreenTestCase
|
||||||
{
|
{
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
Loading…
x
Reference in New Issue
Block a user