From 8e5e86e61ab8aaca3077b84a50001f33430354c7 Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Sat, 8 Jul 2023 20:15:52 +0200 Subject: [PATCH] Convert SoftwareKeyboardTests to xUnit --- .../HLE/SoftwareKeyboardTests.cs | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Ryujinx.Tests/HLE/SoftwareKeyboardTests.cs b/src/Ryujinx.Tests/HLE/SoftwareKeyboardTests.cs index 79ca2d480..d06d8009c 100644 --- a/src/Ryujinx.Tests/HLE/SoftwareKeyboardTests.cs +++ b/src/Ryujinx.Tests/HLE/SoftwareKeyboardTests.cs @@ -1,24 +1,24 @@ -using NUnit.Framework; using Ryujinx.HLE.HOS.Applets; using System.Text; +using Xunit; namespace Ryujinx.Tests.HLE { public class SoftwareKeyboardTests { - [Test] + [Fact] public void StripUnicodeControlCodes_NullInput() { - Assert.IsNull(SoftwareKeyboardApplet.StripUnicodeControlCodes(null)); + Assert.Null(SoftwareKeyboardApplet.StripUnicodeControlCodes(null)); } - [Test] + [Fact] public void StripUnicodeControlCodes_EmptyInput() { - Assert.AreEqual(string.Empty, SoftwareKeyboardApplet.StripUnicodeControlCodes(string.Empty)); + Assert.Equal(string.Empty, SoftwareKeyboardApplet.StripUnicodeControlCodes(string.Empty)); } - [Test] + [Fact] public void StripUnicodeControlCodes_Passthrough() { string[] prompts = { @@ -34,37 +34,37 @@ namespace Ryujinx.Tests.HLE foreach (string prompt in prompts) { - Assert.AreEqual(prompt, SoftwareKeyboardApplet.StripUnicodeControlCodes(prompt)); + Assert.Equal(prompt, SoftwareKeyboardApplet.StripUnicodeControlCodes(prompt)); } } - [Test] + [Fact] public void StripUnicodeControlCodes_StripsNewlines() { - Assert.AreEqual("I am very tall", SoftwareKeyboardApplet.StripUnicodeControlCodes("I \r\nam \r\nvery \r\ntall")); + Assert.Equal("I am very tall", SoftwareKeyboardApplet.StripUnicodeControlCodes("I \r\nam \r\nvery \r\ntall")); } - [Test] + [Fact] public void StripUnicodeControlCodes_StripsDeviceControls() { // 0x13 is control code DC3 used by some games string specialInput = Encoding.UTF8.GetString(new byte[] { 0x13, 0x53, 0x68, 0x69, 0x6E, 0x65, 0x13 }); - Assert.AreEqual("Shine", SoftwareKeyboardApplet.StripUnicodeControlCodes(specialInput)); + Assert.Equal("Shine", SoftwareKeyboardApplet.StripUnicodeControlCodes(specialInput)); } - [Test] + [Fact] public void StripUnicodeControlCodes_StripsToEmptyString() { string specialInput = Encoding.UTF8.GetString(new byte[] { 17, 18, 19, 20 }); // DC1 - DC4 special codes - Assert.AreEqual(string.Empty, SoftwareKeyboardApplet.StripUnicodeControlCodes(specialInput)); + Assert.Equal(string.Empty, SoftwareKeyboardApplet.StripUnicodeControlCodes(specialInput)); } - [Test] + [Fact] public void StripUnicodeControlCodes_PreservesMultiCodePoints() { // Turtles are a good example of multi-codepoint Unicode chars string specialInput = "♀ 🐢 🐢 ♂ "; - Assert.AreEqual(specialInput, SoftwareKeyboardApplet.StripUnicodeControlCodes(specialInput)); + Assert.Equal(specialInput, SoftwareKeyboardApplet.StripUnicodeControlCodes(specialInput)); } } }