From 39b9c2ce904b1211d7fc67cb4b6cb2e870d409af Mon Sep 17 00:00:00 2001 From: AnakinRaW Date: Thu, 11 Dec 2025 16:15:44 +0100 Subject: [PATCH 1/7] make public --- .../Utilities/GameExecutableFileUtilities.cs | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/PG.StarWarsGame.Infrastructure/Clients/Utilities/GameExecutableFileUtilities.cs b/src/PG.StarWarsGame.Infrastructure/Clients/Utilities/GameExecutableFileUtilities.cs index f6f7e1a8..442b0446 100644 --- a/src/PG.StarWarsGame.Infrastructure/Clients/Utilities/GameExecutableFileUtilities.cs +++ b/src/PG.StarWarsGame.Infrastructure/Clients/Utilities/GameExecutableFileUtilities.cs @@ -6,32 +6,43 @@ namespace PG.StarWarsGame.Infrastructure.Clients.Utilities; -internal class GameExecutableFileUtilities +/// +/// Provides utility methods for locating game executable files for different game platforms and build types. +/// +public static class GameExecutableFileUtilities { private const string SteamFileNameBase = "StarWars"; private const string SteamReleaseSuffix = "G"; private const string SteamDebugSuffix = "I"; + /// + /// Gets the executable file for the specified game and build type or if not found. + /// + /// The game for which to locate the executable file. + /// The build type of the game executable to locate. + /// An representing the executable file if found; otherwise, . + /// is . public static IFileInfo? GetExecutableForGame(IGame game, GameBuildType buildType) { - var exeFileName = GetExecutableFileName(game, buildType); + if (game == null) + throw new ArgumentNullException(nameof(game)); - if (string.IsNullOrEmpty(exeFileName)) + // Only SteamGold supports debug builds + if (buildType == GameBuildType.Debug && game.Platform != GamePlatform.SteamGold) return null; + var exeFileName = GetExecutableFileName(game, buildType); + return game.Directory - .EnumerateFiles(exeFileName!, SearchOption.TopDirectoryOnly) + .EnumerateFiles(exeFileName, SearchOption.TopDirectoryOnly) .FirstOrDefault(); } - private static string? GetExecutableFileName(IGame game, GameBuildType buildType) + private static string GetExecutableFileName(IGame game, GameBuildType buildType) { if (game.Platform == GamePlatform.SteamGold) return GetSteamFileName(buildType); - if (buildType is GameBuildType.Debug) - return null; - return game.Type switch { GameType.Eaw => PetroglyphStarWarsGameConstants.EmpireAtWarExeFileName, From 6c1048abe1f51d2f8bbed3561fb88dae483bfd4e Mon Sep 17 00:00:00 2001 From: AnakinRaW Date: Thu, 11 Dec 2025 16:16:05 +0100 Subject: [PATCH 2/7] resolve code warnings --- .../SteamAbstractionLayer.cs | 2 +- src/AET.SteamAbstraction/SteamWrapper.cs | 2 +- .../Vdf/Linq/VConditional.cs | 2 +- src/AET.SteamAbstraction/Vdf/Linq/VObject.cs | 2 +- .../Clients/Arguments/GameArgumentNames.cs | 2 ++ .../Arguments/GameArguments/AILogStyle.cs | 1 + .../Arguments/GameArguments/GameArguments.cs | 4 +++- .../Games/PetroglyphStarWarsGame.cs | 9 ++++----- .../Games/Registry/GameRegistry.cs | 2 ++ .../IModContainer.cs | 3 ++- .../Mods/ModBase.cs | 4 +--- .../PlayableObject.cs | 17 +++++++---------- .../Services/ModFactory.cs | 6 +++--- .../CallerArgumentExpressionAttribute.cs | 2 ++ .../SteamWrapperTestBase.cs | 2 +- .../TestProcessHelper.cs | 4 ++-- .../SteamPetroglyphStarWarsGameClientTest.cs | 2 +- .../Clients/Arguments/ArgumentCollectionTest.cs | 2 +- .../Clients/Arguments/GameArgumentTestBase.cs | 2 +- .../Arguments/GameArgumentsBuilderTest.cs | 2 +- .../Clients/PetroglyphStarWarsGameClientTest.cs | 2 +- .../Clients/Processes/GameProcessTest.cs | 4 ++-- .../Detection/CustomGameDetectorTest.cs | 2 +- .../GameServices/GameFactoryTest.cs | 12 ++++++------ .../ModBaseTest.cs | 8 +++----- .../ModServices/ModGameTypeResolverTestBase.cs | 2 +- ...troglyphGameInfrastructureIntegrationTest.cs | 2 +- .../VirtualModTest.cs | 2 +- .../GITestUtilities.cs | 1 + .../Mods/ModInstallations.Modinfo.cs | 2 +- .../TestBases/CommonTestBase.cs | 2 +- .../TestBases/GameDetectorTestBase.cs | 2 +- .../PlatformSpecificFactAttribute.cs | 2 +- .../PlatformSpecificTheoryAttribute.cs | 2 +- 34 files changed, 60 insertions(+), 57 deletions(-) diff --git a/src/AET.SteamAbstraction/SteamAbstractionLayer.cs b/src/AET.SteamAbstraction/SteamAbstractionLayer.cs index c41b40c8..c0e249d6 100644 --- a/src/AET.SteamAbstraction/SteamAbstractionLayer.cs +++ b/src/AET.SteamAbstraction/SteamAbstractionLayer.cs @@ -19,7 +19,7 @@ public static void InitializeServices(IServiceCollection serviceCollection) { serviceCollection.AddSingleton(sp => new SteamWrapperFactory(sp)); serviceCollection.AddSingleton(sp => new SteamRegistryFactory(sp)); - serviceCollection.AddSingleton(sp => new ProcessHelper()); + serviceCollection.AddSingleton(new ProcessHelper()); serviceCollection.AddSingleton(sp => new SteamLibraryFinder(sp)); } } \ No newline at end of file diff --git a/src/AET.SteamAbstraction/SteamWrapper.cs b/src/AET.SteamAbstraction/SteamWrapper.cs index 765aa3c8..b04da866 100644 --- a/src/AET.SteamAbstraction/SteamWrapper.cs +++ b/src/AET.SteamAbstraction/SteamWrapper.cs @@ -51,7 +51,7 @@ public bool? UserWantsOfflineMode try { var config = SteamVdfReader.ReadLoginUsers(FileSystem.FileInfo.New(configFile)); - return config.Users.Any(user => user.MostRecent && user.UserWantsOffline); + return config.Users.Any(user => user is { MostRecent: true, UserWantsOffline: true }); } catch (SteamException) { diff --git a/src/AET.SteamAbstraction/Vdf/Linq/VConditional.cs b/src/AET.SteamAbstraction/Vdf/Linq/VConditional.cs index d7e5ced9..4a2c1f60 100644 --- a/src/AET.SteamAbstraction/Vdf/Linq/VConditional.cs +++ b/src/AET.SteamAbstraction/Vdf/Linq/VConditional.cs @@ -8,7 +8,7 @@ namespace AET.SteamAbstraction.Vdf.Linq; internal class VConditional : VToken { - private readonly List _tokens = new(); + private readonly List _tokens = []; public override VTokenType Type => VTokenType.Conditional; diff --git a/src/AET.SteamAbstraction/Vdf/Linq/VObject.cs b/src/AET.SteamAbstraction/Vdf/Linq/VObject.cs index 17b707c7..57621c62 100644 --- a/src/AET.SteamAbstraction/Vdf/Linq/VObject.cs +++ b/src/AET.SteamAbstraction/Vdf/Linq/VObject.cs @@ -75,7 +75,7 @@ public VToken? this[string key] public VObject() { - _children = new List(); + _children = []; } public VObject(VObject other) diff --git a/src/PG.StarWarsGame.Infrastructure/Clients/Arguments/GameArgumentNames.cs b/src/PG.StarWarsGame.Infrastructure/Clients/Arguments/GameArgumentNames.cs index 47ce6b07..fd7f9800 100644 --- a/src/PG.StarWarsGame.Infrastructure/Clients/Arguments/GameArgumentNames.cs +++ b/src/PG.StarWarsGame.Infrastructure/Clients/Arguments/GameArgumentNames.cs @@ -9,6 +9,7 @@ namespace PG.StarWarsGame.Infrastructure.Clients.Arguments; /// public static class GameArgumentNames { + // ReSharper disable InconsistentNaming internal const string ModListArg = "MODLIST"; internal const string WindowedArg = "WINDOWED"; internal const string MCEArg = "MCE"; @@ -68,6 +69,7 @@ public static class GameArgumentNames internal const string ConsoleCommandFileArg = "CONSOLECOMMANDFILE"; internal const string ConnectPortArg = "CONNECTPORT"; internal const string ConnectIPArg = "CONNECTIP"; + // ReSharper enable InconsistentNaming internal static readonly IReadOnlyCollection SupportedFlagArgumentNames = new ReadOnlyCollection( diff --git a/src/PG.StarWarsGame.Infrastructure/Clients/Arguments/GameArguments/AILogStyle.cs b/src/PG.StarWarsGame.Infrastructure/Clients/Arguments/GameArguments/AILogStyle.cs index bf6b8d3e..7a89017f 100644 --- a/src/PG.StarWarsGame.Infrastructure/Clients/Arguments/GameArguments/AILogStyle.cs +++ b/src/PG.StarWarsGame.Infrastructure/Clients/Arguments/GameArguments/AILogStyle.cs @@ -2,6 +2,7 @@ namespace PG.StarWarsGame.Infrastructure.Clients.Arguments.GameArguments; +// ReSharper disable once InconsistentNaming /// /// Level of detail of LUA logging. /// diff --git a/src/PG.StarWarsGame.Infrastructure/Clients/Arguments/GameArguments/GameArguments.cs b/src/PG.StarWarsGame.Infrastructure/Clients/Arguments/GameArguments/GameArguments.cs index c4cd9b1f..2f21b4d5 100644 --- a/src/PG.StarWarsGame.Infrastructure/Clients/Arguments/GameArguments/GameArguments.cs +++ b/src/PG.StarWarsGame.Infrastructure/Clients/Arguments/GameArguments/GameArguments.cs @@ -5,6 +5,8 @@ namespace PG.StarWarsGame.Infrastructure.Clients.Arguments.GameArguments; +// ReSharper disable InconsistentNaming + #region Flags Normal /// @@ -304,7 +306,7 @@ internal override string ValueToCommandLine() /// File location where LUA logging shall be stored to. /// /// -/// The directory of the file must already exists. +/// The directory of the file must already exist. /// public sealed class AILogFileArgument(IFileInfo value, IDirectoryInfo gameDir) : NamedArgument(GameArgumentNames.AILogFileArg, value, true) { diff --git a/src/PG.StarWarsGame.Infrastructure/Games/PetroglyphStarWarsGame.cs b/src/PG.StarWarsGame.Infrastructure/Games/PetroglyphStarWarsGame.cs index 638816a3..e7738872 100644 --- a/src/PG.StarWarsGame.Infrastructure/Games/PetroglyphStarWarsGame.cs +++ b/src/PG.StarWarsGame.Infrastructure/Games/PetroglyphStarWarsGame.cs @@ -13,8 +13,7 @@ namespace PG.StarWarsGame.Infrastructure.Games; public class PetroglyphStarWarsGame : PlayableModContainer, IGame { private readonly string _normalizedPath; - private IDirectoryInfo? _modLocation; - + /// /// Gets the file system of this game. /// @@ -40,13 +39,13 @@ public IDirectoryInfo ModsLocation { get { - if (_modLocation is null) + if (field is null) { var fs = Directory.FileSystem; var modsPath = fs.Path.Combine(Directory.FullName, "Mods"); - _modLocation = fs.DirectoryInfo.New(modsPath); + field = fs.DirectoryInfo.New(modsPath); } - return _modLocation; + return field; } } diff --git a/src/PG.StarWarsGame.Infrastructure/Games/Registry/GameRegistry.cs b/src/PG.StarWarsGame.Infrastructure/Games/Registry/GameRegistry.cs index 9a86db83..458106be 100644 --- a/src/PG.StarWarsGame.Infrastructure/Games/Registry/GameRegistry.cs +++ b/src/PG.StarWarsGame.Infrastructure/Games/Registry/GameRegistry.cs @@ -7,6 +7,7 @@ namespace PG.StarWarsGame.Infrastructure.Games.Registry; internal sealed class GameRegistry : IGameRegistry { + // ReSharper disable InconsistentNaming internal const string VersionKey = "1.0"; internal const string CDKeyProperty = "CD Key"; internal const string EawGoldProperty = "EAWGold"; @@ -15,6 +16,7 @@ internal sealed class GameRegistry : IGameRegistry internal const string InstallPathProperty = "InstallPath"; internal const string LauncherProperty = "Launcher"; internal const string RevisionProperty = "Revision"; + // ReSharper enable InconsistentNaming private static readonly Version VersionInstance = new(1, 0); diff --git a/src/PG.StarWarsGame.Infrastructure/IModContainer.cs b/src/PG.StarWarsGame.Infrastructure/IModContainer.cs index 5ba51d5f..4f05eb7c 100644 --- a/src/PG.StarWarsGame.Infrastructure/IModContainer.cs +++ b/src/PG.StarWarsGame.Infrastructure/IModContainer.cs @@ -6,7 +6,8 @@ namespace PG.StarWarsGame.Infrastructure; /// -/// This instance can be parent for one or many mods. +/// Defines a container for managing a collection of mods, providing methods to add, remove, and search for mods, as +/// well as an event for tracking modifications to the mod collection. /// public interface IModContainer : IEnumerable { diff --git a/src/PG.StarWarsGame.Infrastructure/Mods/ModBase.cs b/src/PG.StarWarsGame.Infrastructure/Mods/ModBase.cs index 4baf1174..8333abbc 100644 --- a/src/PG.StarWarsGame.Infrastructure/Mods/ModBase.cs +++ b/src/PG.StarWarsGame.Infrastructure/Mods/ModBase.cs @@ -21,8 +21,6 @@ public abstract class ModBase : PlayableModContainer, IMod /// public event EventHandler? DependenciesResolved; - private SemVersion? _modVersion; - /// public string Identifier { get; } @@ -48,7 +46,7 @@ public abstract class ModBase : PlayableModContainer, IMod public IModinfo? ModInfo { get; protected init; } /// - public SemVersion? Version => _modVersion ??= InitializeVersion(); + public SemVersion? Version => field ??= InitializeVersion(); /// /// Gets the mod's dependency list from the modinfo data or an empty list if no modinfo data is specified. diff --git a/src/PG.StarWarsGame.Infrastructure/PlayableObject.cs b/src/PG.StarWarsGame.Infrastructure/PlayableObject.cs index c6a73f1a..5ddc3145 100644 --- a/src/PG.StarWarsGame.Infrastructure/PlayableObject.cs +++ b/src/PG.StarWarsGame.Infrastructure/PlayableObject.cs @@ -15,9 +15,6 @@ namespace PG.StarWarsGame.Infrastructure; /// public abstract class PlayableObject(IServiceProvider serviceProvider) : IPlayableObject { - private IReadOnlyCollection? _installedLanguages; - private string? _iconFile; - private bool _languageSearched; private bool _iconSearched; @@ -38,12 +35,12 @@ public IReadOnlyCollection InstalledLanguages get { if (_languageSearched) - return _installedLanguages!; - _installedLanguages = ResolveInstalledLanguages(); - if (_installedLanguages is null) + return field!; + field = ResolveInstalledLanguages(); + if (field is null) throw new PetroglyphException("Resolved languages must not be null."); _languageSearched = true; - return _installedLanguages; + return field; } } @@ -53,10 +50,10 @@ public string? IconFile get { if (_iconSearched) - return _iconFile; - _iconFile = ResolveIconFile(); + return field; + field = ResolveIconFile(); _iconSearched = true; - return _iconFile; + return field; } } diff --git a/src/PG.StarWarsGame.Infrastructure/Services/ModFactory.cs b/src/PG.StarWarsGame.Infrastructure/Services/ModFactory.cs index 56badd1d..15c7d23c 100644 --- a/src/PG.StarWarsGame.Infrastructure/Services/ModFactory.cs +++ b/src/PG.StarWarsGame.Infrastructure/Services/ModFactory.cs @@ -70,8 +70,8 @@ public IVirtualMod CreateVirtualMod(IGame game, IModinfo virtualModInfo) private string GetModName(DetectedModReference detectedMod, CultureInfo culture) { var name = _nameResolver.ResolveName(detectedMod, culture); - if (string.IsNullOrEmpty(name)) - throw new ModException(detectedMod.ModReference, "Unable to create a mod with an empty name."); - return name!; + return string.IsNullOrEmpty(name) + ? throw new ModException(detectedMod.ModReference, "Unable to create a mod with an empty name.") + : name; } } \ No newline at end of file diff --git a/src/PG.StarWarsGame.Infrastructure/Utilities/CompilerServices/CallerArgumentExpressionAttribute.cs b/src/PG.StarWarsGame.Infrastructure/Utilities/CompilerServices/CallerArgumentExpressionAttribute.cs index 5d1c7868..093da83f 100644 --- a/src/PG.StarWarsGame.Infrastructure/Utilities/CompilerServices/CallerArgumentExpressionAttribute.cs +++ b/src/PG.StarWarsGame.Infrastructure/Utilities/CompilerServices/CallerArgumentExpressionAttribute.cs @@ -1,5 +1,7 @@ #if !NET +#pragma warning disable IDE0130 namespace System.Runtime.CompilerServices; +#pragma warning restore IDE0130 [AttributeUsage(AttributeTargets.Parameter)] internal sealed class CallerArgumentExpressionAttribute(string parameterName) : Attribute diff --git a/test/AET.SteamAbstraction.Test/SteamWrapperTestBase.cs b/test/AET.SteamAbstraction.Test/SteamWrapperTestBase.cs index ff4a2646..68140391 100644 --- a/test/AET.SteamAbstraction.Test/SteamWrapperTestBase.cs +++ b/test/AET.SteamAbstraction.Test/SteamWrapperTestBase.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using AET.SteamAbstraction.Library; using AET.SteamAbstraction.Registry; -using AET.SteamAbstraction.Test.TestUtilities; +using AET.SteamAbstraction.Testing; using AET.SteamAbstraction.Testing.Installation; using AET.SteamAbstraction.Utilities; using AnakinRaW.CommonUtilities; diff --git a/test/AET.SteamAbstraction.Testing/TestProcessHelper.cs b/test/AET.SteamAbstraction.Testing/TestProcessHelper.cs index 2113f221..7773e9cf 100644 --- a/test/AET.SteamAbstraction.Testing/TestProcessHelper.cs +++ b/test/AET.SteamAbstraction.Testing/TestProcessHelper.cs @@ -9,7 +9,7 @@ using Microsoft.Extensions.DependencyInjection; using Xunit; -namespace AET.SteamAbstraction.Test.TestUtilities; +namespace AET.SteamAbstraction.Testing; public class TestProcessHelper(IServiceProvider sp) : IProcessHelper { @@ -32,7 +32,7 @@ public bool IsProcessRunning(int pid) return pid == _pid; } - public Process? StartProcess(ProcessStartInfo startInfo) + public Process StartProcess(ProcessStartInfo startInfo) { var registry = _registryFactory.CreateRegistry(); var expectedFileName = registry.ExecutableFile?.FullName; diff --git a/test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test/SteamPetroglyphStarWarsGameClientTest.cs b/test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test/SteamPetroglyphStarWarsGameClientTest.cs index fb39ea61..db607eb8 100644 --- a/test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test/SteamPetroglyphStarWarsGameClientTest.cs +++ b/test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test/SteamPetroglyphStarWarsGameClientTest.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using AET.SteamAbstraction; using AET.SteamAbstraction.Registry; -using AET.SteamAbstraction.Test.TestUtilities; +using AET.SteamAbstraction.Testing; using AET.SteamAbstraction.Testing.Installation; using AET.SteamAbstraction.Utilities; using AnakinRaW.CommonUtilities.Registry; diff --git a/test/PG.StarWarsGame.Infrastructure.Test/Clients/Arguments/ArgumentCollectionTest.cs b/test/PG.StarWarsGame.Infrastructure.Test/Clients/Arguments/ArgumentCollectionTest.cs index 3ff2030c..d4f651d3 100644 --- a/test/PG.StarWarsGame.Infrastructure.Test/Clients/Arguments/ArgumentCollectionTest.cs +++ b/test/PG.StarWarsGame.Infrastructure.Test/Clients/Arguments/ArgumentCollectionTest.cs @@ -29,7 +29,7 @@ public void TestImmutable() var e = ((IEnumerable)argList).GetEnumerator(); Assert.True(e.MoveNext()); - var o = (GameArgument)e.Current; + var o = (GameArgument)e.Current!; Assert.Equal(new WindowedArgument(), a); diff --git a/test/PG.StarWarsGame.Infrastructure.Test/Clients/Arguments/GameArgumentTestBase.cs b/test/PG.StarWarsGame.Infrastructure.Test/Clients/Arguments/GameArgumentTestBase.cs index 017fa590..25458c52 100644 --- a/test/PG.StarWarsGame.Infrastructure.Test/Clients/Arguments/GameArgumentTestBase.cs +++ b/test/PG.StarWarsGame.Infrastructure.Test/Clients/Arguments/GameArgumentTestBase.cs @@ -159,7 +159,7 @@ public static IEnumerable GetValidArguments() var relativeMod = fs.DirectoryInfo.New("with space/otherGame/mods/myMod"); var steamModDir = fs.DirectoryInfo.New("with space/game/mods/123456"); - var gameFile = fs.FileInfo.New("game/file.txt"); + fs.FileInfo.New("game/file.txt"); foreach (var value in GetValidStringValues) yield return [TestNamedArg.FromValue(value)]; diff --git a/test/PG.StarWarsGame.Infrastructure.Test/Clients/Arguments/GameArgumentsBuilderTest.cs b/test/PG.StarWarsGame.Infrastructure.Test/Clients/Arguments/GameArgumentsBuilderTest.cs index 321a87be..1d800a96 100644 --- a/test/PG.StarWarsGame.Infrastructure.Test/Clients/Arguments/GameArgumentsBuilderTest.cs +++ b/test/PG.StarWarsGame.Infrastructure.Test/Clients/Arguments/GameArgumentsBuilderTest.cs @@ -236,7 +236,7 @@ public void AddMods_AllVirtualMods_NoModsAdded() CreateVirtualMod().virtualMod }; - var result = _builder.AddMods(virtualMods); + _builder.AddMods(virtualMods); var builtResult = _builder.Build(); Assert.Empty(builtResult); diff --git a/test/PG.StarWarsGame.Infrastructure.Test/Clients/PetroglyphStarWarsGameClientTest.cs b/test/PG.StarWarsGame.Infrastructure.Test/Clients/PetroglyphStarWarsGameClientTest.cs index 6b888909..077a59f2 100644 --- a/test/PG.StarWarsGame.Infrastructure.Test/Clients/PetroglyphStarWarsGameClientTest.cs +++ b/test/PG.StarWarsGame.Infrastructure.Test/Clients/PetroglyphStarWarsGameClientTest.cs @@ -277,7 +277,7 @@ public void PlayDebug_Derived_OnGameStarting_ThrowsCustom(GameIdentity gameIdent var game = FileSystem.InstallGame(gameIdentity, ServiceProvider); - var derivedClient = new MyTestClient((arguments, type) => + var derivedClient = new MyTestClient((_, type) => { Assert.Equal(GameBuildType.Release, type); throw new Exception("Message"); diff --git a/test/PG.StarWarsGame.Infrastructure.Test/Clients/Processes/GameProcessTest.cs b/test/PG.StarWarsGame.Infrastructure.Test/Clients/Processes/GameProcessTest.cs index 0da8bf2a..3acdd5e8 100644 --- a/test/PG.StarWarsGame.Infrastructure.Test/Clients/Processes/GameProcessTest.cs +++ b/test/PG.StarWarsGame.Infrastructure.Test/Clients/Processes/GameProcessTest.cs @@ -33,8 +33,8 @@ public void Dispose() { try { - _testProcess?.Kill(); - _testProcess?.Dispose(); + _testProcess.Kill(); + _testProcess.Dispose(); } catch (Exception) { diff --git a/test/PG.StarWarsGame.Infrastructure.Test/GameServices/Detection/CustomGameDetectorTest.cs b/test/PG.StarWarsGame.Infrastructure.Test/GameServices/Detection/CustomGameDetectorTest.cs index 6499fbf3..3ed6112d 100644 --- a/test/PG.StarWarsGame.Infrastructure.Test/GameServices/Detection/CustomGameDetectorTest.cs +++ b/test/PG.StarWarsGame.Infrastructure.Test/GameServices/Detection/CustomGameDetectorTest.cs @@ -139,7 +139,7 @@ private GameDetectorBase.GameLocationData HandleRequiredInitialization(GameType { return state.Value is null ? GameDetectorBase.GameLocationData.RequiresInitialization - : new GameDetectorBase.GameLocationData(_fileSystem.DirectoryInfo.New(state.Value.ToString()!)); + : new GameDetectorBase.GameLocationData(_fileSystem.DirectoryInfo.New(state.Value.ToString())); } private static GameDetectorBase.GameLocationData FindGameThrowsException(GameType arg) diff --git a/test/PG.StarWarsGame.Infrastructure.Test/GameServices/GameFactoryTest.cs b/test/PG.StarWarsGame.Infrastructure.Test/GameServices/GameFactoryTest.cs index 49200fbb..f2c90a0f 100644 --- a/test/PG.StarWarsGame.Infrastructure.Test/GameServices/GameFactoryTest.cs +++ b/test/PG.StarWarsGame.Infrastructure.Test/GameServices/GameFactoryTest.cs @@ -221,13 +221,13 @@ private void TestCreateGameWithPredefinedExistCheck(bool checkExists, IGame inst var game = _factory.CreateGame(createIdentity, installedGame.Directory, false, CultureInfo.CurrentCulture); var expectedName = _nameResolver.ResolveName(game, CultureInfo.CurrentCulture); - AssertGame(game, createIdentity, installedGame.Directory.FullName, expectedName!); + AssertGame(game, createIdentity, installedGame.Directory.FullName, expectedName); _factory.TryCreateGame(createIdentity, installedGame.Directory, false, CultureInfo.CurrentCulture, out var tryGame); Assert.NotNull(tryGame); - AssertGame(tryGame, createIdentity, installedGame.Directory.FullName, expectedName!); + AssertGame(tryGame, createIdentity, installedGame.Directory.FullName, expectedName); } } @@ -248,12 +248,12 @@ public void CreateGame_FromIdentity_GameCreated(GameIdentity gameIdentity) var createdGame = _factory.CreateGame(gameIdentity, installedGame.Directory, true, CultureInfo.CurrentCulture); - AssertGame(createdGame, gameIdentity, installedGame.Directory.FullName, expectedName!); + AssertGame(createdGame, gameIdentity, installedGame.Directory.FullName, expectedName); Assert.True(_factory.TryCreateGame(gameIdentity, installedGame.Directory, true, CultureInfo.CurrentCulture, out var tryGame)); - AssertGame(tryGame, gameIdentity, installedGame.Directory.FullName, expectedName!); + AssertGame(tryGame, gameIdentity, installedGame.Directory.FullName, expectedName); } [Theory] @@ -269,11 +269,11 @@ public void CreateGame_FromDetectionResult_GameCreated(GameIdentity gameIdentity var createdGame = _factory.CreateGame(detectionResult, CultureInfo.CurrentCulture); - AssertGame(createdGame, gameIdentity, installedGame.Directory.FullName, expectedName!); + AssertGame(createdGame, gameIdentity, installedGame.Directory.FullName, expectedName); Assert.True(_factory.TryCreateGame(detectionResult, CultureInfo.CurrentCulture, out var tryGame)); - AssertGame(tryGame, gameIdentity, installedGame.Directory.FullName, expectedName!); + AssertGame(tryGame, gameIdentity, installedGame.Directory.FullName, expectedName); } public class GameFactoryWithNullNameResolver : CommonTestBaseWithRandomGame diff --git a/test/PG.StarWarsGame.Infrastructure.Test/ModBaseTest.cs b/test/PG.StarWarsGame.Infrastructure.Test/ModBaseTest.cs index 1d70f113..2922d0f4 100644 --- a/test/PG.StarWarsGame.Infrastructure.Test/ModBaseTest.cs +++ b/test/PG.StarWarsGame.Infrastructure.Test/ModBaseTest.cs @@ -248,11 +248,9 @@ public void EqualsHashCode() var samish = CreateMod("A"); var otherA = CreateMod("A", deps: dep); - ModBase custom; - if (mod.ModInfo is not null) - custom = new CustomMod(Game, mod.Identifier, mod.Type, mod.ModInfo, ServiceProvider); - else - custom = new CustomMod(Game, mod.Identifier, mod.Type, mod.Name, ServiceProvider); + ModBase custom = mod.ModInfo is not null + ? new CustomMod(Game, mod.Identifier, mod.Type, mod.ModInfo, ServiceProvider) + : new CustomMod(Game, mod.Identifier, mod.Type, mod.Name, ServiceProvider); Assert.False(mod.Equals(null)); Assert.False(mod.Equals((object)null!)); diff --git a/test/PG.StarWarsGame.Infrastructure.Test/ModServices/ModGameTypeResolverTestBase.cs b/test/PG.StarWarsGame.Infrastructure.Test/ModServices/ModGameTypeResolverTestBase.cs index 100c11dc..76130879 100644 --- a/test/PG.StarWarsGame.Infrastructure.Test/ModServices/ModGameTypeResolverTestBase.cs +++ b/test/PG.StarWarsGame.Infrastructure.Test/ModServices/ModGameTypeResolverTestBase.cs @@ -255,7 +255,7 @@ public void VirtualMods_VirtualModsAreAlwaysUndecidable() var info = CreateDetectedModReference(mod.Directory, ModType.Virtual, modinfo); var resolver = CreateResolver(); - // We have a installed mod, and modinfo, but still virtual mods shall never return a confirmed value + // We have an installed mod, and modinfo, but still virtual mods shall never return a confirmed value Assert.False(CreateResolver().TryGetGameType(info, out var types)); Assert.Empty(types); diff --git a/test/PG.StarWarsGame.Infrastructure.Test/PetroglyphGameInfrastructureIntegrationTest.cs b/test/PG.StarWarsGame.Infrastructure.Test/PetroglyphGameInfrastructureIntegrationTest.cs index 6f5e4180..0d28c712 100644 --- a/test/PG.StarWarsGame.Infrastructure.Test/PetroglyphGameInfrastructureIntegrationTest.cs +++ b/test/PG.StarWarsGame.Infrastructure.Test/PetroglyphGameInfrastructureIntegrationTest.cs @@ -322,7 +322,7 @@ public bool Equals(DetectedModReference? x, DetectedModReference? y) public int GetHashCode(DetectedModReference obj) { - return HashCode.Combine(obj.Directory.FullName, ModIdentityEqualityComparer.Default.GetHashCode(obj.Modinfo), obj.ModReference); + return HashCode.Combine(obj.Directory.FullName, ModIdentityEqualityComparer.Default.GetHashCode(obj.Modinfo!), obj.ModReference); } } } \ No newline at end of file diff --git a/test/PG.StarWarsGame.Infrastructure.Test/VirtualModTest.cs b/test/PG.StarWarsGame.Infrastructure.Test/VirtualModTest.cs index 12bdf9a4..3e0ae39f 100644 --- a/test/PG.StarWarsGame.Infrastructure.Test/VirtualModTest.cs +++ b/test/PG.StarWarsGame.Infrastructure.Test/VirtualModTest.cs @@ -68,7 +68,7 @@ protected override PlayableModContainer CreateModContainer() [Fact] public void InvalidCtor_ArgumentNull_Throws() { - var dep = Game.InstallAndAddMod("Dep", GITestUtilities.GetRandomWorkshopFlag(Game), ServiceProvider); + Game.InstallAndAddMod("Dep", GITestUtilities.GetRandomWorkshopFlag(Game), ServiceProvider); Assert.Throws(() => new VirtualMod(null!, "VirtualModId", new ModinfoData("Name"), ServiceProvider)); Assert.Throws(() => new VirtualMod(Game, "VirtualModId", null!, ServiceProvider)); diff --git a/test/PG.StarWarsGame.Infrastructure.Testing/GITestUtilities.cs b/test/PG.StarWarsGame.Infrastructure.Testing/GITestUtilities.cs index b960c595..c5ef6ac9 100644 --- a/test/PG.StarWarsGame.Infrastructure.Testing/GITestUtilities.cs +++ b/test/PG.StarWarsGame.Infrastructure.Testing/GITestUtilities.cs @@ -5,6 +5,7 @@ namespace PG.StarWarsGame.Infrastructure.Testing; +// ReSharper disable once InconsistentNaming public static class GITestUtilities { public static ICollection RealPlatforms { get; } = diff --git a/test/PG.StarWarsGame.Infrastructure.Testing/Mods/ModInstallations.Modinfo.cs b/test/PG.StarWarsGame.Infrastructure.Testing/Mods/ModInstallations.Modinfo.cs index 503724e2..39388722 100644 --- a/test/PG.StarWarsGame.Infrastructure.Testing/Mods/ModInstallations.Modinfo.cs +++ b/test/PG.StarWarsGame.Infrastructure.Testing/Mods/ModInstallations.Modinfo.cs @@ -42,7 +42,7 @@ private static IModinfoFile InstallModinfoFile( var fileInfo = fs.FileInfo.New(modinfoFilePath); if (variantSubFileName is null) - return new ModinfoVariantFile(fileInfo); + return new MainModinfoFile(fileInfo); return new ModinfoVariantFile(fileInfo); } diff --git a/test/PG.StarWarsGame.Infrastructure.Testing/TestBases/CommonTestBase.cs b/test/PG.StarWarsGame.Infrastructure.Testing/TestBases/CommonTestBase.cs index b4668c9e..e8f57b9a 100644 --- a/test/PG.StarWarsGame.Infrastructure.Testing/TestBases/CommonTestBase.cs +++ b/test/PG.StarWarsGame.Infrastructure.Testing/TestBases/CommonTestBase.cs @@ -64,7 +64,7 @@ protected static ICollection GetRandomLanguages() { var languages = new HashSet(PossibleLanguages.Length); - for (var i = 0; i < PossibleLanguages.Length; i++) + foreach (var _ in PossibleLanguages) { var code = TestHelpers.GetRandom(PossibleLanguages); var support = TestHelpers.GetRandomEnum(); diff --git a/test/PG.StarWarsGame.Infrastructure.Testing/TestBases/GameDetectorTestBase.cs b/test/PG.StarWarsGame.Infrastructure.Testing/TestBases/GameDetectorTestBase.cs index 341b992a..eeae83b2 100644 --- a/test/PG.StarWarsGame.Infrastructure.Testing/TestBases/GameDetectorTestBase.cs +++ b/test/PG.StarWarsGame.Infrastructure.Testing/TestBases/GameDetectorTestBase.cs @@ -53,7 +53,7 @@ protected void TestDetectorCore( var shouldTriggerInitEvent = SupportInitialization && SupportedPlatforms.Contains(identity.Platform) && shallHandleInitialization; var eventTriggered = false; - detector.InitializationRequested += (s, e) => + detector.InitializationRequested += (_, e) => { Assert.True(SupportInitialization); eventTriggered = true; diff --git a/test/PG.TestingUtilities/PlatformSpecificFactAttribute.cs b/test/PG.TestingUtilities/PlatformSpecificFactAttribute.cs index 6c2b9025..e2d545d7 100644 --- a/test/PG.TestingUtilities/PlatformSpecificFactAttribute.cs +++ b/test/PG.TestingUtilities/PlatformSpecificFactAttribute.cs @@ -4,7 +4,7 @@ namespace PG.TestingUtilities; -public class PlatformSpecificFactAttribute : FactAttribute +public sealed class PlatformSpecificFactAttribute : FactAttribute { public PlatformSpecificFactAttribute(params TestPlatformIdentifier[] platformIds) { diff --git a/test/PG.TestingUtilities/PlatformSpecificTheoryAttribute.cs b/test/PG.TestingUtilities/PlatformSpecificTheoryAttribute.cs index 6af2067e..0ea85b11 100644 --- a/test/PG.TestingUtilities/PlatformSpecificTheoryAttribute.cs +++ b/test/PG.TestingUtilities/PlatformSpecificTheoryAttribute.cs @@ -4,7 +4,7 @@ namespace PG.TestingUtilities; -public class PlatformSpecificTheoryAttribute : TheoryAttribute +public sealed class PlatformSpecificTheoryAttribute : TheoryAttribute { public PlatformSpecificTheoryAttribute(params TestPlatformIdentifier[] platformIds) { From c62ede33661b2a07554a8b3ef0605b7d55aa88e6 Mon Sep 17 00:00:00 2001 From: AnakinRaW Date: Thu, 11 Dec 2025 16:20:12 +0100 Subject: [PATCH 3/7] update versoin --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index 6b8e446e..7ba42803 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "4.0", + "version": "4.1", "publicReleaseRefSpec": [ "^refs/heads/main" ], From adb98b2bb6bb271d56611df25d6252c6274558f2 Mon Sep 17 00:00:00 2001 From: AnakinRaW Date: Thu, 11 Dec 2025 16:20:22 +0100 Subject: [PATCH 4/7] update deps --- sampleApp/SampleApplication.csproj | 2 +- src/AET.SteamAbstraction/AET.SteamAbstraction.csproj | 6 +++--- .../PG.StarWarsGame.Infrastructure.csproj | 6 +++--- .../AET.SteamAbstraction.Test.csproj | 2 +- .../AET.SteamAbstraction.Testing.csproj | 2 +- ...PG.StarWarsGame.Infrastructure.Clients.Steam.Test.csproj | 2 +- .../PG.StarWarsGame.Infrastructure.Test.csproj | 2 +- .../PG.StarWarsGame.Infrastructure.Testing.csproj | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sampleApp/SampleApplication.csproj b/sampleApp/SampleApplication.csproj index a11f4422..e8b2d631 100644 --- a/sampleApp/SampleApplication.csproj +++ b/sampleApp/SampleApplication.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/AET.SteamAbstraction/AET.SteamAbstraction.csproj b/src/AET.SteamAbstraction/AET.SteamAbstraction.csproj index 8386272e..35deee25 100644 --- a/src/AET.SteamAbstraction/AET.SteamAbstraction.csproj +++ b/src/AET.SteamAbstraction/AET.SteamAbstraction.csproj @@ -25,12 +25,12 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/PG.StarWarsGame.Infrastructure/PG.StarWarsGame.Infrastructure.csproj b/src/PG.StarWarsGame.Infrastructure/PG.StarWarsGame.Infrastructure.csproj index 491971db..d1302369 100644 --- a/src/PG.StarWarsGame.Infrastructure/PG.StarWarsGame.Infrastructure.csproj +++ b/src/PG.StarWarsGame.Infrastructure/PG.StarWarsGame.Infrastructure.csproj @@ -36,9 +36,9 @@ - - + + - + \ No newline at end of file diff --git a/test/AET.SteamAbstraction.Test/AET.SteamAbstraction.Test.csproj b/test/AET.SteamAbstraction.Test/AET.SteamAbstraction.Test.csproj index 4525e445..d3d787e4 100644 --- a/test/AET.SteamAbstraction.Test/AET.SteamAbstraction.Test.csproj +++ b/test/AET.SteamAbstraction.Test/AET.SteamAbstraction.Test.csproj @@ -16,7 +16,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/test/AET.SteamAbstraction.Testing/AET.SteamAbstraction.Testing.csproj b/test/AET.SteamAbstraction.Testing/AET.SteamAbstraction.Testing.csproj index 893861a4..90660bc1 100644 --- a/test/AET.SteamAbstraction.Testing/AET.SteamAbstraction.Testing.csproj +++ b/test/AET.SteamAbstraction.Testing/AET.SteamAbstraction.Testing.csproj @@ -33,7 +33,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + diff --git a/test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test.csproj b/test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test.csproj index 96b4e4eb..9a243dfd 100644 --- a/test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test.csproj +++ b/test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test/PG.StarWarsGame.Infrastructure.Clients.Steam.Test.csproj @@ -17,7 +17,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/test/PG.StarWarsGame.Infrastructure.Test/PG.StarWarsGame.Infrastructure.Test.csproj b/test/PG.StarWarsGame.Infrastructure.Test/PG.StarWarsGame.Infrastructure.Test.csproj index 869308bf..29c43ac0 100644 --- a/test/PG.StarWarsGame.Infrastructure.Test/PG.StarWarsGame.Infrastructure.Test.csproj +++ b/test/PG.StarWarsGame.Infrastructure.Test/PG.StarWarsGame.Infrastructure.Test.csproj @@ -17,7 +17,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/test/PG.StarWarsGame.Infrastructure.Testing/PG.StarWarsGame.Infrastructure.Testing.csproj b/test/PG.StarWarsGame.Infrastructure.Testing/PG.StarWarsGame.Infrastructure.Testing.csproj index 51c7d4e4..72f1d12e 100644 --- a/test/PG.StarWarsGame.Infrastructure.Testing/PG.StarWarsGame.Infrastructure.Testing.csproj +++ b/test/PG.StarWarsGame.Infrastructure.Testing/PG.StarWarsGame.Infrastructure.Testing.csproj @@ -33,7 +33,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + From 9f0329f419dba47f3c0eb47cfabe01a1f9364e24 Mon Sep 17 00:00:00 2001 From: AnakinRaW Date: Thu, 11 Dec 2025 16:25:17 +0100 Subject: [PATCH 5/7] add thorws argsnull tests --- .../Utilities/GameExecutableFileUtilitiesTest.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/PG.StarWarsGame.Infrastructure.Test/Clients/Utilities/GameExecutableFileUtilitiesTest.cs b/test/PG.StarWarsGame.Infrastructure.Test/Clients/Utilities/GameExecutableFileUtilitiesTest.cs index 778d14b1..ed8f70de 100644 --- a/test/PG.StarWarsGame.Infrastructure.Test/Clients/Utilities/GameExecutableFileUtilitiesTest.cs +++ b/test/PG.StarWarsGame.Infrastructure.Test/Clients/Utilities/GameExecutableFileUtilitiesTest.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using PG.StarWarsGame.Infrastructure.Clients; using PG.StarWarsGame.Infrastructure.Clients.Utilities; using PG.StarWarsGame.Infrastructure.Games; @@ -36,6 +37,16 @@ public static IEnumerable GetGameExeNamesTestData() } } + [Theory] + [MemberData(nameof(RealGameIdentities))] + public void GetExecutableForGame_NullGame_ThrowsArgumentNullException(GameIdentity gameIdentity) + { + FileSystem.InstallGame(gameIdentity, ServiceProvider); + var buildTypes = new List { GameBuildType.Release, GameBuildType.Debug }; + foreach (var buildType in buildTypes) + Assert.Throws(() => GameExecutableFileUtilities.GetExecutableForGame(null!, buildType)); + } + [Theory] [MemberData(nameof(RealGameIdentities))] public void GetExecutableForGame_GameExeFilesNotInstalled_ReturnsNull(GameIdentity gameIdentity) From 46540d2452b040ecfa6f0aec2cd4c33d7c3f62d5 Mon Sep 17 00:00:00 2001 From: AnakinRaW Date: Sat, 13 Dec 2025 12:56:50 +0100 Subject: [PATCH 6/7] update deps and resolve warnings --- .../PG.StarWarsGame.Infrastructure.csproj | 2 +- .../Detection/CompositeDetectorTest.cs | 4 ++-- .../Games/Registry/GameRegistryTest.cs | 17 +++++++++-------- .../ModServices/ModFinderTest.cs | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/PG.StarWarsGame.Infrastructure/PG.StarWarsGame.Infrastructure.csproj b/src/PG.StarWarsGame.Infrastructure/PG.StarWarsGame.Infrastructure.csproj index d1302369..08e22e06 100644 --- a/src/PG.StarWarsGame.Infrastructure/PG.StarWarsGame.Infrastructure.csproj +++ b/src/PG.StarWarsGame.Infrastructure/PG.StarWarsGame.Infrastructure.csproj @@ -22,7 +22,7 @@ true - + diff --git a/test/PG.StarWarsGame.Infrastructure.Test/GameServices/Detection/CompositeDetectorTest.cs b/test/PG.StarWarsGame.Infrastructure.Test/GameServices/Detection/CompositeDetectorTest.cs index bf6c422e..4a5651cf 100644 --- a/test/PG.StarWarsGame.Infrastructure.Test/GameServices/Detection/CompositeDetectorTest.cs +++ b/test/PG.StarWarsGame.Infrastructure.Test/GameServices/Detection/CompositeDetectorTest.cs @@ -185,11 +185,11 @@ public void Detect_TryDetect_ShallPropagateRequireInitializationEvent(GameIdenti var expectedResult = GameDetectionResult.RequiresInitialization(identity.Type); var firstDetector = new CallbackDetector( - (d, t, _) => GameDetectionResult.RequiresInitialization(t), + (_, t, _) => GameDetectionResult.RequiresInitialization(t), true); var secondDetector = new CallbackDetector( - (d, t, _) => GameDetectionResult.RequiresInitialization(t), + (_, t, _) => GameDetectionResult.RequiresInitialization(t), true); var detector = new CompositeGameDetector([firstDetector, secondDetector], ServiceProvider); diff --git a/test/PG.StarWarsGame.Infrastructure.Test/Games/Registry/GameRegistryTest.cs b/test/PG.StarWarsGame.Infrastructure.Test/Games/Registry/GameRegistryTest.cs index 273177ba..8df3fa59 100644 --- a/test/PG.StarWarsGame.Infrastructure.Test/Games/Registry/GameRegistryTest.cs +++ b/test/PG.StarWarsGame.Infrastructure.Test/Games/Registry/GameRegistryTest.cs @@ -177,15 +177,16 @@ private static void SetupRegistry(IRegistryKey baseKey) versionKey.SetValue("Revision", 9876); } - private static void AssertDefaultRegistry(IGameRegistry registry, bool subKeyExists) + // ReSharper disable once ParameterOnlyUsedForPreconditionCheck.Local + private static void AssertDefaultRegistry(GameRegistry registry, bool subKeyExists) { Assert.Equal(subKeyExists, registry.Exits); - Assert.Equal(default, registry.Installed); - Assert.Equal(default, registry.CdKey); - Assert.Equal(default, registry.EaWGold); - Assert.Equal(default, registry.InstallPath); - Assert.Equal(default, registry.Launcher); - Assert.Equal(default, registry.Revision); - Assert.Equal(default, registry.Version); + Assert.Null(registry.Installed); + Assert.Null(registry.CdKey); + Assert.Null(registry.EaWGold); + Assert.Null(registry.InstallPath); + Assert.Null(registry.Launcher); + Assert.Null(registry.Revision); + Assert.Null(registry.Version); } } \ No newline at end of file diff --git a/test/PG.StarWarsGame.Infrastructure.Test/ModServices/ModFinderTest.cs b/test/PG.StarWarsGame.Infrastructure.Test/ModServices/ModFinderTest.cs index 46e3cd48..394d75a2 100644 --- a/test/PG.StarWarsGame.Infrastructure.Test/ModServices/ModFinderTest.cs +++ b/test/PG.StarWarsGame.Infrastructure.Test/ModServices/ModFinderTest.cs @@ -480,7 +480,7 @@ public bool Equals(IModIdentity? other) public string Name { get; } = name; public SemVersion? Version { get; } - public IModDependencyList Dependencies { get; init; } = DependencyList.EmptyDependencyList; + public IModDependencyList Dependencies { get; } = DependencyList.EmptyDependencyList; public string ToJson() { return JsonSerializer.Serialize(this, JsonSerializerOptions.Default); From 5a3f1344c43c132255bf4f103ab5e84fbcfd7535 Mon Sep 17 00:00:00 2001 From: AnakinRaW Date: Sat, 13 Dec 2025 13:00:14 +0100 Subject: [PATCH 7/7] fix warning --- .../GameServices/Detection/CustomGameDetectorTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/PG.StarWarsGame.Infrastructure.Test/GameServices/Detection/CustomGameDetectorTest.cs b/test/PG.StarWarsGame.Infrastructure.Test/GameServices/Detection/CustomGameDetectorTest.cs index 3ed6112d..6499fbf3 100644 --- a/test/PG.StarWarsGame.Infrastructure.Test/GameServices/Detection/CustomGameDetectorTest.cs +++ b/test/PG.StarWarsGame.Infrastructure.Test/GameServices/Detection/CustomGameDetectorTest.cs @@ -139,7 +139,7 @@ private GameDetectorBase.GameLocationData HandleRequiredInitialization(GameType { return state.Value is null ? GameDetectorBase.GameLocationData.RequiresInitialization - : new GameDetectorBase.GameLocationData(_fileSystem.DirectoryInfo.New(state.Value.ToString())); + : new GameDetectorBase.GameLocationData(_fileSystem.DirectoryInfo.New(state.Value.ToString()!)); } private static GameDetectorBase.GameLocationData FindGameThrowsException(GameType arg)