From 48774960a7d2b16afb01e0c7bc73112290b7cd4e Mon Sep 17 00:00:00 2001 From: qhy040404 Date: Tue, 2 Jan 2024 10:20:57 +0800 Subject: [PATCH] Update GameRegistryContentTest.cs --- .../IncomingFeature/GameRegistryContentTest.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Snap.Hutao/Snap.Hutao.Test/IncomingFeature/GameRegistryContentTest.cs b/src/Snap.Hutao/Snap.Hutao.Test/IncomingFeature/GameRegistryContentTest.cs index 8cf6486b..d04e9749 100644 --- a/src/Snap.Hutao/Snap.Hutao.Test/IncomingFeature/GameRegistryContentTest.cs +++ b/src/Snap.Hutao/Snap.Hutao.Test/IncomingFeature/GameRegistryContentTest.cs @@ -14,10 +14,17 @@ public class GameRegistryContentTest [TestMethod] [SupportedOSPlatform("windows")] public void GetRegistryContent() + { + GetRegistryContentCore(@"Software\miHoYo\原神"); + GetRegistryContentCore(@"Software\miHoYo\Genshin Impact"); + } + + [SupportedOSPlatform("windows")] + private static void GetRegistryContentCore(string subkey) { using (RegistryKey key = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64)) { - RegistryKey? gameKey = key.OpenSubKey(@"Software\miHoYo\原神"); + RegistryKey? gameKey = key.OpenSubKey(subkey); Assert.IsNotNull(gameKey); Dictionary data = []; @@ -37,6 +44,7 @@ public class GameRegistryContentTest Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping, }; + Console.WriteLine($"Subkey: {subkey}"); Console.WriteLine(JsonSerializer.Serialize(data, options)); } }