Files
RobustToolbox/Robust.UnitTesting/Client/Input/KeyboardTest.cs
T
Pieter-Jan Briers e80b6a238d Add Keyboard.Key.IsMouseKey().
I needed this for something but didn't end up using it, whatever.
2020-09-07 10:55:40 +02:00

26 lines
741 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using Robust.Client.Input;
namespace Robust.UnitTesting.Client.Input
{
[Parallelizable(ParallelScope.All)]
public class KeyboardTest
{
public static IEnumerable<object[]> TestCases =>
((Keyboard.Key[]) Enum.GetValues(typeof(Keyboard.Key)))
.Where(p => p.ToString().Contains("Mouse"))
.Select(p => new object[] {p, true});
[Test]
[TestCaseSource(nameof(TestCases))]
[TestCase(Keyboard.Key.A, false)]
public void TestKeyboardIsMouseKey(Keyboard.Key key, bool isMouse)
{
Assert.That(key.IsMouseKey(), Is.EqualTo(isMouse));
}
}
}