From 0d62db3c4075f55035cd4d0d292adcd941f0fb0e Mon Sep 17 00:00:00 2001 From: m4-used-rollout Date: Sat, 24 Feb 2024 01:25:34 +0000 Subject: [PATCH] Added sanity test for every button profile --- tests/TPP.Inputting.Tests/Parsing/ButtonMappingTest.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/TPP.Inputting.Tests/Parsing/ButtonMappingTest.cs b/tests/TPP.Inputting.Tests/Parsing/ButtonMappingTest.cs index e984601b..48531ee7 100644 --- a/tests/TPP.Inputting.Tests/Parsing/ButtonMappingTest.cs +++ b/tests/TPP.Inputting.Tests/Parsing/ButtonMappingTest.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Immutable; using NUnit.Framework; using TPP.Core; @@ -32,6 +33,14 @@ private void AssertEmptyMap(string rawInput, string? message = null) Assert.That(mappedInputs.Keys, Has.Count.EqualTo(2), message ?? "Mapped output should contain no buttons."); } + [Test] + public void TestBuildEveryProfile() + { + foreach (string profile in Enum.GetNames()) { + Assert.DoesNotThrow(() => Enum.Parse(profile).ToInputParserBuilder().Build(), $"Button Profile {profile} failed to build."); + } + } + [Test] public void TestGameBoy() {