-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from Drommedhar/next-release
# 2.0.5.2 * Fix crash if old stored game path no longer exists * Fix saved library game path not being updated if changed * Fix crash with version string being in invalid format * Apply code style to whole code base
- Loading branch information
Showing
77 changed files
with
3,428 additions
and
2,632 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net8.0-windows</TargetFrameworks> | ||
|
||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" /> | ||
<PackageReference Include="NUnit" Version="4.2.2" /> | ||
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\DlssUpdater\DLSSUpdater.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
using System; | ||
using DLSSUpdater.Helpers; | ||
using NUnit.Framework; | ||
|
||
namespace DLSSUpdater.Tests.Helpers; | ||
|
||
[TestFixture] | ||
[TestOf(typeof(SafeVersion))] | ||
public class SafeVersionTest | ||
{ | ||
[Test] | ||
public void StringToSafeVersion() | ||
{ | ||
var version = "1.2.3.4"; | ||
var safeVersion = new SafeVersion(version); | ||
Assert.That(safeVersion.ToString(), Is.EqualTo("1.2.3.4")); | ||
|
||
version = "10.20.30.40"; | ||
safeVersion = new SafeVersion(version); | ||
Assert.That(safeVersion.ToString(), Is.EqualTo("10.20.30.40")); | ||
|
||
version = "1.2.3.4.u"; | ||
safeVersion = new SafeVersion(version); | ||
Assert.That(safeVersion.ToString(), Is.EqualTo("1.2.3.4")); | ||
|
||
version = "1-2-3-4"; | ||
safeVersion = new SafeVersion(version); | ||
Assert.That(safeVersion.ToString(), Is.EqualTo("1.2.3.4")); | ||
|
||
version = "1a2ab3ac4aa"; | ||
safeVersion = new SafeVersion(version); | ||
Assert.That(safeVersion.ToString(), Is.EqualTo("1.2.3.4")); | ||
|
||
version = "xx1a-2abx3ac*4aa+"; | ||
safeVersion = new SafeVersion(version); | ||
Assert.That(safeVersion.ToString(), Is.EqualTo("1.2.3.4")); | ||
|
||
version = "xx1a-2abx3ac*4aa+5rtuz;"; | ||
safeVersion = new SafeVersion(version); | ||
Assert.That(safeVersion.ToString(), Is.EqualTo("1.2.3.4")); | ||
} | ||
|
||
[Test] | ||
public void VersionToSafeVersion() | ||
{ | ||
var version = new Version(1, 2, 3,4); | ||
var safeVersion = new SafeVersion(version); | ||
Assert.That((Version)safeVersion, Is.EqualTo(version)); | ||
|
||
version = new Version(1, 0, 0, 1); | ||
safeVersion = new SafeVersion(version); | ||
Assert.That((Version)safeVersion, Is.EqualTo(version)); | ||
|
||
version = new Version(1, 0); | ||
safeVersion = new SafeVersion(version); | ||
Assert.That((Version)safeVersion, Is.EqualTo(version)); | ||
|
||
version = new Version(1, 0, 0, 0); | ||
safeVersion = new SafeVersion(version); | ||
Assert.That((Version)safeVersion, Is.EqualTo(version)); | ||
|
||
version = new Version(1, 2, 3, 0); | ||
safeVersion = new SafeVersion(version); | ||
Assert.That((Version)safeVersion, Is.EqualTo(version)); | ||
|
||
version = new Version(1, 2, 3); | ||
safeVersion = new SafeVersion(version); | ||
Assert.That((Version)safeVersion, Is.EqualTo(version)); | ||
|
||
version = new Version(1, 2); | ||
safeVersion = new SafeVersion(version); | ||
Assert.That((Version)safeVersion, Is.EqualTo(version)); | ||
} | ||
|
||
[Test] | ||
public void CheckIfVersionIsSafe() | ||
{ | ||
var safeVersion = new SafeVersion("1"); | ||
Assert.That(safeVersion.ToString(), Is.EqualTo("1.0.0.0")); | ||
|
||
safeVersion = new SafeVersion("1.2"); | ||
Assert.That(safeVersion.ToString(), Is.EqualTo("1.2.0.0")); | ||
|
||
safeVersion = new SafeVersion("1.2.3"); | ||
Assert.That(safeVersion.ToString(), Is.EqualTo("1.2.3.0")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AAssert_002Ecs_002Fl_003AC_0021_003FUsers_003Fdomin_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F53539022a55f40bd95b3200c33b231c074e00_003F65_003F7669dcf3_003FAssert_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> | ||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AEnumerable_002Ecs_002Fl_003AC_0021_003FUsers_003Fdomin_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fcca5cfb955e146648d91eb22ffe4627a84930_003Fa0_003Ff6ea3ed0_003FEnumerable_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> | ||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AFileSystemEnumerator_002EWindows_002Ecs_002Fl_003AC_0021_003FUsers_003Fdomin_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003F422299c1e1233f1a20b8c0654281f74792424fe87e29abaf4ecfcd0cd64d718_003FFileSystemEnumerator_002EWindows_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> | ||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AVersion_002Ecs_002Fl_003AC_0021_003FUsers_003Fdomin_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fbda1a8aceb88de87254065a2ded795c3953da7c42a269ae5bbb443973798b75_003FVersion_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> | ||
<s:Boolean x:Key="/Default/Environment/UnitTesting/CreateUnitTestDialog/ShowAdvancedOptions/@EntryValue">True</s:Boolean> | ||
<s:String x:Key="/Default/Environment/UnitTesting/CreateUnitTestDialog/TestProjectMapping/=891674A2_002D74FE_002D4E71_002DA18E_002D859680E25E98/@EntryIndexedValue">DLSSUpdater.Tests</s:String> | ||
<s:String x:Key="/Default/Environment/UnitTesting/CreateUnitTestDialog/TestTemplateMapping/=NUnit3x/@EntryIndexedValue">db4927dd-2e12-48a7-9a84-2b7e3e31b9c8</s:String> | ||
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=35466c2e_002Df322_002D4413_002D8d9b_002D0b19d0251add/@EntryIndexedValue"><SessionState ContinuousTestingMode="0" IsActive="True" Name="StringToSafeVersion" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session">
 | ||
<TestAncestor>
 | ||
<TestId>NUnit3x::43C6713F-2567-4400-A617-0684C22F987C::net8.0-windows::DLSSUpdater.Tests.Helpers.SafeVersionTest</TestId>
 | ||
</TestAncestor>
 | ||
</SessionState></s:String> | ||
|
||
|
||
|
||
|
||
</wpf:ResourceDictionary> |
Oops, something went wrong.