Skip to content

Commit

Permalink
Update tests in line with new structure
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed May 14, 2024
1 parent a67bc51 commit 2be5ecc
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions osu.Game.Rulesets.Mania.Tests/Mods/TestSceneModTouchDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System.Linq;
using NUnit.Framework;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input;
using osu.Framework.Testing;
using osu.Game.Rulesets.Mania.UI;
Expand All @@ -16,18 +17,10 @@ public partial class TestSceneModTouchDevice : ModTestScene
protected override Ruleset CreatePlayerRuleset() => new ManiaRuleset();

[Test]
public void TestOverlayVisibleWithMod() => CreateModTest(new ModTestData
public void TestTouchAreaNotInitiallyVisible() => CreateModTest(new ModTestData
{
Mod = new ModTouchDevice(),
Autoplay = false,
PassCondition = () => getTouchOverlay()?.IsPresent == true
});

[Test]
public void TestOverlayNotVisibleWithoutMod() => CreateModTest(new ModTestData
{
Autoplay = false,
PassCondition = () => getTouchOverlay()?.IsPresent == false
PassCondition = () => getTouchOverlay()?.State.Value == Visibility.Hidden
});

[Test]
Expand All @@ -40,6 +33,8 @@ public void TestPressReceptors()
PassCondition = () => true
});

AddAssert("touch area not visible", () => getTouchOverlay()?.State.Value == Visibility.Hidden);

for (int i = 0; i < 4; i++)
{
int index = i;
Expand All @@ -51,6 +46,8 @@ public void TestPressReceptors()
() => Does.Contain(getReceptor(index).Action.Value));

AddStep($"release receptor {index}", () => InputManager.EndTouch(new Touch(TouchSource.Touch1, getReceptor(index).ScreenSpaceDrawQuad.Centre)));

AddAssert("touch area visible", () => getTouchOverlay()?.State.Value == Visibility.Visible);
}
}

Expand Down

0 comments on commit 2be5ecc

Please sign in to comment.