1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +08:00

Rename and simplify test

This commit is contained in:
Bartłomiej Dach 2020-12-13 23:17:26 +01:00
parent ea09cbddc6
commit d275418b25
2 changed files with 10 additions and 13 deletions

View File

@ -1,7 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. 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<DrawableHitObject> 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<DrawableHitObject> 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>(TObject hitObject)
where TObject : TaikoHitObject

View File

@ -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);
}
}
}