1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-16 11:47:52 +08:00
osu-lazer/osu.Game.Rulesets.Taiko.Tests/Mods/TestSceneTaikoModFlashlight.cs

57 lines
2.1 KiB
C#
Raw Normal View History

2022-10-14 07:38:43 +08:00
// 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.
2022-10-26 01:53:05 +08:00
using System.Linq;
2022-10-14 07:38:43 +08:00
using NUnit.Framework;
2022-10-26 01:53:05 +08:00
using osu.Framework.Testing;
2022-10-14 07:38:43 +08:00
using osu.Game.Rulesets.Taiko.Mods;
2022-10-26 01:53:05 +08:00
using osu.Game.Rulesets.Taiko.UI;
using osuTK;
2022-10-14 07:38:43 +08:00
namespace osu.Game.Rulesets.Taiko.Tests.Mods
{
2022-11-24 13:32:20 +08:00
public partial class TestSceneTaikoModFlashlight : TaikoModTestScene
2022-10-14 07:38:43 +08:00
{
[TestCase(1f)]
[TestCase(0.5f)]
[TestCase(1.25f)]
[TestCase(1.5f)]
public void TestSizeMultiplier(float sizeMultiplier) => CreateModTest(new ModTestData { Mod = new TaikoModFlashlight { SizeMultiplier = { Value = sizeMultiplier } }, PassCondition = () => true });
[Test]
public void TestComboBasedSize([Values] bool comboBasedSize) => CreateModTest(new ModTestData { Mod = new TaikoModFlashlight { ComboBasedSize = { Value = comboBasedSize } }, PassCondition = () => true });
2022-10-26 01:53:05 +08:00
[Test]
public void TestFlashlightAlwaysHasNonZeroSize()
{
bool failed = false;
CreateModTest(new ModTestData
{
Mod = new TestTaikoModFlashlight { ComboBasedSize = { Value = true } },
Autoplay = false,
PassCondition = () =>
{
failed |= this.ChildrenOfType<TestTaikoModFlashlight.TestTaikoFlashlight>().SingleOrDefault()?.FlashlightSize.Y == 0;
return !failed;
}
});
}
2022-11-24 13:32:20 +08:00
private partial class TestTaikoModFlashlight : TaikoModFlashlight
2022-10-26 01:53:05 +08:00
{
protected override Flashlight CreateFlashlight() => new TestTaikoFlashlight(this, Playfield);
2022-11-24 13:32:20 +08:00
public partial class TestTaikoFlashlight : TaikoFlashlight
2022-10-26 01:53:05 +08:00
{
public TestTaikoFlashlight(TaikoModFlashlight modFlashlight, TaikoPlayfield taikoPlayfield)
: base(modFlashlight, taikoPlayfield)
{
}
public new Vector2 FlashlightSize => base.FlashlightSize;
}
}
2022-10-14 07:38:43 +08:00
}
}