From 93c1a27f226101b37685ff67166d01d71982f43e Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Tue, 13 Aug 2024 18:34:15 +0900 Subject: [PATCH] Add failing test --- osu.Game.Rulesets.Catch.Tests/TestSceneCatcher.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch.Tests/TestSceneCatcher.cs b/osu.Game.Rulesets.Catch.Tests/TestSceneCatcher.cs index b03fa00f76..3eff7ca017 100644 --- a/osu.Game.Rulesets.Catch.Tests/TestSceneCatcher.cs +++ b/osu.Game.Rulesets.Catch.Tests/TestSceneCatcher.cs @@ -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().First()?.Entry?.ObjectColour == this.ChildrenOfType().First().AccentColour.Value); + AddAssert("correct hit lighting colour", + () => catcher.ChildrenOfType().First()?.Entry?.ObjectColour == this.ChildrenOfType().First().AccentColour.Value); } [Test] @@ -259,6 +260,16 @@ namespace osu.Game.Rulesets.Catch.Tests AddAssert("no hit lighting", () => !catcher.ChildrenOfType().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().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);