From d275418b2598c14f5a217cf96ec45887ad4b7409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Sun, 13 Dec 2020 23:17:26 +0100 Subject: [PATCH] Rename and simplify test --- .../HitObjectApplicationTestScene.cs | 9 ++++----- ...plication.cs => TestSceneBarLineApplication.cs} | 14 ++++++-------- 2 files changed, 10 insertions(+), 13 deletions(-) rename osu.Game.Rulesets.Taiko.Tests/{TestBarLineApplication.cs => TestSceneBarLineApplication.cs} (68%) diff --git a/osu.Game.Rulesets.Taiko.Tests/HitObjectApplicationTestScene.cs b/osu.Game.Rulesets.Taiko.Tests/HitObjectApplicationTestScene.cs index 8e1b01385a..07c7b4d1db 100644 --- a/osu.Game.Rulesets.Taiko.Tests/HitObjectApplicationTestScene.cs +++ b/osu.Game.Rulesets.Taiko.Tests/HitObjectApplicationTestScene.cs @@ -1,7 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Testing; @@ -37,11 +36,11 @@ namespace osu.Game.Rulesets.Taiko.Tests Clock = new FramedClock(new StopwatchClock()) }); - protected void AddHitObject(Func hitObject) - => AddStep("add to SHOC", () => hitObjectContainer.Add(hitObject.Invoke())); + protected void AddHitObject(DrawableHitObject hitObject) + => AddStep("add to SHOC", () => hitObjectContainer.Add(hitObject)); - protected void RemoveHitObject(Func hitObject) - => AddStep("remove from SHOC", () => hitObjectContainer.Remove(hitObject.Invoke())); + protected void RemoveHitObject(DrawableHitObject hitObject) + => AddStep("remove from SHOC", () => hitObjectContainer.Remove(hitObject)); protected TObject PrepareObject(TObject hitObject) where TObject : TaikoHitObject diff --git a/osu.Game.Rulesets.Taiko.Tests/TestBarLineApplication.cs b/osu.Game.Rulesets.Taiko.Tests/TestSceneBarLineApplication.cs similarity index 68% rename from osu.Game.Rulesets.Taiko.Tests/TestBarLineApplication.cs rename to osu.Game.Rulesets.Taiko.Tests/TestSceneBarLineApplication.cs index 3e5a956d64..65230a07bc 100644 --- a/osu.Game.Rulesets.Taiko.Tests/TestBarLineApplication.cs +++ b/osu.Game.Rulesets.Taiko.Tests/TestSceneBarLineApplication.cs @@ -7,28 +7,26 @@ using osu.Game.Rulesets.Taiko.Objects.Drawables; namespace osu.Game.Rulesets.Taiko.Tests { - public class TestBarLineApplication : HitObjectApplicationTestScene + public class TestSceneBarLineApplication : HitObjectApplicationTestScene { [Test] public void TestApplyNewBarLine() { - DrawableBarLine barLine = null; - - AddHitObject(() => barLine = new DrawableBarLine(PrepareObject(new BarLine + DrawableBarLine barLine = new DrawableBarLine(PrepareObject(new BarLine { StartTime = 400, Major = true - }))); + })); - RemoveHitObject(() => barLine); + AddHitObject(barLine); + RemoveHitObject(barLine); AddStep("apply new bar line", () => barLine.Apply(PrepareObject(new BarLine { StartTime = 200, Major = false }), null)); - - AddHitObject(() => barLine); + AddHitObject(barLine); } } }