mirror of
https://github.com/ppy/osu.git
synced 2024-11-13 16:47:46 +08:00
Add failing test
This commit is contained in:
parent
8773c2f7eb
commit
93c1a27f22
@ -248,7 +248,8 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
{
|
||||
AddStep("enable hit lighting", () => config.SetValue(OsuSetting.HitLighting, true));
|
||||
AddStep("catch fruit", () => attemptCatch(new Fruit()));
|
||||
AddAssert("correct hit lighting colour", () => catcher.ChildrenOfType<HitExplosion>().First()?.Entry?.ObjectColour == this.ChildrenOfType<DrawableCatchHitObject>().First().AccentColour.Value);
|
||||
AddAssert("correct hit lighting colour",
|
||||
() => catcher.ChildrenOfType<HitExplosion>().First()?.Entry?.ObjectColour == this.ChildrenOfType<DrawableCatchHitObject>().First().AccentColour.Value);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -259,6 +260,16 @@ namespace osu.Game.Rulesets.Catch.Tests
|
||||
AddAssert("no hit lighting", () => !catcher.ChildrenOfType<HitExplosion>().Any());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestAllExplodedObjectsAtUniquePositions()
|
||||
{
|
||||
AddStep("catch normal fruit", () => attemptCatch(new Fruit()));
|
||||
AddStep("catch normal fruit", () => attemptCatch(new Fruit { IndexInBeatmap = 2, LastInCombo = true }));
|
||||
AddAssert("two fruit at distinct x coordinates",
|
||||
() => this.ChildrenOfType<CaughtFruit>().Select(f => f.DrawPosition.X).Distinct(),
|
||||
() => Has.Exactly(2).Items);
|
||||
}
|
||||
|
||||
private void checkPlate(int count) => AddAssert($"{count} objects on the plate", () => catcher.CaughtObjects.Count() == count);
|
||||
|
||||
private void checkState(CatcherAnimationState state) => AddAssert($"catcher state is {state}", () => catcher.CurrentState == state);
|
||||
|
Loading…
Reference in New Issue
Block a user