mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
Rename and simplify test
This commit is contained in:
parent
ea09cbddc6
commit
d275418b25
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user