A game framework written with osu! in mind.
1// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
2// See the LICENCE file in the repository root for full licence text.
3
4using NUnit.Framework;
5using osu.Framework.Input.Bindings;
6
7namespace osu.Framework.Tests.Input
8{
9 [TestFixture]
10 public class KeyCombinationTest
11 {
12 private static readonly object[][] key_combination_display_test_cases =
13 {
14 new object[] { new KeyCombination(InputKey.Alt, InputKey.F4), "Alt-F4" },
15 new object[] { new KeyCombination(InputKey.D, InputKey.Control), "Ctrl-D" },
16 new object[] { new KeyCombination(InputKey.Shift, InputKey.F, InputKey.Control), "Ctrl-Shift-F" },
17 new object[] { new KeyCombination(InputKey.Alt, InputKey.Control, InputKey.Super, InputKey.Shift), "Ctrl-Alt-Shift-Win" },
18 new object[] { new KeyCombination(InputKey.LAlt, InputKey.F4), "LAlt-F4" },
19 new object[] { new KeyCombination(InputKey.D, InputKey.LControl), "LCtrl-D" },
20 new object[] { new KeyCombination(InputKey.LShift, InputKey.F, InputKey.LControl), "LCtrl-LShift-F" },
21 new object[] { new KeyCombination(InputKey.LAlt, InputKey.LControl, InputKey.LSuper, InputKey.LShift), "LCtrl-LAlt-LShift-LWin" },
22 new object[] { new KeyCombination(InputKey.Alt, InputKey.LAlt, InputKey.RControl, InputKey.A), "RCtrl-LAlt-A" },
23 new object[] { new KeyCombination(InputKey.Shift, InputKey.LControl, InputKey.X), "LCtrl-Shift-X" },
24 new object[] { new KeyCombination(InputKey.Control, InputKey.Shift, InputKey.Alt, InputKey.Super, InputKey.LAlt, InputKey.RShift, InputKey.LSuper), "Ctrl-LAlt-RShift-LWin" },
25 };
26
27 [TestCaseSource(nameof(key_combination_display_test_cases))]
28 public void TestKeyCombinationDisplayOrder(KeyCombination keyCombination, string expectedRepresentation)
29 => Assert.That(keyCombination.ReadableString(), Is.EqualTo(expectedRepresentation));
30 }
31}