1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 08:27:49 +08:00

Add test for expire delay

Delaying the expiry of the drawable hitobject can potentially be dangerous and gameplay-altering when user inputs are accidentally handled. This is why I found a test necessary.
This commit is contained in:
Joppe27 2022-12-11 02:23:48 +01:00
parent cd97e6be0b
commit ac770157cc

View File

@ -0,0 +1,41 @@
// 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.Collections.Generic;
using NUnit.Framework;
using osu.Game.Rulesets.Replays;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Taiko.Objects;
using osu.Game.Rulesets.Taiko.Replays;
using osu.Game.Rulesets.Taiko.Tests.Judgements;
namespace osu.Game.Rulesets.Taiko.Tests.Skinning
{
public partial class TestSceneDrawableSwellExpireDelay : JudgementTest
{
[Test]
public void TestExpireDelay()
{
const double swell_start = 1000;
const double swell_duration = 1000;
Swell swell = new Swell
{
StartTime = swell_start,
Duration = swell_duration,
};
Hit hit = new Hit { StartTime = swell_start + swell_duration + 50 };
List<ReplayFrame> frames = new List<ReplayFrame>
{
new TaikoReplayFrame(0),
new TaikoReplayFrame(2100, TaikoAction.LeftCentre),
};
PerformTest(frames, CreateBeatmap(swell, hit));
AssertResult<Hit>(0, HitResult.Ok);
}
}
}