|
3 | 3 |
|
4 | 4 | using System.Linq;
|
5 | 5 | using NUnit.Framework;
|
6 |
| -using osu.Framework.Graphics.Containers; |
7 | 6 | using osu.Framework.Input;
|
8 | 7 | using osu.Framework.Testing;
|
9 | 8 | using osu.Game.Rulesets.Mania.UI;
|
10 | 9 | using osu.Game.Tests.Visual;
|
11 | 10 |
|
12 | 11 | namespace osu.Game.Rulesets.Mania.Tests
|
13 | 12 | {
|
14 |
| - public partial class TestSceneManiaTouchInputArea : PlayerTestScene |
| 13 | + public partial class TestSceneManiaTouchInput : PlayerTestScene |
15 | 14 | {
|
16 | 15 | protected override Ruleset CreatePlayerRuleset() => new ManiaRuleset();
|
17 | 16 |
|
18 | 17 | [Test]
|
19 |
| - public void TestTouchAreaNotInitiallyVisible() |
| 18 | + public void TestPressColumns() |
20 | 19 | {
|
21 |
| - AddAssert("touch area not visible", () => getTouchOverlay()?.State.Value == Visibility.Hidden); |
22 |
| - } |
23 |
| - |
24 |
| - [Test] |
25 |
| - public void TestPressReceptors() |
26 |
| - { |
27 |
| - AddAssert("touch area not visible", () => getTouchOverlay()?.State.Value == Visibility.Hidden); |
28 |
| - |
29 | 20 | for (int i = 0; i < 4; i++)
|
30 | 21 | {
|
31 | 22 | int index = i;
|
32 | 23 |
|
33 |
| - AddStep($"touch receptor {index}", () => InputManager.BeginTouch(new Touch(TouchSource.Touch1, getReceptor(index).ScreenSpaceDrawQuad.Centre))); |
| 24 | + AddStep($"touch column {index}", () => InputManager.BeginTouch(new Touch(TouchSource.Touch1, getColumn(index).ScreenSpaceDrawQuad.Centre))); |
34 | 25 |
|
35 | 26 | AddAssert("action sent",
|
36 | 27 | () => this.ChildrenOfType<ManiaInputManager>().SelectMany(m => m.KeyBindingContainer.PressedActions),
|
37 |
| - () => Does.Contain(getReceptor(index).Action.Value)); |
| 28 | + () => Does.Contain(getColumn(index).Action.Value)); |
38 | 29 |
|
39 |
| - AddStep($"release receptor {index}", () => InputManager.EndTouch(new Touch(TouchSource.Touch1, getReceptor(index).ScreenSpaceDrawQuad.Centre))); |
| 30 | + AddStep($"release receptor {index}", () => InputManager.EndTouch(new Touch(TouchSource.Touch1, getColumn(index).ScreenSpaceDrawQuad.Centre))); |
40 | 31 |
|
41 |
| - AddAssert("touch area visible", () => getTouchOverlay()?.State.Value == Visibility.Visible); |
| 32 | + AddAssert("action released", |
| 33 | + () => this.ChildrenOfType<ManiaInputManager>().SelectMany(m => m.KeyBindingContainer.PressedActions), |
| 34 | + () => Does.Not.Contain(getColumn(index).Action.Value)); |
42 | 35 | }
|
43 | 36 | }
|
44 | 37 |
|
45 |
| - private ManiaTouchInputArea? getTouchOverlay() => this.ChildrenOfType<ManiaTouchInputArea>().SingleOrDefault(); |
46 |
| - |
47 |
| - private ManiaTouchInputArea.ColumnInputReceptor getReceptor(int index) => this.ChildrenOfType<ManiaTouchInputArea.ColumnInputReceptor>().ElementAt(index); |
| 38 | + private Column getColumn(int index) => this.ChildrenOfType<Column>().ElementAt(index); |
48 | 39 | }
|
49 | 40 | }
|
0 commit comments