1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-21 17:57:46 +08:00

Add test coverage for catch relax mod hiding cursor

This commit is contained in:
Bartłomiej Dach 2022-11-30 20:14:35 +01:00
parent 7f68fe429f
commit 77e282ada9
No known key found for this signature in database

View File

@ -4,8 +4,10 @@
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Graphics.Containers;
using osu.Framework.Testing;
using osu.Game.Beatmaps;
using osu.Game.Graphics.Cursor;
using osu.Game.Rulesets.Catch.Mods;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Catch.UI;
@ -55,6 +57,21 @@ namespace osu.Game.Rulesets.Catch.Tests.Mods
}
});
[Test]
public void TestGameCursorHidden()
{
CreateModTest(new ModTestData
{
Mod = new CatchModRelax(),
Autoplay = false,
PassCondition = () =>
{
InputManager.MoveMouseTo(this.ChildrenOfType<DrawableCatchRuleset>().Single());
return this.ChildrenOfType<MenuCursorContainer>().Single().State.Value == Visibility.Hidden;
}
});
}
private bool passCondition()
{
var playfield = this.ChildrenOfType<CatchPlayfield>().Single();