From 92075f2b7e3caa1a75f6c39fa63cc64067172f50 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Jun 2025 08:39:06 +0200 Subject: [PATCH 01/23] Bump the all-deps group with 5 updates (#224) Bumps MartinCostello.Logging.XUnit from 0.5.1 to 0.6.0 Bumps Microsoft.Bcl.AsyncInterfaces to 9.0.5, 9.0.5 Bumps Microsoft.Extensions.DependencyInjection to 9.0.5, 9.0.5, 9.0.5 Bumps Microsoft.Extensions.DependencyInjection.Abstractions to 9.0.5, 9.0.5, 9.0.5, 9.0.5 Bumps Microsoft.Extensions.Logging.Abstractions to 9.0.5, 9.0.5 --- updated-dependencies: - dependency-name: MartinCostello.Logging.XUnit dependency-version: 0.6.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all-deps - dependency-name: Microsoft.Bcl.AsyncInterfaces dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Microsoft.Bcl.AsyncInterfaces dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Microsoft.Extensions.DependencyInjection dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Microsoft.Extensions.DependencyInjection.Abstractions dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Microsoft.Extensions.DependencyInjection dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Microsoft.Extensions.DependencyInjection dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Microsoft.Extensions.DependencyInjection.Abstractions dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Microsoft.Extensions.DependencyInjection.Abstractions dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Microsoft.Extensions.DependencyInjection.Abstractions dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Microsoft.Extensions.Logging.Abstractions dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Microsoft.Extensions.Logging.Abstractions dependency-version: 9.0.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../src/CommonUtilities.DownloadManager.csproj | 4 ++-- .../test/CommonUtilities.DownloadManager.Test.csproj | 4 ++-- .../src/CommonUtilities.SimplePipeline.csproj | 4 ++-- .../test/CommonUtilities.SimplePipeline.Test.csproj | 4 ++-- .../CommonUtilities.TestingUtilities.csproj | 4 ++-- src/CommonUtilities/src/CommonUtilities.csproj | 4 ++-- src/CommonUtilities/test/CommonUtilities.Test.csproj | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj b/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj index da8222c..8ce197b 100644 --- a/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj +++ b/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj @@ -30,8 +30,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj b/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj index 4105013..9716d5b 100644 --- a/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj +++ b/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj @@ -17,12 +17,12 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj b/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj index f5ae696..a596a25 100644 --- a/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj +++ b/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj @@ -25,8 +25,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj b/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj index f8aa949..e16694e 100644 --- a/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj +++ b/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj @@ -21,8 +21,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj b/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj index 3006fe0..5b87015 100644 --- a/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj +++ b/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj @@ -21,8 +21,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/src/CommonUtilities/src/CommonUtilities.csproj b/src/CommonUtilities/src/CommonUtilities.csproj index 879548b..40d7c50 100644 --- a/src/CommonUtilities/src/CommonUtilities.csproj +++ b/src/CommonUtilities/src/CommonUtilities.csproj @@ -26,8 +26,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all diff --git a/src/CommonUtilities/test/CommonUtilities.Test.csproj b/src/CommonUtilities/test/CommonUtilities.Test.csproj index 9622cea..7704ffb 100644 --- a/src/CommonUtilities/test/CommonUtilities.Test.csproj +++ b/src/CommonUtilities/test/CommonUtilities.Test.csproj @@ -18,8 +18,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + From 79c0573f1b2ddb3ce0acb585851d38eadb955af0 Mon Sep 17 00:00:00 2001 From: AnakinRaW Date: Wed, 11 Jun 2025 10:43:39 +0200 Subject: [PATCH 02/23] update deps --- .../src/CommonUtilities.DownloadManager.csproj | 4 ++-- .../test/CommonUtilities.DownloadManager.Test.csproj | 6 +++--- .../test/CommonUtilities.FileSystem.Test.csproj | 4 ++-- .../test/CommonUtilities.Registry.Test.csproj | 4 ++-- .../src/CommonUtilities.SimplePipeline.csproj | 4 ++-- .../test/CommonUtilities.SimplePipeline.Test.csproj | 8 ++++---- .../CommonUtilities.TestingUtilities.csproj | 11 ++++++----- src/CommonUtilities/src/CommonUtilities.csproj | 4 ++-- src/CommonUtilities/test/CommonUtilities.Test.csproj | 12 ++++++++---- 9 files changed, 31 insertions(+), 26 deletions(-) diff --git a/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj b/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj index 8ce197b..3f0bb38 100644 --- a/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj +++ b/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj @@ -30,8 +30,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj b/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj index 9716d5b..8097a45 100644 --- a/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj +++ b/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj @@ -22,11 +22,11 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj b/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj index 78a5670..7e97959 100644 --- a/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj +++ b/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj @@ -23,14 +23,14 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj b/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj index 771d337..eefcc3c 100644 --- a/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj +++ b/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj @@ -30,9 +30,9 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj b/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj index a596a25..c89ae8f 100644 --- a/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj +++ b/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj @@ -25,8 +25,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj b/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj index e16694e..9b45d06 100644 --- a/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj +++ b/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj @@ -21,12 +21,12 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj b/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj index 5b87015..398a9d5 100644 --- a/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj +++ b/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj @@ -13,19 +13,20 @@ + true xUnit2013 - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/CommonUtilities/src/CommonUtilities.csproj b/src/CommonUtilities/src/CommonUtilities.csproj index 40d7c50..ad6d580 100644 --- a/src/CommonUtilities/src/CommonUtilities.csproj +++ b/src/CommonUtilities/src/CommonUtilities.csproj @@ -26,8 +26,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all diff --git a/src/CommonUtilities/test/CommonUtilities.Test.csproj b/src/CommonUtilities/test/CommonUtilities.Test.csproj index 7704ffb..f946662 100644 --- a/src/CommonUtilities/test/CommonUtilities.Test.csproj +++ b/src/CommonUtilities/test/CommonUtilities.Test.csproj @@ -13,17 +13,21 @@ true + + true + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 60037a81d1c24a280439c2ceb2c99cad2313329f Mon Sep 17 00:00:00 2001 From: AnakinRaW Date: Wed, 11 Jun 2025 10:58:19 +0200 Subject: [PATCH 03/23] fix deps update --- .../test/PathNormalizerTest.Normalize.cs | 4 ++-- .../CommonUtilities.TestingUtilities.csproj | 5 ++--- src/CommonUtilities/test/CommonUtilities.Test.csproj | 8 ++------ 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/CommonUtilities.FileSystem/test/PathNormalizerTest.Normalize.cs b/src/CommonUtilities.FileSystem/test/PathNormalizerTest.Normalize.cs index 7191087..dbef7e4 100644 --- a/src/CommonUtilities.FileSystem/test/PathNormalizerTest.Normalize.cs +++ b/src/CommonUtilities.FileSystem/test/PathNormalizerTest.Normalize.cs @@ -358,7 +358,7 @@ private static IEnumerable NormalizeTestDataSource() Input = new string('a', 300), ExpectedLinux = new string('a', 300) + "/", ExpectedWindows = new string('a', 300) + "\\", - Options = new PathNormalizeOptions() + Options = new PathNormalizeOptions { TrailingDirectorySeparatorBehavior = TrailingDirectorySeparatorBehavior.Ensure } @@ -368,7 +368,7 @@ private static IEnumerable NormalizeTestDataSource() Input = new string('a', 300) + "/", ExpectedLinux = new string('a', 300), ExpectedWindows = new string('a', 300), - Options = new PathNormalizeOptions() + Options = new PathNormalizeOptions { TrailingDirectorySeparatorBehavior = TrailingDirectorySeparatorBehavior.Trim } diff --git a/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj b/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj index 398a9d5..4b3cd48 100644 --- a/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj +++ b/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj @@ -1,7 +1,7 @@ - + - net9.0;net6.0 + net9.0 $(TargetFrameworks);net48 enable enable @@ -13,7 +13,6 @@ - true xUnit2013 diff --git a/src/CommonUtilities/test/CommonUtilities.Test.csproj b/src/CommonUtilities/test/CommonUtilities.Test.csproj index f946662..cc7084d 100644 --- a/src/CommonUtilities/test/CommonUtilities.Test.csproj +++ b/src/CommonUtilities/test/CommonUtilities.Test.csproj @@ -1,7 +1,7 @@ - + - net9.0;net6.0 + net9.0;net8.0 $(TargetFrameworks);net48 false true @@ -13,10 +13,6 @@ true - - true - - all From 327ed61edc916c6f15366a3a9194a5eeb28e4a34 Mon Sep 17 00:00:00 2001 From: AnakinRaW Date: Wed, 11 Jun 2025 11:01:11 +0200 Subject: [PATCH 04/23] try fix --- .../CommonUtilities.TestingUtilities.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj b/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj index 4b3cd48..916bbea 100644 --- a/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj +++ b/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj @@ -1,7 +1,7 @@  - net9.0 + net9.0;net8.0 $(TargetFrameworks);net48 enable enable From 41426284e95e1227b2536476540a3b579b1d3e42 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 09:27:49 +0200 Subject: [PATCH 05/23] Bump the all-deps group with 1 update (#227) Bumps System.Linq.Async to 6.0.3 --- updated-dependencies: - dependency-name: System.Linq.Async dependency-version: 6.0.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: System.Linq.Async dependency-version: 6.0.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../test/CommonUtilities.SimplePipeline.Test.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj b/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj index 9b45d06..ddcfb31 100644 --- a/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj +++ b/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj @@ -24,7 +24,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive From f554717d285de43fcea25f1d653893051910140a Mon Sep 17 00:00:00 2001 From: AnakinRaW Date: Tue, 15 Jul 2025 13:07:51 +0200 Subject: [PATCH 06/23] update deps & fix test --- .../src/CommonUtilities.DownloadManager.csproj | 4 ++-- .../test/CommonUtilities.DownloadManager.Test.csproj | 6 +++--- .../test/DownloadManagerTest.cs | 2 +- .../src/Commonutilities.FileSystem.csproj | 2 +- .../test/CommonUtilities.FileSystem.Test.csproj | 4 ++-- .../test/CommonUtilities.Registry.Test.csproj | 2 +- .../src/CommonUtilities.SimplePipeline.csproj | 4 ++-- .../test/CommonUtilities.SimplePipeline.Test.csproj | 6 +++--- .../CommonUtilities.TestingUtilities.csproj | 8 ++++---- src/CommonUtilities/src/CommonUtilities.csproj | 4 ++-- src/CommonUtilities/test/CommonUtilities.Test.csproj | 8 ++++---- 11 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj b/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj index 3f0bb38..b5c0146 100644 --- a/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj +++ b/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj @@ -30,8 +30,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj b/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj index 8097a45..f5b3e1c 100644 --- a/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj +++ b/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj @@ -22,11 +22,11 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/CommonUtilities.DownloadManager/test/DownloadManagerTest.cs b/src/CommonUtilities.DownloadManager/test/DownloadManagerTest.cs index be76d26..42b1c9b 100644 --- a/src/CommonUtilities.DownloadManager/test/DownloadManagerTest.cs +++ b/src/CommonUtilities.DownloadManager/test/DownloadManagerTest.cs @@ -216,7 +216,7 @@ public async Task DownloadAsync_GithubApi() await DownloadAsyncTest(provider, uri, true, new DownloadOptions { UserAgent = "AnakinRaw.DownloadManager.Test" }, null); - Assert.Equal(2566, FileSystem.File.ReadAllText(Destination).Length); + Assert.Equal(2584, FileSystem.File.ReadAllText(Destination).Length); } #if NETFRAMEWORK diff --git a/src/CommonUtilities.FileSystem/src/Commonutilities.FileSystem.csproj b/src/CommonUtilities.FileSystem/src/Commonutilities.FileSystem.csproj index e2e2045..61e0960 100644 --- a/src/CommonUtilities.FileSystem/src/Commonutilities.FileSystem.csproj +++ b/src/CommonUtilities.FileSystem/src/Commonutilities.FileSystem.csproj @@ -33,7 +33,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj b/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj index 7e97959..2353e51 100644 --- a/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj +++ b/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj @@ -28,9 +28,9 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj b/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj index eefcc3c..f25c657 100644 --- a/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj +++ b/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj @@ -32,7 +32,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj b/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj index c89ae8f..70a362d 100644 --- a/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj +++ b/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj @@ -25,8 +25,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj b/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj index ddcfb31..fc5062a 100644 --- a/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj +++ b/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj @@ -21,12 +21,12 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj b/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj index 916bbea..9b967fe 100644 --- a/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj +++ b/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj @@ -21,16 +21,16 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/CommonUtilities/src/CommonUtilities.csproj b/src/CommonUtilities/src/CommonUtilities.csproj index ad6d580..0659a0b 100644 --- a/src/CommonUtilities/src/CommonUtilities.csproj +++ b/src/CommonUtilities/src/CommonUtilities.csproj @@ -26,8 +26,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all diff --git a/src/CommonUtilities/test/CommonUtilities.Test.csproj b/src/CommonUtilities/test/CommonUtilities.Test.csproj index cc7084d..1f0d922 100644 --- a/src/CommonUtilities/test/CommonUtilities.Test.csproj +++ b/src/CommonUtilities/test/CommonUtilities.Test.csproj @@ -18,12 +18,12 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all From c5b1b1dbfabd1f535c62eb165fc414ea5a066f5b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 13:37:26 +0200 Subject: [PATCH 07/23] Bump Microsoft.Bcl.AsyncInterfaces from 6.0.0 to 9.0.7 (#238) --- updated-dependencies: - dependency-name: Microsoft.Bcl.AsyncInterfaces dependency-version: 9.0.7 dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../CommonUtilities.TestingUtilities.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj b/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj index 9b967fe..13da3c3 100644 --- a/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj +++ b/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj @@ -21,6 +21,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive + From d0b30e939957ce300beb79e9e3a3f1fcd0428dc2 Mon Sep 17 00:00:00 2001 From: AnakinRaW Date: Sat, 16 Aug 2025 19:16:21 +0200 Subject: [PATCH 08/23] update deps --- .../src/CommonUtilities.DownloadManager.csproj | 4 ++-- .../test/CommonUtilities.DownloadManager.Test.csproj | 6 +++--- .../src/Commonutilities.FileSystem.csproj | 2 +- .../test/CommonUtilities.FileSystem.Test.csproj | 4 ++-- .../test/CommonUtilities.Registry.Test.csproj | 2 +- .../src/CommonUtilities.SimplePipeline.csproj | 4 ++-- .../test/CommonUtilities.SimplePipeline.Test.csproj | 6 +++--- .../CommonUtilities.TestingUtilities.csproj | 10 +++++----- src/CommonUtilities/src/CommonUtilities.csproj | 4 ++-- src/CommonUtilities/test/CommonUtilities.Test.csproj | 8 ++++---- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj b/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj index b5c0146..584403b 100644 --- a/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj +++ b/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj @@ -30,8 +30,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj b/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj index f5b3e1c..63119e4 100644 --- a/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj +++ b/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj @@ -22,11 +22,11 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/CommonUtilities.FileSystem/src/Commonutilities.FileSystem.csproj b/src/CommonUtilities.FileSystem/src/Commonutilities.FileSystem.csproj index 61e0960..5b6fd5f 100644 --- a/src/CommonUtilities.FileSystem/src/Commonutilities.FileSystem.csproj +++ b/src/CommonUtilities.FileSystem/src/Commonutilities.FileSystem.csproj @@ -33,7 +33,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj b/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj index 2353e51..613f4a4 100644 --- a/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj +++ b/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj @@ -28,9 +28,9 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj b/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj index f25c657..a9afdce 100644 --- a/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj +++ b/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj @@ -32,7 +32,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj b/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj index 70a362d..319f4ea 100644 --- a/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj +++ b/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj @@ -25,8 +25,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj b/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj index fc5062a..b6bb95a 100644 --- a/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj +++ b/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj @@ -21,12 +21,12 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj b/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj index 13da3c3..30f9a8b 100644 --- a/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj +++ b/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj @@ -21,17 +21,17 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/CommonUtilities/src/CommonUtilities.csproj b/src/CommonUtilities/src/CommonUtilities.csproj index 0659a0b..0b027be 100644 --- a/src/CommonUtilities/src/CommonUtilities.csproj +++ b/src/CommonUtilities/src/CommonUtilities.csproj @@ -26,8 +26,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all diff --git a/src/CommonUtilities/test/CommonUtilities.Test.csproj b/src/CommonUtilities/test/CommonUtilities.Test.csproj index 1f0d922..bbdf7f5 100644 --- a/src/CommonUtilities/test/CommonUtilities.Test.csproj +++ b/src/CommonUtilities/test/CommonUtilities.Test.csproj @@ -18,12 +18,12 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 1725ecaf35bb23cd05b46c634a556eeb3232ba60 Mon Sep 17 00:00:00 2001 From: AnakinRaW Date: Sat, 16 Aug 2025 19:25:20 +0200 Subject: [PATCH 09/23] fix test --- src/CommonUtilities.DownloadManager/test/DownloadManagerTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CommonUtilities.DownloadManager/test/DownloadManagerTest.cs b/src/CommonUtilities.DownloadManager/test/DownloadManagerTest.cs index 42b1c9b..8f185d9 100644 --- a/src/CommonUtilities.DownloadManager/test/DownloadManagerTest.cs +++ b/src/CommonUtilities.DownloadManager/test/DownloadManagerTest.cs @@ -216,7 +216,7 @@ public async Task DownloadAsync_GithubApi() await DownloadAsyncTest(provider, uri, true, new DownloadOptions { UserAgent = "AnakinRaw.DownloadManager.Test" }, null); - Assert.Equal(2584, FileSystem.File.ReadAllText(Destination).Length); + Assert.Equal(2620, FileSystem.File.ReadAllText(Destination).Length); } #if NETFRAMEWORK From 88c27765bd46842acf0391e0859434207a708922 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Aug 2025 16:32:00 +0200 Subject: [PATCH 10/23] Bump the actions-deps group across 1 directory with 2 updates (#245) Bumps the actions-deps group with 2 updates in the / directory: [actions/checkout](https://github.com/actions/checkout) and [actions/download-artifact](https://github.com/actions/download-artifact). Updates `actions/checkout` from 4 to 5 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) Updates `actions/download-artifact` from 4 to 5 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions-deps - dependency-name: actions/download-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions-deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: AnakinRaW --- .github/workflows/release.yml | 6 +++--- .github/workflows/test.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 878b324..83afd69 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout source - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 - name: Setup .NET @@ -40,12 +40,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 - name: Setup .NET uses: actions/setup-dotnet@v4 - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v5 with: name: NuGet packages path: packages diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d9bcbd8..42c6320 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 - uses: actions/setup-dotnet@v4 From 2b7c72270e2d72d4e3971db865c09c3cb3faa47e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Sep 2025 13:13:19 +0200 Subject: [PATCH 11/23] Bump actions/setup-dotnet from 4 to 5 in the actions-deps group (#247) Bumps the actions-deps group with 1 update: [actions/setup-dotnet](https://github.com/actions/setup-dotnet). Updates `actions/setup-dotnet` from 4 to 5 - [Release notes](https://github.com/actions/setup-dotnet/releases) - [Commits](https://github.com/actions/setup-dotnet/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-dotnet dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions-deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 4 ++-- .github/workflows/test.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 83afd69..90c181b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ jobs: with: fetch-depth: 0 - name: Setup .NET - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5 with: dotnet-version: '9.0.x' - name: Create packages @@ -44,7 +44,7 @@ jobs: with: fetch-depth: 0 - name: Setup .NET - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5 - uses: actions/download-artifact@v5 with: name: NuGet packages diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 42c6320..4aa87c2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v5 with: fetch-depth: 0 - - uses: actions/setup-dotnet@v4 + - uses: actions/setup-dotnet@v5 with: dotnet-version: | 6.0.x From 5f3efd821c6213b88a5dd287890d49e33ff0994f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Sep 2025 09:24:30 +0200 Subject: [PATCH 12/23] Bump the all-deps group with 6 updates (#253) Bumps Microsoft.Bcl.AsyncInterfaces from 9.0.8 to 9.0.9 Bumps Microsoft.Extensions.DependencyInjection from 9.0.8 to 9.0.9 Bumps Microsoft.Extensions.DependencyInjection.Abstractions from 9.0.8 to 9.0.9 Bumps Microsoft.Extensions.Logging.Abstractions from 9.0.8 to 9.0.9 Bumps Testably.Abstractions.AccessControl from 4.3.2 to 4.3.6 Bumps Testably.Abstractions.Testing from 4.3.2 to 4.3.6 --- updated-dependencies: - dependency-name: Microsoft.Bcl.AsyncInterfaces dependency-version: 9.0.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Microsoft.Bcl.AsyncInterfaces dependency-version: 9.0.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Microsoft.Extensions.DependencyInjection dependency-version: 9.0.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Microsoft.Extensions.DependencyInjection dependency-version: 9.0.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Microsoft.Extensions.DependencyInjection dependency-version: 9.0.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Microsoft.Extensions.DependencyInjection.Abstractions dependency-version: 9.0.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Microsoft.Extensions.DependencyInjection dependency-version: 9.0.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Microsoft.Extensions.DependencyInjection.Abstractions dependency-version: 9.0.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Microsoft.Extensions.DependencyInjection.Abstractions dependency-version: 9.0.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Microsoft.Extensions.DependencyInjection.Abstractions dependency-version: 9.0.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Microsoft.Extensions.DependencyInjection.Abstractions dependency-version: 9.0.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Microsoft.Extensions.Logging.Abstractions dependency-version: 9.0.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Microsoft.Extensions.Logging.Abstractions dependency-version: 9.0.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Microsoft.Extensions.Logging.Abstractions dependency-version: 9.0.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Testably.Abstractions.AccessControl dependency-version: 4.3.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Testably.Abstractions.Testing dependency-version: 4.3.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Testably.Abstractions.Testing dependency-version: 4.3.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Testably.Abstractions.Testing dependency-version: 4.3.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps - dependency-name: Testably.Abstractions.Testing dependency-version: 4.3.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../src/CommonUtilities.DownloadManager.csproj | 4 ++-- .../test/CommonUtilities.DownloadManager.Test.csproj | 4 ++-- .../src/Commonutilities.FileSystem.csproj | 2 +- .../test/CommonUtilities.FileSystem.Test.csproj | 2 +- .../src/CommonUtilities.SimplePipeline.csproj | 4 ++-- .../test/CommonUtilities.SimplePipeline.Test.csproj | 4 ++-- .../CommonUtilities.TestingUtilities.csproj | 8 ++++---- src/CommonUtilities/src/CommonUtilities.csproj | 4 ++-- src/CommonUtilities/test/CommonUtilities.Test.csproj | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj b/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj index 584403b..7c96736 100644 --- a/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj +++ b/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj @@ -30,8 +30,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj b/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj index 63119e4..91aa092 100644 --- a/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj +++ b/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj @@ -22,9 +22,9 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/CommonUtilities.FileSystem/src/Commonutilities.FileSystem.csproj b/src/CommonUtilities.FileSystem/src/Commonutilities.FileSystem.csproj index 5b6fd5f..8cff20b 100644 --- a/src/CommonUtilities.FileSystem/src/Commonutilities.FileSystem.csproj +++ b/src/CommonUtilities.FileSystem/src/Commonutilities.FileSystem.csproj @@ -33,7 +33,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj b/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj index 613f4a4..e7304d5 100644 --- a/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj +++ b/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj @@ -28,7 +28,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj b/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj index 319f4ea..05e8aaa 100644 --- a/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj +++ b/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj @@ -25,8 +25,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj b/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj index b6bb95a..be36538 100644 --- a/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj +++ b/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj @@ -21,8 +21,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj b/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj index 30f9a8b..4808229 100644 --- a/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj +++ b/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj @@ -21,9 +21,9 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + @@ -31,7 +31,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/CommonUtilities/src/CommonUtilities.csproj b/src/CommonUtilities/src/CommonUtilities.csproj index 0b027be..149a376 100644 --- a/src/CommonUtilities/src/CommonUtilities.csproj +++ b/src/CommonUtilities/src/CommonUtilities.csproj @@ -26,8 +26,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all diff --git a/src/CommonUtilities/test/CommonUtilities.Test.csproj b/src/CommonUtilities/test/CommonUtilities.Test.csproj index bbdf7f5..eae50ec 100644 --- a/src/CommonUtilities/test/CommonUtilities.Test.csproj +++ b/src/CommonUtilities/test/CommonUtilities.Test.csproj @@ -18,10 +18,10 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - + runtime; build; native; contentfiles; analyzers; buildtransitive From 662f9d98fbcf87674f4dcec8b6d209ed0875e1f2 Mon Sep 17 00:00:00 2001 From: AnakinRaW Date: Thu, 2 Oct 2025 09:35:35 +0200 Subject: [PATCH 13/23] update deps --- Directory.Build.props | 2 +- .../test/CommonUtilities.DownloadManager.Test.csproj | 4 ++-- .../src/Commonutilities.FileSystem.csproj | 2 +- .../test/CommonUtilities.FileSystem.Test.csproj | 4 ++-- .../test/CommonUtilities.Registry.Test.csproj | 2 +- .../test/CommonUtilities.SimplePipeline.Test.csproj | 2 +- .../CommonUtilities.TestingUtilities.csproj | 4 ++-- src/CommonUtilities/test/CommonUtilities.Test.csproj | 4 ++-- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index f7a8bf7..54a1c15 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -25,7 +25,7 @@ all - 3.7.115 + 3.8.118 diff --git a/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj b/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj index 91aa092..d2f003d 100644 --- a/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj +++ b/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj @@ -24,9 +24,9 @@ - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/CommonUtilities.FileSystem/src/Commonutilities.FileSystem.csproj b/src/CommonUtilities.FileSystem/src/Commonutilities.FileSystem.csproj index 8cff20b..93a8dce 100644 --- a/src/CommonUtilities.FileSystem/src/Commonutilities.FileSystem.csproj +++ b/src/CommonUtilities.FileSystem/src/Commonutilities.FileSystem.csproj @@ -33,7 +33,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj b/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj index e7304d5..cc478bd 100644 --- a/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj +++ b/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj @@ -28,9 +28,9 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj b/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj index a9afdce..7a22740 100644 --- a/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj +++ b/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj @@ -32,7 +32,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj b/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj index be36538..ae6631d 100644 --- a/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj +++ b/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj @@ -26,7 +26,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj b/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj index 4808229..1226115 100644 --- a/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj +++ b/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj @@ -26,12 +26,12 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/CommonUtilities/test/CommonUtilities.Test.csproj b/src/CommonUtilities/test/CommonUtilities.Test.csproj index eae50ec..d425c2c 100644 --- a/src/CommonUtilities/test/CommonUtilities.Test.csproj +++ b/src/CommonUtilities/test/CommonUtilities.Test.csproj @@ -21,9 +21,9 @@ - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 9175dd38e9da60a4346c288424799d84bfb8ffdd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 16:11:26 +0200 Subject: [PATCH 14/23] Bump the all-deps group with 1 update (#264) Bumps Microsoft.NET.Test.Sdk from 17.14.1 to 18.0.0 --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-version: 18.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-deps - dependency-name: Microsoft.NET.Test.Sdk dependency-version: 18.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-deps - dependency-name: Microsoft.NET.Test.Sdk dependency-version: 18.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-deps - dependency-name: Microsoft.NET.Test.Sdk dependency-version: 18.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-deps - dependency-name: Microsoft.NET.Test.Sdk dependency-version: 18.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-deps - dependency-name: Microsoft.NET.Test.Sdk dependency-version: 18.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../test/CommonUtilities.DownloadManager.Test.csproj | 2 +- .../test/CommonUtilities.FileSystem.Test.csproj | 2 +- .../test/CommonUtilities.Registry.Test.csproj | 2 +- .../test/CommonUtilities.SimplePipeline.Test.csproj | 2 +- .../CommonUtilities.TestingUtilities.csproj | 2 +- src/CommonUtilities/test/CommonUtilities.Test.csproj | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj b/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj index d2f003d..80f5cac 100644 --- a/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj +++ b/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj @@ -23,7 +23,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj b/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj index cc478bd..330e8e0 100644 --- a/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj +++ b/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj @@ -23,7 +23,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj b/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj index 7a22740..9452aff 100644 --- a/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj +++ b/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj @@ -30,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj b/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj index ae6631d..c387af0 100644 --- a/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj +++ b/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj @@ -23,7 +23,7 @@ - + diff --git a/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj b/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj index 1226115..01b2507 100644 --- a/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj +++ b/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj @@ -24,7 +24,7 @@ - + all diff --git a/src/CommonUtilities/test/CommonUtilities.Test.csproj b/src/CommonUtilities/test/CommonUtilities.Test.csproj index d425c2c..3433909 100644 --- a/src/CommonUtilities/test/CommonUtilities.Test.csproj +++ b/src/CommonUtilities/test/CommonUtilities.Test.csproj @@ -20,7 +20,7 @@ - + From eed19a7a784be0532b2199bf883099745e74c3ed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 7 Dec 2025 17:03:55 +0100 Subject: [PATCH 15/23] Bump the actions-deps group across 1 directory with 3 updates (#286) Bumps the actions-deps group with 3 updates in the / directory: [actions/checkout](https://github.com/actions/checkout), [actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/download-artifact](https://github.com/actions/download-artifact). Updates `actions/checkout` from 5 to 6 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v5...v6) Updates `actions/upload-artifact` from 4 to 5 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v4...v5) Updates `actions/download-artifact` from 5 to 6 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions-deps - dependency-name: actions/upload-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions-deps - dependency-name: actions/download-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions-deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 8 ++++---- .github/workflows/test.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 90c181b..142b2d4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout source - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: fetch-depth: 0 - name: Setup .NET @@ -27,7 +27,7 @@ jobs: - name: Create packages run: dotnet pack --configuration Release --output ./packages - name: Upload a Build Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v5 with: name: NuGet packages path: packages/*.* @@ -40,12 +40,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: fetch-depth: 0 - name: Setup .NET uses: actions/setup-dotnet@v5 - - uses: actions/download-artifact@v5 + - uses: actions/download-artifact@v6 with: name: NuGet packages path: packages diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4aa87c2..f3d3195 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: actions/setup-dotnet@v5 From 5ef2eac27301d357929a36b6977988b836a93fb8 Mon Sep 17 00:00:00 2001 From: AnakinRaW Date: Sun, 7 Dec 2025 17:06:10 +0100 Subject: [PATCH 16/23] migrate solution --- CommonUtilities.sln | 107 ------------------------------------------- CommonUtilities.slnx | 23 ++++++++++ 2 files changed, 23 insertions(+), 107 deletions(-) delete mode 100644 CommonUtilities.sln create mode 100644 CommonUtilities.slnx diff --git a/CommonUtilities.sln b/CommonUtilities.sln deleted file mode 100644 index 7b71a5c..0000000 --- a/CommonUtilities.sln +++ /dev/null @@ -1,107 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31717.71 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CommonUtilities", "CommonUtilities", "{9CD34E8E-2082-46F9-B7EE-3DD4D1385B04}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommonUtilities", "src\CommonUtilities\src\CommonUtilities.csproj", "{59CB2F45-CC0C-46C3-B6D6-581A7C123295}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommonUtilities.Test", "src\CommonUtilities\test\CommonUtilities.Test.csproj", "{EAEF69D0-BA59-4397-ABC0-5E7ED397FDB4}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CommonUtilities.FileSystem", "CommonUtilities.FileSystem", "{6DC3D9F6-3394-46E3-B582-6A022FCCE397}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commonutilities.FileSystem", "src\CommonUtilities.FileSystem\src\Commonutilities.FileSystem.csproj", "{629247FB-648B-4F7D-9039-15D74102B4C5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommonUtilities.FileSystem.Test", "src\CommonUtilities.FileSystem\test\CommonUtilities.FileSystem.Test.csproj", "{C6AB748E-AEC2-4793-A8D6-F91F46CE098C}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CommonUtilities.Registry", "CommonUtilities.Registry", "{EDF446DD-BE04-4FE2-93A5-6171A0EC8C82}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommonUtilities.Registry", "src\CommonUtilities.Registry\src\CommonUtilities.Registry.csproj", "{2BE46A1C-8D01-422D-8FD5-A2885305A92D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommonUtilities.Registry.Test", "src\CommonUtilities.Registry\test\CommonUtilities.Registry.Test.csproj", "{375178FD-0D91-43B7-A731-1419808718E5}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CommonUtilities.DownloadManager", "CommonUtilities.DownloadManager", "{F306B877-4E2C-4D6F-BF68-96D2BD23FB69}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommonUtilities.DownloadManager", "src\CommonUtilities.DownloadManager\src\CommonUtilities.DownloadManager.csproj", "{9F9E1DA3-E4DC-4590-A3BF-09AA9286271E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommonUtilities.DownloadManager.Test", "src\CommonUtilities.DownloadManager\test\CommonUtilities.DownloadManager.Test.csproj", "{B67F61B6-489C-4036-9380-8B8DB45AB295}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CommonUtilities.SimplePipeline", "CommonUtilities.SimplePipeline", "{9D9B958B-7495-4614-8D0D-47587C8FEBC4}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommonUtilities.SimplePipeline", "src\CommonUtilities.SimplePipeline\src\CommonUtilities.SimplePipeline.csproj", "{283BBAA8-482D-4DB5-9707-3F325D2AE41F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommonUtilities.SimplePipeline.Test", "src\CommonUtilities.SimplePipeline\test\CommonUtilities.SimplePipeline.Test.csproj", "{C8BF3F01-B1D5-4C29-9164-6DC7B9744589}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommonUtilities.TestingUtilities", "src\CommonUtilities.TestingUtilities\CommonUtilities.TestingUtilities.csproj", "{99A3B9B4-6482-410A-A001-9D62F4B259CC}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {59CB2F45-CC0C-46C3-B6D6-581A7C123295}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {59CB2F45-CC0C-46C3-B6D6-581A7C123295}.Debug|Any CPU.Build.0 = Debug|Any CPU - {59CB2F45-CC0C-46C3-B6D6-581A7C123295}.Release|Any CPU.ActiveCfg = Release|Any CPU - {59CB2F45-CC0C-46C3-B6D6-581A7C123295}.Release|Any CPU.Build.0 = Release|Any CPU - {EAEF69D0-BA59-4397-ABC0-5E7ED397FDB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EAEF69D0-BA59-4397-ABC0-5E7ED397FDB4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EAEF69D0-BA59-4397-ABC0-5E7ED397FDB4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EAEF69D0-BA59-4397-ABC0-5E7ED397FDB4}.Release|Any CPU.Build.0 = Release|Any CPU - {629247FB-648B-4F7D-9039-15D74102B4C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {629247FB-648B-4F7D-9039-15D74102B4C5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {629247FB-648B-4F7D-9039-15D74102B4C5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {629247FB-648B-4F7D-9039-15D74102B4C5}.Release|Any CPU.Build.0 = Release|Any CPU - {C6AB748E-AEC2-4793-A8D6-F91F46CE098C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C6AB748E-AEC2-4793-A8D6-F91F46CE098C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C6AB748E-AEC2-4793-A8D6-F91F46CE098C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C6AB748E-AEC2-4793-A8D6-F91F46CE098C}.Release|Any CPU.Build.0 = Release|Any CPU - {2BE46A1C-8D01-422D-8FD5-A2885305A92D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2BE46A1C-8D01-422D-8FD5-A2885305A92D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2BE46A1C-8D01-422D-8FD5-A2885305A92D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2BE46A1C-8D01-422D-8FD5-A2885305A92D}.Release|Any CPU.Build.0 = Release|Any CPU - {375178FD-0D91-43B7-A731-1419808718E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {375178FD-0D91-43B7-A731-1419808718E5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {375178FD-0D91-43B7-A731-1419808718E5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {375178FD-0D91-43B7-A731-1419808718E5}.Release|Any CPU.Build.0 = Release|Any CPU - {9F9E1DA3-E4DC-4590-A3BF-09AA9286271E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9F9E1DA3-E4DC-4590-A3BF-09AA9286271E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9F9E1DA3-E4DC-4590-A3BF-09AA9286271E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9F9E1DA3-E4DC-4590-A3BF-09AA9286271E}.Release|Any CPU.Build.0 = Release|Any CPU - {B67F61B6-489C-4036-9380-8B8DB45AB295}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B67F61B6-489C-4036-9380-8B8DB45AB295}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B67F61B6-489C-4036-9380-8B8DB45AB295}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B67F61B6-489C-4036-9380-8B8DB45AB295}.Release|Any CPU.Build.0 = Release|Any CPU - {283BBAA8-482D-4DB5-9707-3F325D2AE41F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {283BBAA8-482D-4DB5-9707-3F325D2AE41F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {283BBAA8-482D-4DB5-9707-3F325D2AE41F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {283BBAA8-482D-4DB5-9707-3F325D2AE41F}.Release|Any CPU.Build.0 = Release|Any CPU - {C8BF3F01-B1D5-4C29-9164-6DC7B9744589}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C8BF3F01-B1D5-4C29-9164-6DC7B9744589}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C8BF3F01-B1D5-4C29-9164-6DC7B9744589}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C8BF3F01-B1D5-4C29-9164-6DC7B9744589}.Release|Any CPU.Build.0 = Release|Any CPU - {99A3B9B4-6482-410A-A001-9D62F4B259CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {99A3B9B4-6482-410A-A001-9D62F4B259CC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {99A3B9B4-6482-410A-A001-9D62F4B259CC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {99A3B9B4-6482-410A-A001-9D62F4B259CC}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {59CB2F45-CC0C-46C3-B6D6-581A7C123295} = {9CD34E8E-2082-46F9-B7EE-3DD4D1385B04} - {EAEF69D0-BA59-4397-ABC0-5E7ED397FDB4} = {9CD34E8E-2082-46F9-B7EE-3DD4D1385B04} - {629247FB-648B-4F7D-9039-15D74102B4C5} = {6DC3D9F6-3394-46E3-B582-6A022FCCE397} - {C6AB748E-AEC2-4793-A8D6-F91F46CE098C} = {6DC3D9F6-3394-46E3-B582-6A022FCCE397} - {2BE46A1C-8D01-422D-8FD5-A2885305A92D} = {EDF446DD-BE04-4FE2-93A5-6171A0EC8C82} - {375178FD-0D91-43B7-A731-1419808718E5} = {EDF446DD-BE04-4FE2-93A5-6171A0EC8C82} - {9F9E1DA3-E4DC-4590-A3BF-09AA9286271E} = {F306B877-4E2C-4D6F-BF68-96D2BD23FB69} - {B67F61B6-489C-4036-9380-8B8DB45AB295} = {F306B877-4E2C-4D6F-BF68-96D2BD23FB69} - {283BBAA8-482D-4DB5-9707-3F325D2AE41F} = {9D9B958B-7495-4614-8D0D-47587C8FEBC4} - {C8BF3F01-B1D5-4C29-9164-6DC7B9744589} = {9D9B958B-7495-4614-8D0D-47587C8FEBC4} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {FAF1C2A9-02FC-459D-BE1E-BDB46E72F077} - EndGlobalSection -EndGlobal diff --git a/CommonUtilities.slnx b/CommonUtilities.slnx new file mode 100644 index 0000000..da8c736 --- /dev/null +++ b/CommonUtilities.slnx @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + From 093d3c7d4611b35c26d4d5a104e26f7f04503e99 Mon Sep 17 00:00:00 2001 From: AnakinRaW Date: Sun, 7 Dec 2025 17:18:36 +0100 Subject: [PATCH 17/23] update .net --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 1 + Directory.Build.props | 2 +- .../src/CommonUtilities.DownloadManager.csproj | 4 ++-- .../CommonUtilities.DownloadManager.Test.csproj | 14 +++++++------- .../src/Commonutilities.FileSystem.csproj | 4 ++-- .../test/CommonUtilities.FileSystem.Test.csproj | 10 +++++----- .../test/CommonUtilities.Registry.Test.csproj | 8 ++++---- .../src/CommonUtilities.SimplePipeline.csproj | 4 ++-- .../CommonUtilities.SimplePipeline.Test.csproj | 14 +++++++------- .../CommonUtilities.TestingUtilities.csproj | 16 ++++++++-------- src/CommonUtilities/src/CommonUtilities.csproj | 6 +++--- .../test/CommonUtilities.Test.csproj | 14 +++++++------- 13 files changed, 50 insertions(+), 49 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 142b2d4..f807c2e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v5 with: - dotnet-version: '9.0.x' + dotnet-version: '10.0.x' - name: Create packages run: dotnet pack --configuration Release --output ./packages - name: Upload a Build Artifact diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f3d3195..d6b9298 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,6 +27,7 @@ jobs: 6.0.x 8.0.x 9.0.x + 10.0.x - name: Build & Test in Release Mode run: dotnet test --configuration Release --logger "GitHubActions" \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index 54a1c15..9fa329e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -25,7 +25,7 @@ all - 3.8.118 + 3.9.50 diff --git a/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj b/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj index 7c96736..b3c74e5 100644 --- a/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj +++ b/src/CommonUtilities.DownloadManager/src/CommonUtilities.DownloadManager.csproj @@ -30,8 +30,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj b/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj index 80f5cac..4ead415 100644 --- a/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj +++ b/src/CommonUtilities.DownloadManager/test/CommonUtilities.DownloadManager.Test.csproj @@ -1,8 +1,8 @@ - net9.0;net8.0 - $(TargetFrameworks);net48 + net10.0;net8.0 + $(TargetFrameworks);net481 false true @@ -17,14 +17,14 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/CommonUtilities.FileSystem/src/Commonutilities.FileSystem.csproj b/src/CommonUtilities.FileSystem/src/Commonutilities.FileSystem.csproj index 93a8dce..06387b7 100644 --- a/src/CommonUtilities.FileSystem/src/Commonutilities.FileSystem.csproj +++ b/src/CommonUtilities.FileSystem/src/Commonutilities.FileSystem.csproj @@ -26,14 +26,14 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj b/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj index 330e8e0..f98eaed 100644 --- a/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj +++ b/src/CommonUtilities.FileSystem/test/CommonUtilities.FileSystem.Test.csproj @@ -1,8 +1,8 @@ - net9.0;net8.0 - $(TargetFrameworks);net48 + net10.0;net8.0 + $(TargetFrameworks);net481 false true enable @@ -15,7 +15,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -23,12 +23,12 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj b/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj index 9452aff..cb77051 100644 --- a/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj +++ b/src/CommonUtilities.Registry/test/CommonUtilities.Registry.Test.csproj @@ -1,8 +1,8 @@  - net9.0 - $(TargetFrameworks);net48 + net10.0 + $(TargetFrameworks);net481 false true enable @@ -26,11 +26,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj b/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj index 05e8aaa..318ea7f 100644 --- a/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj +++ b/src/CommonUtilities.SimplePipeline/src/CommonUtilities.SimplePipeline.csproj @@ -25,8 +25,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj b/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj index c387af0..fd1fc46 100644 --- a/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj +++ b/src/CommonUtilities.SimplePipeline/test/CommonUtilities.SimplePipeline.Test.csproj @@ -1,8 +1,8 @@ - net9.0;net8.0 - $(TargetFrameworks);net48 + net10.0;net8.0 + $(TargetFrameworks);net481 false true @@ -17,14 +17,14 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj b/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj index 01b2507..f80f3b1 100644 --- a/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj +++ b/src/CommonUtilities.TestingUtilities/CommonUtilities.TestingUtilities.csproj @@ -1,8 +1,8 @@  - net9.0;net8.0 - $(TargetFrameworks);net48 + net10.0;net8.0 + $(TargetFrameworks);net481 enable enable false @@ -21,17 +21,17 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/src/CommonUtilities/src/CommonUtilities.csproj b/src/CommonUtilities/src/CommonUtilities.csproj index 149a376..b2951cd 100644 --- a/src/CommonUtilities/src/CommonUtilities.csproj +++ b/src/CommonUtilities/src/CommonUtilities.csproj @@ -26,9 +26,9 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/CommonUtilities/test/CommonUtilities.Test.csproj b/src/CommonUtilities/test/CommonUtilities.Test.csproj index 3433909..3948201 100644 --- a/src/CommonUtilities/test/CommonUtilities.Test.csproj +++ b/src/CommonUtilities/test/CommonUtilities.Test.csproj @@ -1,8 +1,8 @@  - net9.0;net8.0 - $(TargetFrameworks);net48 + net10.0;net8.0 + $(TargetFrameworks);net481 false true @@ -14,14 +14,14 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + runtime; build; native; contentfiles; analyzers; buildtransitive From 83c15cf34b99340f717bec2da67e5f51a135a57f Mon Sep 17 00:00:00 2001 From: AnakinRaW Date: Sun, 7 Dec 2025 18:20:55 +0100 Subject: [PATCH 18/23] reduce some warnings --- .../src/Validation/HashDownloadValidator.cs | 1 - .../test/DownloadManagerTest.cs | 12 +-- .../test/Providers/HttpClientDownloadTest.cs | 1 + .../Validation/HashDownloadValidatorTest.cs | 12 ++- .../Extensions/PathExtensions.NetFramework.cs | 5 +- .../src/Utilities/ValueStringBuilder.cs | 4 +- .../Windows/WindowsFileSystemExtensions.cs | 2 +- .../PathExtensionsTest.GetDirectoryName.cs | 1 + .../test/PathExtensionsTest.GetExtension.cs | 13 +-- .../test/PathExtensionsTest.GetFileName.cs | 1 + .../test/PathExtensionsTest.GetPathRoot.cs | 51 +++++----- .../PathExtensionsTest.GetRelativePathEx.cs | 72 +++++++------- ...hExtensionsTest.HasLeadingPathSeparator.cs | 21 ++-- ...ExtensionsTest.HasTrailingPathSeparator.cs | 21 ++-- ...PathExtensionsTest.IsPathFullyQualified.cs | 14 +-- .../test/PathExtensionsTest.Join.cs | 1 + .../test/Utilities/ValueStringBuilderTest.cs | 98 +++++++++---------- .../src/IRegistryKey.cs | 3 +- .../src/InMemoryRegistryKeyData.cs | 2 +- .../Extensions/InMemoryKeyExtensionsTest.cs | 1 + .../RegistryKeyExtensionsTestBase.cs | 2 +- .../Extensions/WindowsKeyExtensionsTest.cs | 1 + .../test/RegistryKey_GetValueOrDefault.cs | 2 +- .../test/RegistryKey_GetValueOrSetDefault.cs | 2 +- .../test/RegistryTestsBase.cs | 50 +++++----- .../src/Runners/StepRunnerBase.cs | 2 +- .../src/Steps/RunPipelineStep.cs | 1 + .../test/Pipelines/ParallelPipelineTests.cs | 1 + .../ParallelProducerConsumerPipelineTest.cs | 4 + .../AggregatedProgressReporterTests.cs | 3 + .../test/Steps/WaitStepTest.cs | 2 +- .../test/TestStep.cs | 2 +- .../Collections/CollectionsTestSuite.cs | 4 +- .../Collections/ICollectionTestSuite.cs | 2 +- .../INonModifyingEnumerableTestSuite.cs | 2 + .../src/Collections/FrugalList.cs | 10 +- .../src/Collections/ReadOnlyFrugalList.cs | 11 ++- .../src/Hashing/HashTypeKey.cs | 1 + .../src/Hashing/Providers/MD5HashProvider.cs | 1 + .../src/Hashing/Providers/SHA1HashProvider.cs | 1 + .../Hashing/Providers/SHA256HashProvider.cs | 1 + .../Hashing/Providers/SHA384HashProvider.cs | 1 + .../Hashing/Providers/SHA512HashProvider.cs | 1 + .../src/NativeMethods/AdvApi32.cs | 1 + .../test/Collections/FrugalListTest.cs | 1 + .../Collections/ReadOnlyFrugalListTests.cs | 1 + .../test/Extensions/EncodingExtensionsTest.cs | 6 +- .../test/Hashing/HashTypeKeyTest.cs | 2 +- .../test/Hashing/HashingServiceTest.cs | 4 +- 49 files changed, 248 insertions(+), 210 deletions(-) diff --git a/src/CommonUtilities.DownloadManager/src/Validation/HashDownloadValidator.cs b/src/CommonUtilities.DownloadManager/src/Validation/HashDownloadValidator.cs index 33364d8..636952e 100644 --- a/src/CommonUtilities.DownloadManager/src/Validation/HashDownloadValidator.cs +++ b/src/CommonUtilities.DownloadManager/src/Validation/HashDownloadValidator.cs @@ -1,6 +1,5 @@ using System; using System.IO; -using System.Linq; using System.Threading; using System.Threading.Tasks; using AnakinRaW.CommonUtilities.Hashing; diff --git a/src/CommonUtilities.DownloadManager/test/DownloadManagerTest.cs b/src/CommonUtilities.DownloadManager/test/DownloadManagerTest.cs index 8f185d9..58cb97b 100644 --- a/src/CommonUtilities.DownloadManager/test/DownloadManagerTest.cs +++ b/src/CommonUtilities.DownloadManager/test/DownloadManagerTest.cs @@ -405,12 +405,12 @@ public async Task DownloadAsync_CancellationDoesNotRetry_Throws() { counter++; cts.Cancel(); - }, ServiceProvider); + }); var provider2 = new DelegatingFileDownloadProvider("B", () => { counter++; cts.Cancel(); - }, ServiceProvider); + }); manager.AddDownloadProvider(provider1); manager.AddDownloadProvider(provider2); @@ -470,7 +470,7 @@ public Task Validate(Stream stream, long downloadedBytes, CancellationToke } } - private class DelegatingFileDownloadProvider(string name, Action onDownload, IServiceProvider serviceProvider) : IDownloadProvider + private class DelegatingFileDownloadProvider(string name, Action onDownload) : IDownloadProvider { public string Name => name; @@ -549,10 +549,10 @@ public override void Write(byte[] buffer, int offset, int count) throw new NotImplementedException(); } - public override bool CanRead { get; } - public override bool CanSeek { get; } + public override bool CanRead => false; + public override bool CanSeek => false; public override bool CanWrite => false; - public override long Length { get; } + public override long Length => 0; public override long Position { get; set; } } } \ No newline at end of file diff --git a/src/CommonUtilities.DownloadManager/test/Providers/HttpClientDownloadTest.cs b/src/CommonUtilities.DownloadManager/test/Providers/HttpClientDownloadTest.cs index 84b4844..184248a 100644 --- a/src/CommonUtilities.DownloadManager/test/Providers/HttpClientDownloadTest.cs +++ b/src/CommonUtilities.DownloadManager/test/Providers/HttpClientDownloadTest.cs @@ -5,6 +5,7 @@ namespace AnakinRaW.CommonUtilities.DownloadManager.Test.Providers; +// ReSharper disable once UnusedMember.Global public class HttpClientDownloadTest : InternetDownloadTest { protected override Type ExpectedSourceNotFoundExceptionType => typeof(HttpRequestException); diff --git a/src/CommonUtilities.DownloadManager/test/Validation/HashDownloadValidatorTest.cs b/src/CommonUtilities.DownloadManager/test/Validation/HashDownloadValidatorTest.cs index 10d3ac4..1b83269 100644 --- a/src/CommonUtilities.DownloadManager/test/Validation/HashDownloadValidatorTest.cs +++ b/src/CommonUtilities.DownloadManager/test/Validation/HashDownloadValidatorTest.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Globalization; using System.IO; using System.Threading.Tasks; using AnakinRaW.CommonUtilities.DownloadManager.Validation; @@ -8,6 +7,9 @@ using AnakinRaW.CommonUtilities.Testing; using Microsoft.Extensions.DependencyInjection; using Xunit; +#if !NET +using System.Globalization; +#endif namespace AnakinRaW.CommonUtilities.DownloadManager.Test.Validation; @@ -188,10 +190,10 @@ public override void Write(byte[] buffer, int offset, int count) throw new NotImplementedException(); } - public override bool CanRead { get; } - public override bool CanSeek { get; } - public override bool CanWrite { get; } - public override long Length { get; } + public override bool CanRead => false; + public override bool CanSeek => false; + public override bool CanWrite => false; + public override long Length => 0; public override long Position { get; set; } } } \ No newline at end of file diff --git a/src/CommonUtilities.FileSystem/src/Extensions/PathExtensions.NetFramework.cs b/src/CommonUtilities.FileSystem/src/Extensions/PathExtensions.NetFramework.cs index 9608d9c..28bac17 100644 --- a/src/CommonUtilities.FileSystem/src/Extensions/PathExtensions.NetFramework.cs +++ b/src/CommonUtilities.FileSystem/src/Extensions/PathExtensions.NetFramework.cs @@ -3,6 +3,7 @@ using System.IO.Abstractions; using System; using System.IO; +// ReSharper disable InconsistentNaming namespace AnakinRaW.CommonUtilities.FileSystem; @@ -22,7 +23,7 @@ public static partial class PathExtensions /// /// The path to search for an extension. /// if the characters that follow the last directory separator character or volume separator - /// in the path include a period (".") followed by one or more characters; otherwise, . + /// in the path include a period ('.') followed by one or more characters; otherwise, . public static bool HasExtension(this IPath _, ReadOnlySpan path) { for (var i = path.Length - 1; i >= 0; i--) @@ -347,7 +348,7 @@ private static bool IsDeviceUNC(ReadOnlySpan path) private static bool IsExtended(ReadOnlySpan path) { // While paths like "//?/C:/" will work, they're treated the same as "\\.\" paths. - // Skipping of normalization will *only* occur if back slashes ('\') are used. + // Skipping of normalization will *only* occur if backslashes ('\') are used. return path.Length >= DevicePrefixLength && path[0] == '\\' && (path[1] == '\\' || path[1] == '?') diff --git a/src/CommonUtilities.FileSystem/src/Utilities/ValueStringBuilder.cs b/src/CommonUtilities.FileSystem/src/Utilities/ValueStringBuilder.cs index 1e4e1ce..88952b5 100644 --- a/src/CommonUtilities.FileSystem/src/Utilities/ValueStringBuilder.cs +++ b/src/CommonUtilities.FileSystem/src/Utilities/ValueStringBuilder.cs @@ -270,13 +270,13 @@ private void Grow(int additionalCapacityBeyondPos) Debug.Assert(additionalCapacityBeyondPos > 0); Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed."); - const uint ArrayMaxLength = 0x7FFFFFC7; // same as Array.MaxLength + const uint arrayMaxLength = 0x7FFFFFC7; // same as Array.MaxLength // Increase to at least the required size (_pos + additionalCapacityBeyondPos), but try // to double the size if possible, bounding the doubling to not go beyond the max array length. var newCapacity = (int)Math.Max( (uint)(_pos + additionalCapacityBeyondPos), - Math.Min((uint)_chars.Length * 2, ArrayMaxLength)); + Math.Min((uint)_chars.Length * 2, arrayMaxLength)); // Make sure to let Rent throw an exception if the caller has a bug and the desired capacity is negative. // This could also go negative if the actual required length wraps around. diff --git a/src/CommonUtilities.FileSystem/src/Windows/WindowsFileSystemExtensions.cs b/src/CommonUtilities.FileSystem/src/Windows/WindowsFileSystemExtensions.cs index 603635e..15a3447 100644 --- a/src/CommonUtilities.FileSystem/src/Windows/WindowsFileSystemExtensions.cs +++ b/src/CommonUtilities.FileSystem/src/Windows/WindowsFileSystemExtensions.cs @@ -68,7 +68,7 @@ private static bool AddPendingFileRename(string source, string? destination) try { using var registryKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default); - using var subKey = registryKey.CreateSubKey(sessionManagerKeyPath)!; + using var subKey = registryKey.CreateSubKey(sessionManagerKeyPath); var stringBuilder = new StringBuilder("\\??\\" + source + "\0"); if (!string.IsNullOrEmpty(destination)) stringBuilder.Append("\\??\\" + destination); diff --git a/src/CommonUtilities.FileSystem/test/PathExtensionsTest.GetDirectoryName.cs b/src/CommonUtilities.FileSystem/test/PathExtensionsTest.GetDirectoryName.cs index 8bf8058..aecfd0d 100644 --- a/src/CommonUtilities.FileSystem/test/PathExtensionsTest.GetDirectoryName.cs +++ b/src/CommonUtilities.FileSystem/test/PathExtensionsTest.GetDirectoryName.cs @@ -3,6 +3,7 @@ using System.IO.Abstractions; using Testably.Abstractions; using Xunit; +// ReSharper disable InconsistentNaming namespace AnakinRaW.CommonUtilities.FileSystem.Test; diff --git a/src/CommonUtilities.FileSystem/test/PathExtensionsTest.GetExtension.cs b/src/CommonUtilities.FileSystem/test/PathExtensionsTest.GetExtension.cs index f6011ec..0510d35 100644 --- a/src/CommonUtilities.FileSystem/test/PathExtensionsTest.GetExtension.cs +++ b/src/CommonUtilities.FileSystem/test/PathExtensionsTest.GetExtension.cs @@ -2,6 +2,7 @@ using System.IO.Abstractions; using Testably.Abstractions; using Xunit; +// ReSharper disable InconsistentNaming namespace AnakinRaW.CommonUtilities.FileSystem.Test; @@ -11,12 +12,12 @@ public class GetExtensionTest public static TheoryData TestData_GetExtension => new() { - { @"file.exe", ".exe" }, - { @"file", "" }, - { @"file.", "" }, - { @"file.s", ".s" }, - { @"test/file", "" }, - { @"test/file.extension", ".extension" }, + { "file.exe", ".exe" }, + { "file", "" }, + { "file.", "" }, + { "file.s", ".s" }, + { "test/file", "" }, + { "test/file.extension", ".extension" }, { @"test\file", "" }, { @"test\file.extension", ".extension" }, { "file.e xe", ".e xe"}, diff --git a/src/CommonUtilities.FileSystem/test/PathExtensionsTest.GetFileName.cs b/src/CommonUtilities.FileSystem/test/PathExtensionsTest.GetFileName.cs index c591fd3..0b3f321 100644 --- a/src/CommonUtilities.FileSystem/test/PathExtensionsTest.GetFileName.cs +++ b/src/CommonUtilities.FileSystem/test/PathExtensionsTest.GetFileName.cs @@ -5,6 +5,7 @@ using AnakinRaW.CommonUtilities.Testing; using Testably.Abstractions; using Xunit; +// ReSharper disable InconsistentNaming namespace AnakinRaW.CommonUtilities.FileSystem.Test; diff --git a/src/CommonUtilities.FileSystem/test/PathExtensionsTest.GetPathRoot.cs b/src/CommonUtilities.FileSystem/test/PathExtensionsTest.GetPathRoot.cs index 370a5fc..464f5d8 100644 --- a/src/CommonUtilities.FileSystem/test/PathExtensionsTest.GetPathRoot.cs +++ b/src/CommonUtilities.FileSystem/test/PathExtensionsTest.GetPathRoot.cs @@ -4,6 +4,7 @@ using AnakinRaW.CommonUtilities.Testing; using Testably.Abstractions; using Xunit; +// ReSharper disable InconsistentNaming namespace AnakinRaW.CommonUtilities.FileSystem.Test; @@ -28,44 +29,44 @@ public void GetPathRoot_Basic() Assert.True(_fileSystem.Path.IsPathRooted(cwd)); - Assert.Equal(string.Empty, _fileSystem.Path.GetPathRoot(@"file.exe")); - Assert.True(_fileSystem.Path.GetPathRoot(@"file.exe".AsSpan()).IsEmpty); + Assert.Equal(string.Empty, _fileSystem.Path.GetPathRoot("file.exe")); + Assert.True(_fileSystem.Path.GetPathRoot("file.exe".AsSpan()).IsEmpty); Assert.False(_fileSystem.Path.IsPathRooted("file.exe")); } [PlatformSpecificTheory(TestPlatformIdentifier.Linux)] - [InlineData(@"/../../.././tmp/..")] - [InlineData(@"/../../../")] - [InlineData(@"/../../../tmp/bar/..")] - [InlineData(@"/../.././././bar/../../../")] - [InlineData(@"/../../././tmp/..")] - [InlineData(@"/../../tmp/../../")] - [InlineData(@"/../../tmp/bar/..")] - [InlineData(@"/../tmp/../..")] - [InlineData(@"/././../../../../")] - [InlineData(@"/././../../../")] - [InlineData(@"/./././bar/../../../")] - [InlineData(@"/")] - [InlineData(@"/bar")] - [InlineData(@"/bar/././././../../..")] - [InlineData(@"/bar/tmp")] - [InlineData(@"/tmp/..")] - [InlineData(@"/tmp/../../../../../bar")] - [InlineData(@"/tmp/../../../bar")] - [InlineData(@"/tmp/../bar/../..")] - [InlineData(@"/tmp/bar")] - [InlineData(@"/tmp/bar/..")] + [InlineData("/../../.././tmp/..")] + [InlineData("/../../../")] + [InlineData("/../../../tmp/bar/..")] + [InlineData("/../.././././bar/../../../")] + [InlineData("/../../././tmp/..")] + [InlineData("/../../tmp/../../")] + [InlineData("/../../tmp/bar/..")] + [InlineData("/../tmp/../..")] + [InlineData("/././../../../../")] + [InlineData("/././../../../")] + [InlineData("/./././bar/../../../")] + [InlineData("/")] + [InlineData("/bar")] + [InlineData("/bar/././././../../..")] + [InlineData("/bar/tmp")] + [InlineData("/tmp/..")] + [InlineData("/tmp/../../../../../bar")] + [InlineData("/tmp/../../../bar")] + [InlineData("/tmp/../bar/../..")] + [InlineData("/tmp/bar")] + [InlineData("/tmp/bar/..")] public void GePathRoot_Unix(string path) { - var expected = @"/"; + var expected = "/"; Assert.Equal(expected, _fileSystem.Path.GetPathRoot(path)); PathAssert.Equal(expected.AsSpan(), _fileSystem.Path.GetPathRoot(path.AsSpan())); } public static TheoryData TestData_GetPathRoot_Windows => new() { - { @"C:", @"C:" }, + { "C:", "C:" }, { @"C:\", @"C:\" }, { @"C:\\", @"C:\" }, { @"C:\foo1", @"C:\" }, diff --git a/src/CommonUtilities.FileSystem/test/PathExtensionsTest.GetRelativePathEx.cs b/src/CommonUtilities.FileSystem/test/PathExtensionsTest.GetRelativePathEx.cs index a76cfa6..3beb813 100644 --- a/src/CommonUtilities.FileSystem/test/PathExtensionsTest.GetRelativePathEx.cs +++ b/src/CommonUtilities.FileSystem/test/PathExtensionsTest.GetRelativePathEx.cs @@ -12,30 +12,30 @@ public class GetRelativePathExTest private readonly IFileSystem _fileSystem = new RealFileSystem(); [PlatformSpecificTheory(TestPlatformIdentifier.Windows)] - [InlineData(@"C:\", @"C:\", @".")] - [InlineData(@"C:\a", @"C:\a\", @".")] - [InlineData(@"C:\A", @"C:\a\", @".")] - [InlineData(@"C:\a\", @"C:\a", @".")] - [InlineData(@"C:\", @"C:\b", @"b")] + [InlineData(@"C:\", @"C:\", ".")] + [InlineData(@"C:\a", @"C:\a\", ".")] + [InlineData(@"C:\A", @"C:\a\", ".")] + [InlineData(@"C:\a\", @"C:\a", ".")] + [InlineData(@"C:\", @"C:\b", "b")] [InlineData(@"C:\a", @"C:\b", @"..\b")] [InlineData(@"C:\a", @"C:\b\", @"..\b\")] - [InlineData(@"C:\a\b", @"C:\a", @"..")] - [InlineData(@"C:\a\b", @"C:\a\", @"..")] - [InlineData(@"C:\a\b\", @"C:\a", @"..")] - [InlineData(@"C:\a\b\", @"C:\a\", @"..")] - [InlineData(@"C:\a\b\c", @"C:\a\b", @"..")] - [InlineData(@"C:\a\b\c", @"C:\a\b\", @"..")] + [InlineData(@"C:\a\b", @"C:\a", "..")] + [InlineData(@"C:\a\b", @"C:\a\", "..")] + [InlineData(@"C:\a\b\", @"C:\a", "..")] + [InlineData(@"C:\a\b\", @"C:\a\", "..")] + [InlineData(@"C:\a\b\c", @"C:\a\b", "..")] + [InlineData(@"C:\a\b\c", @"C:\a\b\", "..")] [InlineData(@"C:\a\b\c", @"C:\a", @"..\..")] [InlineData(@"C:\a\b\c", @"C:\a\", @"..\..")] - [InlineData(@"C:\a\b\c\", @"C:\a\b", @"..")] - [InlineData(@"C:\a\b\c\", @"C:\a\b\", @"..")] + [InlineData(@"C:\a\b\c\", @"C:\a\b", "..")] + [InlineData(@"C:\a\b\c\", @"C:\a\b\", "..")] [InlineData(@"C:\a\b\c\", @"C:\a", @"..\..")] [InlineData(@"C:\a\b\c\", @"C:\a\", @"..\..")] [InlineData(@"C:\a\", @"C:\b", @"..\b")] - [InlineData(@"C:\a", @"C:\a\b", @"b")] - [InlineData(@"C:\a", @"C:\A\b", @"b")] + [InlineData(@"C:\a", @"C:\a\b", "b")] + [InlineData(@"C:\a", @"C:\A\b", "b")] [InlineData(@"C:\a", @"C:\b\c", @"..\b\c")] - [InlineData(@"C:\a\", @"C:\a\b", @"b")] + [InlineData(@"C:\a\", @"C:\a\b", "b")] [InlineData(@"C:\", @"D:\", @"D:\")] [InlineData(@"C:\", @"D:\b", @"D:\b")] [InlineData(@"C:\", @"D:\b\", @"D:\b\")] @@ -46,7 +46,7 @@ public class GetRelativePathExTest [InlineData(@"C:\", @"\\LOCALHOST\Share\b", @"\\LOCALHOST\Share\b")] [InlineData(@"\\LOCALHOST\Share\a", @"\\LOCALHOST\Share\b", @"..\b")] // Tests which don't exist from .NET runtime - [InlineData(@"C:\a", @"C:\a\.\.", @".")] + [InlineData(@"C:\a", @"C:\a\.\.", ".")] public void GetRelativePathEx_FromAbsolute_Windows(string root, string path, string expected) { var result = _fileSystem.Path.GetRelativePathEx(root, path); @@ -60,7 +60,7 @@ public void GetRelativePathEx_FromAbsolute_Windows(string root, string path, str } [PlatformSpecificTheory(TestPlatformIdentifier.Windows)] - [InlineData(@"C:\a", @"b", @"b")] + [InlineData(@"C:\a", "b", "b")] [InlineData(@"C:\a", @"a\b", @"a\b")] [InlineData(@"C:\a", @"a\..\b", @"a\..\b")] public void GetRelativePathEx_FromRelative_Windows(string root, string path, string expected) @@ -70,11 +70,11 @@ public void GetRelativePathEx_FromRelative_Windows(string root, string path, str } [PlatformSpecificTheory(TestPlatformIdentifier.Windows)] - [InlineData(@"C:\", @"C:a", @"current\a")] - [InlineData(@"C:\a", @"C:a", @"..\current\a")] + [InlineData(@"C:\", "C:a", @"current\a")] + [InlineData(@"C:\a", "C:a", @"..\current\a")] [InlineData(@"C:\a", @"C:a\", @"..\current\a\")] [InlineData(@"C:\a\b", @"C:a\b", @"..\..\current\a\b")] - [InlineData(@"C:\a", @"X:a", @"X:\a")] + [InlineData(@"C:\a", "X:a", @"X:\a")] public void GetRelativePathEx_FromDriveRelative_Windows(string root, string path, string expected) { var fileSystem = new MockFileSystem(); @@ -92,22 +92,22 @@ public void GetRelativePathEx_FromDriveRelative_Windows(string root, string path } [PlatformSpecificTheory(TestPlatformIdentifier.Linux)] - [InlineData("/", @"/", @".")] - [InlineData("/a", @"/a/", @".")] - [InlineData("/a/", @"/a", @".")] - [InlineData("/", @"/b", @"b")] - [InlineData("/a", @"/b", @"../b")] - [InlineData("/a/", @"/b", @"../b")] - [InlineData("/a", @"/a/b", @"b")] - [InlineData("/a", @"/b/c", @"../b/c")] - [InlineData("/a/", @"/a/b", @"b")] - [InlineData("/ab", @"/a", @"../a")] - [InlineData("/a", @"/ab", @"../ab")] - [InlineData("/a", @"/A/", @"../A/")] - [InlineData("/a/", @"/A", @"../A")] - [InlineData("/a/", @"/A/b", @"../A/b")] + [InlineData("/", "/", ".")] + [InlineData("/a", "/a/", ".")] + [InlineData("/a/", "/a", ".")] + [InlineData("/", "/b", "b")] + [InlineData("/a", "/b", "../b")] + [InlineData("/a/", "/b", "../b")] + [InlineData("/a", "/a/b", "b")] + [InlineData("/a", "/b/c", "../b/c")] + [InlineData("/a/", "/a/b", "b")] + [InlineData("/ab", "/a", "../a")] + [InlineData("/a", "/ab", "../ab")] + [InlineData("/a", "/A/", "../A/")] + [InlineData("/a/", "/A", "../A")] + [InlineData("/a/", "/A/b", "../A/b")] // Tests which don't exist from .NET runtime - [InlineData(@"/a", @"/a/./.", @".")] + [InlineData("/a", "/a/./.", ".")] public void GetRelativePathEx_FromAbsolute_Linux(string root, string path, string expected) { var result = _fileSystem.Path.GetRelativePathEx(root, path); diff --git a/src/CommonUtilities.FileSystem/test/PathExtensionsTest.HasLeadingPathSeparator.cs b/src/CommonUtilities.FileSystem/test/PathExtensionsTest.HasLeadingPathSeparator.cs index 27fd8af..e33c622 100644 --- a/src/CommonUtilities.FileSystem/test/PathExtensionsTest.HasLeadingPathSeparator.cs +++ b/src/CommonUtilities.FileSystem/test/PathExtensionsTest.HasLeadingPathSeparator.cs @@ -3,6 +3,7 @@ using AnakinRaW.CommonUtilities.Testing; using Testably.Abstractions; using Xunit; +// ReSharper disable InconsistentNaming namespace AnakinRaW.CommonUtilities.FileSystem.Test; @@ -25,19 +26,19 @@ public void HasLeadingPathSeparator(string? input) public static TheoryData TestData_StartsWithDirectorySeparator_Windows => new() { { @"\", true }, - { @"/", true }, + { "/", true }, { @"C:\folder\", false }, - { @"C:/folder/", false }, + { "C:/folder/", false }, { @"C:\", false }, - { @"C:/", false }, + { "C:/", false }, { @"\\", true }, - { @"//", true }, + { "//", true }, { @"\\server\share\", true }, { @"\\?\UNC\a\", true }, { @"\\?\C:\", true }, { @"\\?\UNC\", true }, { @"\folder", true }, - { @"folder", false }, + { "folder", false }, }; [PlatformSpecificTheory(TestPlatformIdentifier.Windows)] @@ -51,11 +52,11 @@ public void HasLeadingPathSeparator_Windows(string input, bool expected) public static TheoryData TestData_StartsWithDirectorySeparator_Linux => new() { - { @"/", true }, - { @"/folder/", true }, - { @"//", true }, - { @"folder", false }, - { @"/folder", true } + { "/", true }, + { "/folder/", true }, + { "//", true }, + { "folder", false }, + { "/folder", true } }; [PlatformSpecificTheory(TestPlatformIdentifier.Linux)] diff --git a/src/CommonUtilities.FileSystem/test/PathExtensionsTest.HasTrailingPathSeparator.cs b/src/CommonUtilities.FileSystem/test/PathExtensionsTest.HasTrailingPathSeparator.cs index b9e555e..3422769 100644 --- a/src/CommonUtilities.FileSystem/test/PathExtensionsTest.HasTrailingPathSeparator.cs +++ b/src/CommonUtilities.FileSystem/test/PathExtensionsTest.HasTrailingPathSeparator.cs @@ -6,6 +6,7 @@ #if NET using System.IO; #endif +// ReSharper disable InconsistentNaming namespace AnakinRaW.CommonUtilities.FileSystem.Test; @@ -31,19 +32,19 @@ public void HasTrailingPathSeparator(string? input) public static TheoryData TestData_EndsInDirectorySeparator_Windows => new() { { @"\", true }, - { @"/", true }, + { "/", true }, { @"C:\folder\", true }, - { @"C:/folder/", true }, + { "C:/folder/", true }, { @"C:\", true }, - { @"C:/", true }, + { "C:/", true }, { @"\\", true }, - { @"//", true }, + { "//", true }, { @"\\server\share\", true }, { @"\\?\UNC\a\", true }, { @"\\?\C:\", true }, { @"\\?\UNC\", true }, { @"folder\", true }, - { @"folder", false }, + { "folder", false }, }; [PlatformSpecificTheory(TestPlatformIdentifier.Windows)] @@ -59,11 +60,11 @@ public void HasTrailingPathSeparator_Windows(string input, bool expected) public static TheoryData TestData_EndsInDirectorySeparator_Linux => new() { - { @"/", true }, - { @"/folder/", true }, - { @"//", true }, - { @"folder", false }, - { @"folder/", true } + { "/", true }, + { "/folder/", true }, + { "//", true }, + { "folder", false }, + { "folder/", true } }; [PlatformSpecificTheory(TestPlatformIdentifier.Linux)] diff --git a/src/CommonUtilities.FileSystem/test/PathExtensionsTest.IsPathFullyQualified.cs b/src/CommonUtilities.FileSystem/test/PathExtensionsTest.IsPathFullyQualified.cs index 663c5ec..71886a3 100644 --- a/src/CommonUtilities.FileSystem/test/PathExtensionsTest.IsPathFullyQualified.cs +++ b/src/CommonUtilities.FileSystem/test/PathExtensionsTest.IsPathFullyQualified.cs @@ -46,10 +46,10 @@ public void IsPathFullyQualified_Windows_Invalid(string path) [InlineData(@"C:\foo1")] [InlineData(@"C:\\")] [InlineData(@"C:\\foo2")] - [InlineData(@"C:/")] - [InlineData(@"C:/foo1")] - [InlineData(@"C://")] - [InlineData(@"C://foo2")] + [InlineData("C:/")] + [InlineData("C:/foo1")] + [InlineData("C://")] + [InlineData("C://foo2")] public void IsPathFullyQualified_Windows_Valid(string path) { Assert.True(_fileSystem.Path.IsPathFullyQualified(path)); @@ -63,9 +63,9 @@ public void IsPathFullyQualified_Windows_Valid(string path) [InlineData("./foo.txt")] [InlineData("..")] [InlineData("../foo.txt")] - [InlineData(@"C:")] - [InlineData(@"C:/")] - [InlineData(@"C://")] + [InlineData("C:")] + [InlineData("C:/")] + [InlineData("C://")] public void IsPathFullyQualified_Unix_Invalid(string path) { Assert.False(_fileSystem.Path.IsPathFullyQualified(path)); diff --git a/src/CommonUtilities.FileSystem/test/PathExtensionsTest.Join.cs b/src/CommonUtilities.FileSystem/test/PathExtensionsTest.Join.cs index 6b3f819..9cafe96 100644 --- a/src/CommonUtilities.FileSystem/test/PathExtensionsTest.Join.cs +++ b/src/CommonUtilities.FileSystem/test/PathExtensionsTest.Join.cs @@ -3,6 +3,7 @@ using System.IO.Abstractions; using Testably.Abstractions; using Xunit; +// ReSharper disable InconsistentNaming namespace AnakinRaW.CommonUtilities.FileSystem.Test; diff --git a/src/CommonUtilities.FileSystem/test/Utilities/ValueStringBuilderTest.cs b/src/CommonUtilities.FileSystem/test/Utilities/ValueStringBuilderTest.cs index fd1987a..b5b4cf7 100644 --- a/src/CommonUtilities.FileSystem/test/Utilities/ValueStringBuilderTest.cs +++ b/src/CommonUtilities.FileSystem/test/Utilities/ValueStringBuilderTest.cs @@ -46,7 +46,7 @@ public void Append_Char_MatchesStringBuilder() { var sb = new StringBuilder(); var vsb = new ValueStringBuilder(); - for (int i = 1; i <= 100; i++) + for (var i = 1; i <= 100; i++) { sb.Append((char)i); vsb.Append((char)i); @@ -61,9 +61,9 @@ public void Append_String_MatchesStringBuilder() { var sb = new StringBuilder(); var vsb = new ValueStringBuilder(); - for (int i = 1; i <= 100; i++) + for (var i = 1; i <= 100; i++) { - string s = i.ToString(); + var s = i.ToString(); sb.Append(s); vsb.Append(s); } @@ -81,7 +81,7 @@ public void Append_String_Large_MatchesStringBuilder(int initialLength, int stri var sb = new StringBuilder(initialLength); var vsb = new ValueStringBuilder(new char[initialLength]); - string s = new string('a', stringLength); + var s = new string('a', stringLength); sb.Append(s); vsb.Append(s); @@ -94,7 +94,7 @@ public void Append_CharInt_MatchesStringBuilder() { var sb = new StringBuilder(); var vsb = new ValueStringBuilder(); - for (int i = 1; i <= 100; i++) + for (var i = 1; i <= 100; i++) { sb.Append((char)i, i); vsb.Append((char)i, i); @@ -109,9 +109,9 @@ public unsafe void Append_PtrInt_MatchesStringBuilder() { var sb = new StringBuilder(); var vsb = new ValueStringBuilder(); - for (int i = 1; i <= 100; i++) + for (var i = 1; i <= 100; i++) { - string s = i.ToString(); + var s = i.ToString(); fixed (char* p = s) { sb.Append(p, s.Length); @@ -129,13 +129,13 @@ public void AppendSpan_DataAppendedCorrectly() var sb = new StringBuilder(); var vsb = new ValueStringBuilder(); - for (int i = 1; i <= 1000; i++) + for (var i = 1; i <= 1000; i++) { - string s = i.ToString(); + var s = i.ToString(); sb.Append(s); - Span span = vsb.AppendSpan(s.Length); + var span = vsb.AppendSpan(s.Length); Assert.Equal(sb.Length, vsb.Length); s.AsSpan().CopyTo(span); @@ -152,9 +152,9 @@ public void Insert_IntCharInt_MatchesStringBuilder() var vsb = new ValueStringBuilder(); var rand = new Random(42); - for (int i = 1; i <= 100; i++) + for (var i = 1; i <= 100; i++) { - int index = rand.Next(sb.Length); + var index = rand.Next(sb.Length); sb.Insert(index, new string((char)i, 1), i); vsb.Insert(index, (char)i, i); } @@ -169,9 +169,9 @@ public void AsSpan_ReturnsCorrectValue_DoesntClearBuilder() var sb = new StringBuilder(); var vsb = new ValueStringBuilder(); - for (int i = 1; i <= 100; i++) + for (var i = 1; i <= 100; i++) { - string s = i.ToString(); + var s = i.ToString(); sb.Append(s); vsb.Append(s); } @@ -187,23 +187,23 @@ public void AsSpan_ReturnsCorrectValue_DoesntClearBuilder() [Fact] public void ToString_ClearsBuilder_ThenReusable() { - const string Text1 = "test"; + const string text1 = "test"; var vsb = new ValueStringBuilder(); - vsb.Append(Text1); - Assert.Equal(Text1.Length, vsb.Length); + vsb.Append(text1); + Assert.Equal(text1.Length, vsb.Length); - string s = vsb.ToString(); - Assert.Equal(Text1, s); + var s = vsb.ToString(); + Assert.Equal(text1, s); Assert.Equal(0, vsb.Length); Assert.Equal(string.Empty, vsb.ToString()); Assert.True(vsb.TryCopyTo(Span.Empty, out _)); - const string Text2 = "another test"; - vsb.Append(Text2); - Assert.Equal(Text2.Length, vsb.Length); - Assert.Equal(Text2, vsb.ToString()); + const string text2 = "another test"; + vsb.Append(text2); + Assert.Equal(text2.Length, vsb.Length); + Assert.Equal(text2, vsb.ToString()); } [Fact] @@ -211,12 +211,12 @@ public void TryCopyTo_FailsWhenDestinationIsTooSmall_SucceedsWhenItsLargeEnough( { var vsb = new ValueStringBuilder(); - const string Text = "expected text"; - vsb.Append(Text); - Assert.Equal(Text.Length, vsb.Length); + const string text = "expected text"; + vsb.Append(text); + Assert.Equal(text.Length, vsb.Length); - Span dst = new char[Text.Length - 1]; - Assert.False(vsb.TryCopyTo(dst, out int charsWritten)); + Span dst = new char[text.Length - 1]; + Assert.False(vsb.TryCopyTo(dst, out var charsWritten)); Assert.Equal(0, charsWritten); Assert.Equal(0, vsb.Length); } @@ -224,35 +224,35 @@ public void TryCopyTo_FailsWhenDestinationIsTooSmall_SucceedsWhenItsLargeEnough( [Fact] public void TryCopyTo_ClearsBuilder_ThenReusable() { - const string Text1 = "test"; + const string text1 = "test"; var vsb = new ValueStringBuilder(); - vsb.Append(Text1); - Assert.Equal(Text1.Length, vsb.Length); + vsb.Append(text1); + Assert.Equal(text1.Length, vsb.Length); - Span dst = new char[Text1.Length]; - Assert.True(vsb.TryCopyTo(dst, out int charsWritten)); - Assert.Equal(Text1.Length, charsWritten); - Assert.Equal(Text1, dst.ToString()); + Span dst = new char[text1.Length]; + Assert.True(vsb.TryCopyTo(dst, out var charsWritten)); + Assert.Equal(text1.Length, charsWritten); + Assert.Equal(text1, dst.ToString()); Assert.Equal(0, vsb.Length); Assert.Equal(string.Empty, vsb.ToString()); Assert.True(vsb.TryCopyTo(Span.Empty, out _)); - const string Text2 = "another test"; - vsb.Append(Text2); - Assert.Equal(Text2.Length, vsb.Length); - Assert.Equal(Text2, vsb.ToString()); + const string text2 = "another test"; + vsb.Append(text2); + Assert.Equal(text2.Length, vsb.Length); + Assert.Equal(text2, vsb.ToString()); } [Fact] public void Dispose_ClearsBuilder_ThenReusable() { - const string Text1 = "test"; + const string text1 = "test"; var vsb = new ValueStringBuilder(); - vsb.Append(Text1); - Assert.Equal(Text1.Length, vsb.Length); + vsb.Append(text1); + Assert.Equal(text1.Length, vsb.Length); vsb.Dispose(); @@ -260,19 +260,19 @@ public void Dispose_ClearsBuilder_ThenReusable() Assert.Equal(string.Empty, vsb.ToString()); Assert.True(vsb.TryCopyTo(Span.Empty, out _)); - const string Text2 = "another test"; - vsb.Append(Text2); - Assert.Equal(Text2.Length, vsb.Length); - Assert.Equal(Text2, vsb.ToString()); + const string text2 = "another test"; + vsb.Append(text2); + Assert.Equal(text2.Length, vsb.Length); + Assert.Equal(text2, vsb.ToString()); } [Fact] - public unsafe void Indexer() + public void Indexer() { - const string Text1 = "foobar"; + const string text1 = "foobar"; var vsb = new ValueStringBuilder(); - vsb.Append(Text1); + vsb.Append(text1); Assert.Equal('b', vsb[3]); vsb[3] = 'c'; diff --git a/src/CommonUtilities.Registry/src/IRegistryKey.cs b/src/CommonUtilities.Registry/src/IRegistryKey.cs index d782643..6407051 100644 --- a/src/CommonUtilities.Registry/src/IRegistryKey.cs +++ b/src/CommonUtilities.Registry/src/IRegistryKey.cs @@ -4,8 +4,7 @@ namespace AnakinRaW.CommonUtilities.Registry; /// -/// High-Level abstraction layer for the a Registry Key implementation. -/// Read and write operations are supported. +/// Represents a key node in of an . /// public interface IRegistryKey : IDisposable { diff --git a/src/CommonUtilities.Registry/src/InMemoryRegistryKeyData.cs b/src/CommonUtilities.Registry/src/InMemoryRegistryKeyData.cs index f3305d6..cf9cc25 100644 --- a/src/CommonUtilities.Registry/src/InMemoryRegistryKeyData.cs +++ b/src/CommonUtilities.Registry/src/InMemoryRegistryKeyData.cs @@ -242,7 +242,7 @@ public override void Dispose() var subKeyNames = subPath.Split(Separator); foreach (var subKeyName in subKeyNames) { - if (currentKey._subKeys.TryGetValue(subKeyName, out var key) == false) + if (!currentKey._subKeys.TryGetValue(subKeyName, out var key)) return null; currentKey = key; } diff --git a/src/CommonUtilities.Registry/test/Extensions/InMemoryKeyExtensionsTest.cs b/src/CommonUtilities.Registry/test/Extensions/InMemoryKeyExtensionsTest.cs index 88a576d..ecef9a3 100644 --- a/src/CommonUtilities.Registry/test/Extensions/InMemoryKeyExtensionsTest.cs +++ b/src/CommonUtilities.Registry/test/Extensions/InMemoryKeyExtensionsTest.cs @@ -1,5 +1,6 @@ namespace AnakinRaW.CommonUtilities.Registry.Test.Extensions; +// ReSharper disable once UnusedMember.Global public class InMemoryKeyExtensionsTest : RegistryKeyExtensionsTestBase { protected override RegKeyTest CreateTestKey() diff --git a/src/CommonUtilities.Registry/test/Extensions/RegistryKeyExtensionsTestBase.cs b/src/CommonUtilities.Registry/test/Extensions/RegistryKeyExtensionsTestBase.cs index b74e355..fa8b58d 100644 --- a/src/CommonUtilities.Registry/test/Extensions/RegistryKeyExtensionsTestBase.cs +++ b/src/CommonUtilities.Registry/test/Extensions/RegistryKeyExtensionsTestBase.cs @@ -382,7 +382,7 @@ public async Task AwaitRegKeyChange_CallingThreadDestroyed() thread.Join(); // Verify that the watching task is still watching. - var completedTask = await Task.WhenAny(watchingTask!, Task.Delay(AsyncDelay)); + var completedTask = await Task.WhenAny(watchingTask, Task.Delay(AsyncDelay)); Assert.NotSame(watchingTask, completedTask); test.CreateSubKey().Dispose(); diff --git a/src/CommonUtilities.Registry/test/Extensions/WindowsKeyExtensionsTest.cs b/src/CommonUtilities.Registry/test/Extensions/WindowsKeyExtensionsTest.cs index 6d8c056..ad03bf7 100644 --- a/src/CommonUtilities.Registry/test/Extensions/WindowsKeyExtensionsTest.cs +++ b/src/CommonUtilities.Registry/test/Extensions/WindowsKeyExtensionsTest.cs @@ -4,6 +4,7 @@ namespace AnakinRaW.CommonUtilities.Registry.Test.Extensions; +// ReSharper disable once UnusedMember.Global public class WindowsKeyExtensionsTest : RegistryKeyExtensionsTestBase { protected override RegKeyTest CreateTestKey() diff --git a/src/CommonUtilities.Registry/test/RegistryKey_GetValueOrDefault.cs b/src/CommonUtilities.Registry/test/RegistryKey_GetValueOrDefault.cs index c7c7db9..6f44e79 100644 --- a/src/CommonUtilities.Registry/test/RegistryKey_GetValueOrDefault.cs +++ b/src/CommonUtilities.Registry/test/RegistryKey_GetValueOrDefault.cs @@ -57,7 +57,7 @@ public void GetValueOrDefault_GetByteArrayTest() byte[] expected = [1, 2, 3]; TestRegistryKey.SetValue(valueName, expected); - Assert.Equal(expected, TestRegistryKey.GetValueOrDefault(valueName, [0, 0], out var exists)); + Assert.Equal(expected, TestRegistryKey.GetValueOrDefault(valueName, "\0\0"u8.ToArray(), out var exists)); Assert.True(exists); TestRegistryKey.DeleteValue(valueName); } diff --git a/src/CommonUtilities.Registry/test/RegistryKey_GetValueOrSetDefault.cs b/src/CommonUtilities.Registry/test/RegistryKey_GetValueOrSetDefault.cs index 1d8ea27..104d9e3 100644 --- a/src/CommonUtilities.Registry/test/RegistryKey_GetValueOrSetDefault.cs +++ b/src/CommonUtilities.Registry/test/RegistryKey_GetValueOrSetDefault.cs @@ -84,7 +84,7 @@ public void GetValueOrSetDefault_GetByteArrayTest() byte[] expected = [1, 2, 3]; TestRegistryKey.SetValue(valueName, expected); - Assert.Equal(expected, TestRegistryKey.GetValueOrSetDefault(valueName, [0, 0], out var defaultUsed)); + Assert.Equal(expected, TestRegistryKey.GetValueOrSetDefault(valueName, "\0\0"u8.ToArray(), out var defaultUsed)); Assert.False(defaultUsed); TestRegistryKey.DeleteValue(valueName); } diff --git a/src/CommonUtilities.Registry/test/RegistryTestsBase.cs b/src/CommonUtilities.Registry/test/RegistryTestsBase.cs index 8ced84a..cc7af33 100644 --- a/src/CommonUtilities.Registry/test/RegistryTestsBase.cs +++ b/src/CommonUtilities.Registry/test/RegistryTestsBase.cs @@ -50,14 +50,14 @@ public void Dispose() public static readonly object[][] TestRegistrySubKeyNames = [ - [@"Foo", @"Foo"], + ["Foo", "Foo"], [@"Foo\Bar", @"Foo\Bar"], // Multiple/trailing slashes should be removed. - [@"Foo", @"Foo\"], - [@"Foo", @"Foo\\"], - [@"Foo", @"Foo\\\"], - [@"Foo", @"Foo\\\\"], + ["Foo", @"Foo\"], + ["Foo", @"Foo\\"], + ["Foo", @"Foo\\\"], + ["Foo", @"Foo\\\\"], [@"Foo\Bar", @"Foo\\Bar"], [@"Foo\Bar", @"Foo\\\Bar"], [@"Foo\Bar", @"Foo\\\\Bar"], @@ -74,16 +74,16 @@ public void Dispose() // If there are multiple slashes, any extra slash chars will be // replaced with a marker char ('\uffff'), and then all '\uffff' // chars will be removed, including any pre-existing '\uffff' chars. - InsertMarkerChar(@"Foo", @"{0}Foo\\"), - InsertMarkerChar(@"Foo", @"Foo{0}\\"), - InsertMarkerChar(@"Foo", @"Foo\\{0}"), - InsertMarkerChar(@"Foo", @"Fo{0}o\\"), - InsertMarkerChar(@"Foo", @"{0}Fo{0}o{0}\\{0}"), - InsertMarkerChar(@"Foo", @"{0}Foo\\\"), - InsertMarkerChar(@"Foo", @"Foo{0}\\\"), - InsertMarkerChar(@"Foo", @"Foo\\\{0}"), - InsertMarkerChar(@"Foo", @"Fo{0}o\\\"), - InsertMarkerChar(@"Foo", @"{0}Fo{0}o{0}\\\{0}"), + InsertMarkerChar("Foo", @"{0}Foo\\"), + InsertMarkerChar("Foo", @"Foo{0}\\"), + InsertMarkerChar("Foo", @"Foo\\{0}"), + InsertMarkerChar("Foo", @"Fo{0}o\\"), + InsertMarkerChar("Foo", @"{0}Fo{0}o{0}\\{0}"), + InsertMarkerChar("Foo", @"{0}Foo\\\"), + InsertMarkerChar("Foo", @"Foo{0}\\\"), + InsertMarkerChar("Foo", @"Foo\\\{0}"), + InsertMarkerChar("Foo", @"Fo{0}o\\\"), + InsertMarkerChar("Foo", @"{0}Fo{0}o{0}\\\{0}"), InsertMarkerChar(@"Foo\Bar", @"{0}Foo\\Bar"), InsertMarkerChar(@"Foo\Bar", @"Foo{0}\\Bar"), InsertMarkerChar(@"Foo\Bar", @"Foo\\{0}Bar"), @@ -109,10 +109,10 @@ public void Dispose() InsertMarkerChar(@"Foo\Bar", @"{0}Fo{0}o{0}\{0}B{0}ar{0}\\{0}"), // If there aren't multiple slashes, any '\uffff' chars should remain. - InsertMarkerChar(@"{0}Foo"), - InsertMarkerChar(@"Foo{0}"), - InsertMarkerChar(@"Fo{0}o"), - InsertMarkerChar(@"{0}Fo{0}o{0}"), + InsertMarkerChar("{0}Foo"), + InsertMarkerChar("Foo{0}"), + InsertMarkerChar("Fo{0}o"), + InsertMarkerChar("{0}Fo{0}o{0}"), InsertMarkerChar(@"{0}Foo\"), InsertMarkerChar(@"Foo{0}\"), InsertMarkerChar(@"Fo{0}o\"), @@ -155,18 +155,18 @@ protected void Verify_CreateSubKey_KeyExists_OpensKeyWithFixedUpName(string expe using var key = createSubKey(); Assert.NotNull(key); - Assert.Single(TestRegistryKey.GetSubKeyNames()!); + Assert.Single(TestRegistryKey.GetSubKeyNames()); Assert.Equal(TestRegistryKey.Name + @"\" + expected, key.Name); } protected void Verify_CreateSubKey_KeyDoesNotExist_CreatesKeyWithFixedUpName(string expected, Func createSubKey) { Assert.Null(TestRegistryKey.OpenSubKey(expected)); - Assert.Empty(TestRegistryKey.GetSubKeyNames()!); + Assert.Empty(TestRegistryKey.GetSubKeyNames()); using var key = createSubKey(); Assert.NotNull(key); - Assert.Single(TestRegistryKey.GetSubKeyNames()!); + Assert.Single(TestRegistryKey.GetSubKeyNames()); Assert.Equal(TestRegistryKey.Name + @"\" + expected, key.Name); } @@ -181,7 +181,7 @@ protected void Verify_DeleteSubKey_KeyExists_KeyDeleted(string expected, Action protected void Verify_DeleteSubKey_KeyDoesNotExists_DoesNotThrow(string expected, Action deleteSubKey) { Assert.Null(TestRegistryKey.OpenSubKey(expected)); - Assert.Empty(TestRegistryKey.GetSubKeyNames()!); + Assert.Empty(TestRegistryKey.GetSubKeyNames()); deleteSubKey(); } @@ -192,14 +192,14 @@ protected void Verify_OpenSubKey_KeyExists_OpensWithFixedUpName(string expected, using var key = openSubKey(); Assert.NotNull(key); - Assert.Single(TestRegistryKey.GetSubKeyNames()!); + Assert.Single(TestRegistryKey.GetSubKeyNames()); Assert.Equal(TestRegistryKey.Name + @"\" + expected, key.Name); } protected void Verify_OpenSubKey_KeyDoesNotExist_ReturnsNull(string expected, Func openSubKey) { Assert.Null(TestRegistryKey.OpenSubKey(expected)); - Assert.Empty(TestRegistryKey.GetSubKeyNames()!); + Assert.Empty(TestRegistryKey.GetSubKeyNames()); Assert.Null(openSubKey()); } diff --git a/src/CommonUtilities.SimplePipeline/src/Runners/StepRunnerBase.cs b/src/CommonUtilities.SimplePipeline/src/Runners/StepRunnerBase.cs index b29f634..d692c9e 100644 --- a/src/CommonUtilities.SimplePipeline/src/Runners/StepRunnerBase.cs +++ b/src/CommonUtilities.SimplePipeline/src/Runners/StepRunnerBase.cs @@ -20,7 +20,7 @@ public abstract class StepRunnerBase : IStepRunner /// /// Gets a modifiable bag of all executed steps. /// - protected readonly ConcurrentBag ExecutedStepsBag = new(); + protected readonly ConcurrentBag ExecutedStepsBag = []; /// /// Gets the logger instance of this stepRunner. diff --git a/src/CommonUtilities.SimplePipeline/src/Steps/RunPipelineStep.cs b/src/CommonUtilities.SimplePipeline/src/Steps/RunPipelineStep.cs index b977ef1..acaac39 100644 --- a/src/CommonUtilities.SimplePipeline/src/Steps/RunPipelineStep.cs +++ b/src/CommonUtilities.SimplePipeline/src/Steps/RunPipelineStep.cs @@ -20,6 +20,7 @@ protected override void RunSynchronized(CancellationToken token) Logger?.LogTrace($"Running {_pipeline}..."); try { + // ReSharper disable once MethodSupportsCancellation _pipeline.RunAsync(token).Wait(); Logger?.LogTrace($"Finished {_pipeline}"); } diff --git a/src/CommonUtilities.SimplePipeline/test/Pipelines/ParallelPipelineTests.cs b/src/CommonUtilities.SimplePipeline/test/Pipelines/ParallelPipelineTests.cs index c8f73bd..744dd01 100644 --- a/src/CommonUtilities.SimplePipeline/test/Pipelines/ParallelPipelineTests.cs +++ b/src/CommonUtilities.SimplePipeline/test/Pipelines/ParallelPipelineTests.cs @@ -5,6 +5,7 @@ namespace AnakinRaW.CommonUtilities.SimplePipeline.Test.Pipelines; +// ReSharper disable once UnusedMember.Global public class ParallelPipelineTests : StepRunnerPipelineTest { protected override Pipeline CreatePipeline(IList steps) diff --git a/src/CommonUtilities.SimplePipeline/test/Pipelines/ParallelProducerConsumerPipelineTest.cs b/src/CommonUtilities.SimplePipeline/test/Pipelines/ParallelProducerConsumerPipelineTest.cs index 3691e8e..e899338 100644 --- a/src/CommonUtilities.SimplePipeline/test/Pipelines/ParallelProducerConsumerPipelineTest.cs +++ b/src/CommonUtilities.SimplePipeline/test/Pipelines/ParallelProducerConsumerPipelineTest.cs @@ -77,7 +77,9 @@ public async Task RunAsync_DelayedAdd_PrepareFails(bool failFast) return; +#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously async IAsyncEnumerable ValueFunction() +#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously { yield return s1; yield return s2; @@ -97,7 +99,9 @@ public async Task PrepareAsync_PrepareFails() return; +#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously async IAsyncEnumerable ValueFunction() +#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously { yield return s1; yield return s2; diff --git a/src/CommonUtilities.SimplePipeline/test/Progress/AggregatedProgressReporterTests.cs b/src/CommonUtilities.SimplePipeline/test/Progress/AggregatedProgressReporterTests.cs index 68b030a..099142d 100644 --- a/src/CommonUtilities.SimplePipeline/test/Progress/AggregatedProgressReporterTests.cs +++ b/src/CommonUtilities.SimplePipeline/test/Progress/AggregatedProgressReporterTests.cs @@ -3,9 +3,11 @@ using AnakinRaW.CommonUtilities.SimplePipeline.Progress; using AnakinRaW.CommonUtilities.Testing; using Xunit; +// ReSharper disable InconsistentNaming namespace AnakinRaW.CommonUtilities.SimplePipeline.Test.Progress; +// ReSharper disable once UnusedMember.Global public class AggregatedProgressReporterTest_Struct : AggregatedProgressReporterTestBase { protected override TestInfoStruct CreateCustomProgressInfo(TestProgressStep step, double progress) @@ -17,6 +19,7 @@ protected override TestInfoStruct CreateCustomProgressInfo(TestProgressStep { protected override TestInfoClass CreateCustomProgressInfo(TestProgressStep step, double progress) diff --git a/src/CommonUtilities.SimplePipeline/test/Steps/WaitStepTest.cs b/src/CommonUtilities.SimplePipeline/test/Steps/WaitStepTest.cs index 2dfe181..019f5b6 100644 --- a/src/CommonUtilities.SimplePipeline/test/Steps/WaitStepTest.cs +++ b/src/CommonUtilities.SimplePipeline/test/Steps/WaitStepTest.cs @@ -29,7 +29,7 @@ public void Wait() var step = new WaitStep(runner, ServiceProvider); - var runnerTask = runner.RunAsync(CancellationToken.None); + _ = runner.RunAsync(CancellationToken.None); step.Run(CancellationToken.None); // We cannot assert on the runnerTask task, diff --git a/src/CommonUtilities.SimplePipeline/test/TestStep.cs b/src/CommonUtilities.SimplePipeline/test/TestStep.cs index 6f3ac5f..bfef8bb 100644 --- a/src/CommonUtilities.SimplePipeline/test/TestStep.cs +++ b/src/CommonUtilities.SimplePipeline/test/TestStep.cs @@ -88,7 +88,7 @@ public override int GetHashCode() } } -public class TestSyncStep(Action action, IServiceProvider serviceProvider) +public class TestSyncStep(Action? action, IServiceProvider serviceProvider) : SynchronizedStep(serviceProvider) { public ProgressType Type => new() { Id = "test", DisplayName = "Test" }; diff --git a/src/CommonUtilities.TestingUtilities/Collections/CollectionsTestSuite.cs b/src/CommonUtilities.TestingUtilities/Collections/CollectionsTestSuite.cs index 02cda4e..1fc1d51 100644 --- a/src/CommonUtilities.TestingUtilities/Collections/CollectionsTestSuite.cs +++ b/src/CommonUtilities.TestingUtilities/Collections/CollectionsTestSuite.cs @@ -96,8 +96,8 @@ protected IEnumerable CreateEnumerable(IEnumerable? enumerableToMatchTo, i } /// - /// Helper function to create an List fulfilling the given specific parameters. The function will - /// create an List and then add values + /// Helper function to create a List fulfilling the given specific parameters. The function will + /// create a List and then add values /// to it until it is full. It will begin by adding the desired number of matching, /// followed by random (deterministic) elements until the desired count is reached. /// diff --git a/src/CommonUtilities.TestingUtilities/Collections/ICollectionTestSuite.cs b/src/CommonUtilities.TestingUtilities/Collections/ICollectionTestSuite.cs index 431ab5b..cf077a4 100644 --- a/src/CommonUtilities.TestingUtilities/Collections/ICollectionTestSuite.cs +++ b/src/CommonUtilities.TestingUtilities/Collections/ICollectionTestSuite.cs @@ -14,7 +14,7 @@ public abstract class ICollectionTestSuite : IEnumerableTestSuite { protected virtual Type ICollection_Generic_CopyTo_IndexLargerThanArrayCount_ThrowType => typeof(ArgumentException); - protected virtual IEnumerable InvalidValues => Array.Empty(); + protected virtual IEnumerable InvalidValues => []; protected virtual bool DefaultValueAllowed => true; diff --git a/src/CommonUtilities.TestingUtilities/Collections/INonModifyingEnumerableTestSuite.cs b/src/CommonUtilities.TestingUtilities/Collections/INonModifyingEnumerableTestSuite.cs index 0bf2a39..a273bd5 100644 --- a/src/CommonUtilities.TestingUtilities/Collections/INonModifyingEnumerableTestSuite.cs +++ b/src/CommonUtilities.TestingUtilities/Collections/INonModifyingEnumerableTestSuite.cs @@ -368,8 +368,10 @@ public void IEnumerable_Generic_Enumerator_Current_ReturnsSameObjectsOnDifferent // Ensures that the elements returned from enumeration are exactly the same collection of // elements returned from a previous enumeration var enumerable = GenericIEnumerableFactory(count); +#pragma warning disable CS8714 var firstValues = new Dictionary(count); var secondValues = new Dictionary(count); +#pragma warning restore CS8714 foreach (var item in enumerable) firstValues[item] = firstValues.ContainsKey(item) ? firstValues[item]++ : 1; foreach (var item in enumerable) diff --git a/src/CommonUtilities/src/Collections/FrugalList.cs b/src/CommonUtilities/src/Collections/FrugalList.cs index 048757d..b4e489c 100644 --- a/src/CommonUtilities/src/Collections/FrugalList.cs +++ b/src/CommonUtilities/src/Collections/FrugalList.cs @@ -44,11 +44,11 @@ namespace AnakinRaW.CommonUtilities.Collections; /// /// Usage advise: /// -/// a) To ensure that all changes get reflected to other variables (including the first item) +/// a. To ensure that all changes get reflected to other variables (including the first item) /// either box this structure (e.g, to [this allocates memory though]) or pass this structure as by-. /// /// -/// b) If a copy shall not reflect any changes from its source use +/// b. If a copy shall not reflect any changes from its source use /// which creates a full shallow-copy of all items in this list. /// /// @@ -292,9 +292,9 @@ public void RemoveAt(int index) // Natively implementing frequent Linq functions avoids boxing. Add more if necessary. /// - /// Creates a from an this instance. + /// Creates a from the . /// - /// A that contains elements from the this list. + /// A that contains elements from the . public readonly List ToList() { if (_tailList is null) @@ -319,7 +319,7 @@ public readonly T[] ToArray() } /// - /// Returns the first element of of the . + /// Returns the first element of the . /// /// The first element of the specified /// The is empty. diff --git a/src/CommonUtilities/src/Collections/ReadOnlyFrugalList.cs b/src/CommonUtilities/src/Collections/ReadOnlyFrugalList.cs index 5d2fa81..7b5119a 100644 --- a/src/CommonUtilities/src/Collections/ReadOnlyFrugalList.cs +++ b/src/CommonUtilities/src/Collections/ReadOnlyFrugalList.cs @@ -65,9 +65,9 @@ public void CopyTo(T[] array, int index) // Natively implementing frequent Linq functions avoids boxing. Add more if necessary. /// - /// Creates a from an this instance. + /// Creates a from the . /// - /// A that contains elements from this list. + /// A that contains elements from the . public List ToList() { return _list.ToList(); @@ -146,11 +146,16 @@ public int IndexOf(T item) /// Returns an enumerator that iterates through the /// /// A for the . - public FrugalList.FrugalEnumerator GetEnumerator() => _list.GetEnumerator(); + public FrugalList.FrugalEnumerator GetEnumerator() + { + // ReSharper disable once PossiblyImpureMethodCallOnReadonlyVariable + return _list.GetEnumerator(); + } /// IEnumerator IEnumerable.GetEnumerator() { + // ReSharper disable once PossiblyImpureMethodCallOnReadonlyVariable return _list.GetEnumerator(); } diff --git a/src/CommonUtilities/src/Hashing/HashTypeKey.cs b/src/CommonUtilities/src/Hashing/HashTypeKey.cs index adae1fc..946da33 100644 --- a/src/CommonUtilities/src/Hashing/HashTypeKey.cs +++ b/src/CommonUtilities/src/Hashing/HashTypeKey.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +// ReSharper disable InconsistentNaming namespace AnakinRaW.CommonUtilities.Hashing; diff --git a/src/CommonUtilities/src/Hashing/Providers/MD5HashProvider.cs b/src/CommonUtilities/src/Hashing/Providers/MD5HashProvider.cs index 0e26119..d64bd69 100644 --- a/src/CommonUtilities/src/Hashing/Providers/MD5HashProvider.cs +++ b/src/CommonUtilities/src/Hashing/Providers/MD5HashProvider.cs @@ -6,6 +6,7 @@ namespace AnakinRaW.CommonUtilities.Hashing.Providers; +// ReSharper disable once InconsistentNaming internal class MD5HashProvider : HashAlgorithmProviderBase { public override HashTypeKey SupportedHashType => HashTypeKey.MD5; diff --git a/src/CommonUtilities/src/Hashing/Providers/SHA1HashProvider.cs b/src/CommonUtilities/src/Hashing/Providers/SHA1HashProvider.cs index 41c8997..fe0bc4a 100644 --- a/src/CommonUtilities/src/Hashing/Providers/SHA1HashProvider.cs +++ b/src/CommonUtilities/src/Hashing/Providers/SHA1HashProvider.cs @@ -6,6 +6,7 @@ namespace AnakinRaW.CommonUtilities.Hashing.Providers; +// ReSharper disable once InconsistentNaming internal class SHA1HashProvider : HashAlgorithmProviderBase { public override HashTypeKey SupportedHashType => HashTypeKey.SHA1; diff --git a/src/CommonUtilities/src/Hashing/Providers/SHA256HashProvider.cs b/src/CommonUtilities/src/Hashing/Providers/SHA256HashProvider.cs index 79756db..99082bc 100644 --- a/src/CommonUtilities/src/Hashing/Providers/SHA256HashProvider.cs +++ b/src/CommonUtilities/src/Hashing/Providers/SHA256HashProvider.cs @@ -6,6 +6,7 @@ namespace AnakinRaW.CommonUtilities.Hashing.Providers; +// ReSharper disable once InconsistentNaming internal class SHA256HashProvider : HashAlgorithmProviderBase { public override HashTypeKey SupportedHashType => HashTypeKey.SHA256; diff --git a/src/CommonUtilities/src/Hashing/Providers/SHA384HashProvider.cs b/src/CommonUtilities/src/Hashing/Providers/SHA384HashProvider.cs index 3c21e69..5198ba4 100644 --- a/src/CommonUtilities/src/Hashing/Providers/SHA384HashProvider.cs +++ b/src/CommonUtilities/src/Hashing/Providers/SHA384HashProvider.cs @@ -6,6 +6,7 @@ namespace AnakinRaW.CommonUtilities.Hashing.Providers; +// ReSharper disable once InconsistentNaming internal class SHA384HashProvider : HashAlgorithmProviderBase { public override HashTypeKey SupportedHashType => HashTypeKey.SHA384; diff --git a/src/CommonUtilities/src/Hashing/Providers/SHA512HashProvider.cs b/src/CommonUtilities/src/Hashing/Providers/SHA512HashProvider.cs index a0d7374..af086bf 100644 --- a/src/CommonUtilities/src/Hashing/Providers/SHA512HashProvider.cs +++ b/src/CommonUtilities/src/Hashing/Providers/SHA512HashProvider.cs @@ -6,6 +6,7 @@ namespace AnakinRaW.CommonUtilities.Hashing.Providers; +// ReSharper disable once InconsistentNaming internal class SHA512HashProvider : HashAlgorithmProviderBase { public override HashTypeKey SupportedHashType => HashTypeKey.SHA512; diff --git a/src/CommonUtilities/src/NativeMethods/AdvApi32.cs b/src/CommonUtilities/src/NativeMethods/AdvApi32.cs index 55a054e..5997599 100644 --- a/src/CommonUtilities/src/NativeMethods/AdvApi32.cs +++ b/src/CommonUtilities/src/NativeMethods/AdvApi32.cs @@ -1,6 +1,7 @@ using System; using System.ComponentModel; using System.Runtime.InteropServices; +// ReSharper disable InconsistentNaming namespace AnakinRaW.CommonUtilities.NativeMethods; diff --git a/src/CommonUtilities/test/Collections/FrugalListTest.cs b/src/CommonUtilities/test/Collections/FrugalListTest.cs index d834dbd..264e320 100644 --- a/src/CommonUtilities/test/Collections/FrugalListTest.cs +++ b/src/CommonUtilities/test/Collections/FrugalListTest.cs @@ -1,4 +1,5 @@ using System; +// ReSharper disable InconsistentNaming namespace AnakinRaW.CommonUtilities.Test.Collections; diff --git a/src/CommonUtilities/test/Collections/ReadOnlyFrugalListTests.cs b/src/CommonUtilities/test/Collections/ReadOnlyFrugalListTests.cs index 7d38d7f..aca8c84 100644 --- a/src/CommonUtilities/test/Collections/ReadOnlyFrugalListTests.cs +++ b/src/CommonUtilities/test/Collections/ReadOnlyFrugalListTests.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using AnakinRaW.CommonUtilities.Collections; +// ReSharper disable InconsistentNaming namespace AnakinRaW.CommonUtilities.Test.Collections; diff --git a/src/CommonUtilities/test/Extensions/EncodingExtensionsTest.cs b/src/CommonUtilities/test/Extensions/EncodingExtensionsTest.cs index 429ad52..dc35d93 100644 --- a/src/CommonUtilities/test/Extensions/EncodingExtensionsTest.cs +++ b/src/CommonUtilities/test/Extensions/EncodingExtensionsTest.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Text; using AnakinRaW.CommonUtilities.Extensions; @@ -133,13 +134,14 @@ public void GetChars() #region EncodeString [Fact] + [SuppressMessage("ReSharper", "AssignNullToNotNullAttribute")] public void EncodeString_NullArgs_Throws() { Encoding encoding = null!; Assert.Throws(() => encoding.EncodeString("")); Assert.Throws(() => encoding.EncodeString("", 0)); - Assert.Throws(() => encoding!.EncodeString("".AsSpan(), Span.Empty)); - Assert.Throws(() => encoding!.EncodeString("".AsSpan(), Span.Empty, 0)); + Assert.Throws(() => encoding.EncodeString("".AsSpan(), Span.Empty)); + Assert.Throws(() => encoding.EncodeString("".AsSpan(), Span.Empty, 0)); ForEachEncoding(e => { diff --git a/src/CommonUtilities/test/Hashing/HashTypeKeyTest.cs b/src/CommonUtilities/test/Hashing/HashTypeKeyTest.cs index dbd0c50..1d68209 100644 --- a/src/CommonUtilities/test/Hashing/HashTypeKeyTest.cs +++ b/src/CommonUtilities/test/Hashing/HashTypeKeyTest.cs @@ -18,9 +18,9 @@ public void Ctor() public void None() { var key = HashTypeKey.None; - Assert.Null(key.Name); Assert.Equal(0, key.GetHashCode()); Assert.Equal(0, key.HashSize); + Assert.Null(key.Name); } [Fact] diff --git a/src/CommonUtilities/test/Hashing/HashingServiceTest.cs b/src/CommonUtilities/test/Hashing/HashingServiceTest.cs index d92e471..8082c67 100644 --- a/src/CommonUtilities/test/Hashing/HashingServiceTest.cs +++ b/src/CommonUtilities/test/Hashing/HashingServiceTest.cs @@ -197,7 +197,7 @@ public void GetHash_AlwaysOneProvider() var someSource = Array.Empty(); var someStream = new MemoryStream(someSource); - var destination = new byte[] { 0, 0 }; + var destination = "\0\0"u8.ToArray(); var expectedHashExact = new byte[] { 1 }; var expectedHashJoint = new byte[] { 1, 0 }; @@ -235,7 +235,7 @@ public async Task GetHashAsync_AlwaysOneProvider() var someSource = Array.Empty(); var someStream = new MemoryStream(someSource); - var destination = new byte[] { 0, 0 }; + var destination = "\0\0"u8.ToArray(); var expectedHashExact = new byte[] { 1 }; var expectedHashJoint = new byte[] { 1, 0 }; From e65029f4fdaa4a4e6ef5f4a1c81c3e850a903cc3 Mon Sep 17 00:00:00 2001 From: AnakinRaW Date: Sun, 7 Dec 2025 18:30:40 +0100 Subject: [PATCH 19/23] extensions --- .../src/Extensions/FileSystemExtensions.cs | 96 ++++---- .../Extensions/FileSystemInfoExtensions.cs | 79 +++---- .../src/Windows/WindowsPathExtensions.cs | 93 ++++---- .../src/Extensions.cs | 17 +- .../EncodingExtensions.NetFramework.cs | 90 ++++---- .../src/Extensions/EncodingExtensions.cs | 217 +++++++++--------- 6 files changed, 298 insertions(+), 294 deletions(-) diff --git a/src/CommonUtilities.FileSystem/src/Extensions/FileSystemExtensions.cs b/src/CommonUtilities.FileSystem/src/Extensions/FileSystemExtensions.cs index 032051d..289843e 100644 --- a/src/CommonUtilities.FileSystem/src/Extensions/FileSystemExtensions.cs +++ b/src/CommonUtilities.FileSystem/src/Extensions/FileSystemExtensions.cs @@ -9,58 +9,58 @@ namespace AnakinRaW.CommonUtilities.FileSystem; /// public static class FileSystemExtensions { - /// - /// Tries to create a new file and returns an open to the created file, or if the file could not be created. - /// An existing file will be overwritten. - /// /// - /// The file's location. - /// A bitwise combination of the enumeration values that determines how the file can be accessed by the object. - /// A bitwise combination of the enumeration values that determines how the file will be shared by processes. - /// Number of retry attempts tempts until the operation fails. - /// Delay time in ms between each new attempt. - /// Open file stream or if the file could not be created. - /// or is . - public static FileSystemStream? CreateFileWithRetry( - this IFileSystem fs, - string path, - FileAccess fileAccess = FileAccess.ReadWrite, - FileShare fileShare = FileShare.None, - int retryCount = 2, - int retryDelay = 500) + extension(IFileSystem fs) { - if (fs == null) - throw new ArgumentNullException(nameof(fs)); - if (path == null) - throw new ArgumentNullException(nameof(path)); - - FileSystemStream? stream = null; - FileSystemUtilities.ExecuteFileSystemActionWithRetry(retryCount, retryDelay, - () => stream = fs.FileStream.New(path, FileMode.Create, fileAccess, fileShare)); - return stream; - } + /// + /// Tries to create a new file and returns an open to the created file, or if the file could not be created. + /// An existing file will be overwritten. + /// + /// The file's location. + /// A bitwise combination of the enumeration values that determines how the file can be accessed by the object. + /// A bitwise combination of the enumeration values that determines how the file will be shared by processes. + /// Number of retry attempts tempts until the operation fails. + /// Delay time in ms between each new attempt. + /// Open file stream or if the file could not be created. + /// or is . + public FileSystemStream? CreateFileWithRetry(string path, + FileAccess fileAccess = FileAccess.ReadWrite, + FileShare fileShare = FileShare.None, + int retryCount = 2, + int retryDelay = 500) + { + if (fs == null) + throw new ArgumentNullException(nameof(fs)); + if (path == null) + throw new ArgumentNullException(nameof(path)); - /// - /// Tries to create a new unique folder within the current users temporary directory. - /// - /// - /// Number of retry attempts tempts until the operation fails. - /// Delay time in ms between each new attempt. - /// The of the created folder or . - /// is . - public static IDirectoryInfo? CreateTemporaryFolderInTempWithRetry(this IFileSystem fs, int retryCount = 2, int retryDelay = 500) - { - if (fs == null) - throw new ArgumentNullException(nameof(fs)); + FileSystemStream? stream = null; + FileSystemUtilities.ExecuteFileSystemActionWithRetry(retryCount, retryDelay, + () => stream = fs.FileStream.New(path, FileMode.Create, fileAccess, fileShare)); + return stream; + } - IDirectoryInfo? newTempFolder = null; - FileSystemUtilities.ExecuteFileSystemActionWithRetry(retryCount, retryDelay, () => + /// + /// Tries to create a new unique folder within the current users temporary directory. + /// + /// Number of retry attempts tempts until the operation fails. + /// Delay time in ms between each new attempt. + /// The of the created folder or . + /// is . + public IDirectoryInfo? CreateTemporaryFolderInTempWithRetry(int retryCount = 2, int retryDelay = 500) { - var tempFolder = fs.Path.GetTempPath(); - var folderName = fs.Path.GetRandomFileName(); - var fullFolderPath = fs.Path.Combine(tempFolder, folderName); - newTempFolder = fs.Directory.CreateDirectory(fullFolderPath); - }); - return newTempFolder; + if (fs == null) + throw new ArgumentNullException(nameof(fs)); + + IDirectoryInfo? newTempFolder = null; + FileSystemUtilities.ExecuteFileSystemActionWithRetry(retryCount, retryDelay, () => + { + var tempFolder = fs.Path.GetTempPath(); + var folderName = fs.Path.GetRandomFileName(); + var fullFolderPath = fs.Path.Combine(tempFolder, folderName); + newTempFolder = fs.Directory.CreateDirectory(fullFolderPath); + }); + return newTempFolder; + } } } \ No newline at end of file diff --git a/src/CommonUtilities.FileSystem/src/Extensions/FileSystemInfoExtensions.cs b/src/CommonUtilities.FileSystem/src/Extensions/FileSystemInfoExtensions.cs index e9375ad..448737e 100644 --- a/src/CommonUtilities.FileSystem/src/Extensions/FileSystemInfoExtensions.cs +++ b/src/CommonUtilities.FileSystem/src/Extensions/FileSystemInfoExtensions.cs @@ -9,51 +9,52 @@ namespace AnakinRaW.CommonUtilities.FileSystem; /// public static class FileSystemInfoExtensions { - /// - /// Gets the remaining free bytes on the drive where is located. - /// /// Some file or directory at the targeted drive. - /// free drive space in bytes - /// is . - public static long GetDriveFreeSpace(this IFileSystemInfo fsItem) + extension(IFileSystemInfo fsItem) { - if (fsItem == null) - throw new ArgumentNullException(nameof(fsItem)); + /// + /// Gets the remaining free bytes on the drive where is located. + /// + /// free drive space in bytes + /// is . + public long GetDriveFreeSpace() + { + if (fsItem == null) + throw new ArgumentNullException(nameof(fsItem)); - var root = fsItem.FileSystem.Path.GetPathRoot(fsItem.FullName); - return fsItem.FileSystem.DriveInfo.New(root!).AvailableFreeSpace; - } + var root = fsItem.FileSystem.Path.GetPathRoot(fsItem.FullName); + return fsItem.FileSystem.DriveInfo.New(root!).AvailableFreeSpace; + } - /// - /// Removes attributes from a given filesystem entry. - /// - /// The target filesystem handle. - /// Attributes to remove. - /// is . - public static void RemoveAttributes(this IFileSystemInfo fsInfo, FileAttributes attributesToRemove) - { - if (fsInfo == null) - throw new ArgumentNullException(nameof(fsInfo)); + /// + /// Removes attributes from a given filesystem entry. + /// + /// Attributes to remove. + /// is . + public void RemoveAttributes(FileAttributes attributesToRemove) + { + if (fsItem == null) + throw new ArgumentNullException(nameof(fsItem)); - var currentAttributes = fsInfo.Attributes; - var newAttributes = currentAttributes & ~attributesToRemove; - fsInfo.Attributes = newAttributes; - fsInfo.Refresh(); - } + var currentAttributes = fsItem.Attributes; + var newAttributes = currentAttributes & ~attributesToRemove; + fsItem.Attributes = newAttributes; + fsItem.Refresh(); + } - /// - /// Set attributes from a given filesystem entry. - /// - /// The target filesystem handle. - /// Attributes to add. - /// is . - public static void SetAttributes(this IFileSystemInfo fsInfo, FileAttributes attributesToAdd) - { - if (fsInfo == null) - throw new ArgumentNullException(nameof(fsInfo)); + /// + /// Set attributes from a given filesystem entry. + /// + /// Attributes to add. + /// is . + public void SetAttributes(FileAttributes attributesToAdd) + { + if (fsItem == null) + throw new ArgumentNullException(nameof(fsItem)); - var currentAttributes = fsInfo.Attributes; - fsInfo.Attributes = currentAttributes | attributesToAdd; - fsInfo.Refresh(); + var currentAttributes = fsItem.Attributes; + fsItem.Attributes = currentAttributes | attributesToAdd; + fsItem.Refresh(); + } } } \ No newline at end of file diff --git a/src/CommonUtilities.FileSystem/src/Windows/WindowsPathExtensions.cs b/src/CommonUtilities.FileSystem/src/Windows/WindowsPathExtensions.cs index 2cd00d8..c648504 100644 --- a/src/CommonUtilities.FileSystem/src/Windows/WindowsPathExtensions.cs +++ b/src/CommonUtilities.FileSystem/src/Windows/WindowsPathExtensions.cs @@ -19,64 +19,67 @@ namespace AnakinRaW.CommonUtilities.FileSystem.Windows; public static class WindowsPathExtensions { // Based on: https://stackoverflow.com/questions/1410127/c-sharp-test-if-user-has-write-access-to-a-folder - /// - /// Checks whether the current executing user that the requested rights on a given location. - /// /// The directory to check rights on. - /// The requested rights. - /// - /// If does not exists. - /// If the current system is not Windows. - /// is . - public static bool UserHasDirectoryAccessRights(this IDirectoryInfo directoryInfo, FileSystemRights accessRights) + extension(IDirectoryInfo directoryInfo) { - ThrowHelper.ThrowIfNotWindows(); - if (directoryInfo == null) - throw new ArgumentNullException(nameof(directoryInfo)); - bool isInRoleWithAccess; - try + /// + /// Checks whether the current executing user that the requested rights on a given location. + /// + /// The requested rights. + /// + /// If does not exists. + /// If the current system is not Windows. + /// is . + public bool UserHasDirectoryAccessRights(FileSystemRights accessRights) { - if (!directoryInfo.Exists) - throw new DirectoryNotFoundException($"Unable to find {directoryInfo.FullName}"); - isInRoleWithAccess = TestAccessRightsOnWindows(directoryInfo, accessRights); - } - catch (UnauthorizedAccessException) - { - return false; - } - - return isInRoleWithAccess; - } + ThrowHelper.ThrowIfNotWindows(); + if (directoryInfo == null) + throw new ArgumentNullException(nameof(directoryInfo)); + bool isInRoleWithAccess; + try + { + if (!directoryInfo.Exists) + throw new DirectoryNotFoundException($"Unable to find {directoryInfo.FullName}"); + isInRoleWithAccess = TestAccessRightsOnWindows(directoryInfo, accessRights); + } + catch (UnauthorizedAccessException) + { + return false; + } - private static bool TestAccessRightsOnWindows(this IDirectoryInfo directoryInfo, FileSystemRights accessRights) - { - var acl = directoryInfo.GetAccessControl(); - var rules = acl.GetAccessRules(true, true, - // If Windows 7 - Environment.OSVersion.VersionString.StartsWith("6.1") - ? typeof(SecurityIdentifier) - : typeof(NTAccount)); + return isInRoleWithAccess; + } - var currentUser = WindowsIdentity.GetCurrent(); - var principal = new WindowsPrincipal(currentUser); - foreach (AuthorizationRule rule in rules) + private bool TestAccessRightsOnWindows(FileSystemRights accessRights) { - if (rule is not FileSystemAccessRule fsAccessRule) - continue; + var acl = directoryInfo.GetAccessControl(); + var rules = acl.GetAccessRules(true, true, + // If Windows 7 + Environment.OSVersion.VersionString.StartsWith("6.1") + ? typeof(SecurityIdentifier) + : typeof(NTAccount)); - if ((fsAccessRule.FileSystemRights & accessRights) > 0) + var currentUser = WindowsIdentity.GetCurrent(); + var principal = new WindowsPrincipal(currentUser); + foreach (AuthorizationRule rule in rules) { - var ntAccount = rule.IdentityReference as NTAccount; - if (ntAccount == null) + if (rule is not FileSystemAccessRule fsAccessRule) continue; - if (principal.IsInRole(ntAccount.Value)) + if ((fsAccessRule.FileSystemRights & accessRights) > 0) { - return fsAccessRule.AccessControlType != AccessControlType.Deny; + var ntAccount = rule.IdentityReference as NTAccount; + if (ntAccount == null) + continue; + + if (principal.IsInRole(ntAccount.Value)) + { + return fsAccessRule.AccessControlType != AccessControlType.Deny; + } } } - } - return false; + return false; + } } } \ No newline at end of file diff --git a/src/CommonUtilities.SimplePipeline/src/Extensions.cs b/src/CommonUtilities.SimplePipeline/src/Extensions.cs index 49a4769..fc6bdd4 100644 --- a/src/CommonUtilities.SimplePipeline/src/Extensions.cs +++ b/src/CommonUtilities.SimplePipeline/src/Extensions.cs @@ -5,14 +5,17 @@ namespace AnakinRaW.CommonUtilities.SimplePipeline; internal static class Extensions { - public static bool IsExceptionType(this Exception error) where T : Exception + extension(Exception error) { - return error switch + public bool IsExceptionType() where T : Exception { - T _ => true, - AggregateException aggregateException => aggregateException.InnerExceptions.Any(p => - p.IsExceptionType()), - _ => false - }; + return error switch + { + T _ => true, + AggregateException aggregateException => aggregateException.InnerExceptions.Any(p => + p.IsExceptionType()), + _ => false + }; + } } } \ No newline at end of file diff --git a/src/CommonUtilities/src/Extensions/EncodingExtensions.NetFramework.cs b/src/CommonUtilities/src/Extensions/EncodingExtensions.NetFramework.cs index a86af2a..70b1273 100644 --- a/src/CommonUtilities/src/Extensions/EncodingExtensions.NetFramework.cs +++ b/src/CommonUtilities/src/Extensions/EncodingExtensions.NetFramework.cs @@ -8,56 +8,56 @@ namespace AnakinRaW.CommonUtilities.Extensions; public static partial class EncodingExtensions { - /// - /// Encodes into a span of bytes a set of characters from the specified read-only span. - /// /// The encoding to use. - /// The span containing the set of characters to encode. - /// The byte span to hold the encoded bytes. - /// The number of encoded bytes. - public static unsafe int GetBytes(this Encoding encoding, ReadOnlySpan value, Span destination) + extension(Encoding encoding) { - fixed (char* charsPtr = &GetNonNullPinnableReference(value)) - fixed (byte* bytesPtr = &GetNonNullPinnableReference(destination)) - return encoding.GetBytes(charsPtr, value.Length, bytesPtr, destination.Length); - } + /// + /// Encodes into a span of bytes a set of characters from the specified read-only span. + /// + /// The span containing the set of characters to encode. + /// The byte span to hold the encoded bytes. + /// The number of encoded bytes. + public unsafe int GetBytes(ReadOnlySpan value, Span destination) + { + fixed (char* charsPtr = &GetNonNullPinnableReference(value)) + fixed (byte* bytesPtr = &GetNonNullPinnableReference(destination)) + return encoding.GetBytes(charsPtr, value.Length, bytesPtr, destination.Length); + } - /// - /// Decodes all the bytes in the specified read-only byte span into a character span. - /// - /// The encoding to use. - /// A read-only span containing the sequence of bytes to decode. - /// The character span receiving the decoded bytes. - /// The actual number of characters written at the span indicated by the parameter. - public static unsafe int GetChars(this Encoding encoding, ReadOnlySpan bytes, Span chars) - { - fixed (byte* pBytes = &GetNonNullPinnableReference(bytes)) - fixed (char* pChar = &GetNonNullPinnableReference(chars)) - return encoding.GetChars(pBytes, bytes.Length, pChar, chars.Length); - } + /// + /// Decodes all the bytes in the specified read-only byte span into a character span. + /// + /// A read-only span containing the sequence of bytes to decode. + /// The character span receiving the decoded bytes. + /// The actual number of characters written at the span indicated by the parameter. + public unsafe int GetChars(ReadOnlySpan bytes, Span chars) + { + fixed (byte* pBytes = &GetNonNullPinnableReference(bytes)) + fixed (char* pChar = &GetNonNullPinnableReference(chars)) + return encoding.GetChars(pBytes, bytes.Length, pChar, chars.Length); + } - /// - /// Decodes all the bytes in the specified byte span into a string. - /// - /// The encoding to use - /// A read-only byte span to decode to a Unicode string. - /// A string that contains the decoded bytes from the provided read-only span. - public static unsafe string GetString(this Encoding encoding, ReadOnlySpan bytes) - { - fixed (byte* bytesPtr = &GetNonNullPinnableReference(bytes)) - return encoding.GetString(bytesPtr, bytes.Length); - } + /// + /// Decodes all the bytes in the specified byte span into a string. + /// + /// A read-only byte span to decode to a Unicode string. + /// A string that contains the decoded bytes from the provided read-only span. + public unsafe string GetString(ReadOnlySpan bytes) + { + fixed (byte* bytesPtr = &GetNonNullPinnableReference(bytes)) + return encoding.GetString(bytesPtr, bytes.Length); + } - /// - /// Calculates the number of bytes produced by encoding the characters in the specified character span. - /// - /// The encoding to use. - /// The span of characters to encode. - /// The number of bytes produced by encoding the specified character span. - public static unsafe int GetByteCount(this Encoding encoding, ReadOnlySpan value) - { - fixed (char* charsPtr = &GetNonNullPinnableReference(value)) - return encoding.GetByteCount(charsPtr, value.Length); + /// + /// Calculates the number of bytes produced by encoding the characters in the specified character span. + /// + /// The span of characters to encode. + /// The number of bytes produced by encoding the specified character span. + public unsafe int GetByteCount(ReadOnlySpan value) + { + fixed (char* charsPtr = &GetNonNullPinnableReference(value)) + return encoding.GetByteCount(charsPtr, value.Length); + } } diff --git a/src/CommonUtilities/src/Extensions/EncodingExtensions.cs b/src/CommonUtilities/src/Extensions/EncodingExtensions.cs index a017ab6..f1b3da5 100644 --- a/src/CommonUtilities/src/Extensions/EncodingExtensions.cs +++ b/src/CommonUtilities/src/Extensions/EncodingExtensions.cs @@ -8,128 +8,125 @@ namespace AnakinRaW.CommonUtilities.Extensions; /// public static partial class EncodingExtensions { - /// - /// Encodes a string value. - /// - /// The string to encode. /// The encoding to use. - /// The encoded string. - /// or is . - public static string EncodeString(this Encoding encoding, string value) + extension(Encoding encoding) { - if (value == null) - throw new ArgumentNullException(nameof(value)); - return encoding.EncodeString(value.AsSpan()); - } + /// + /// Encodes a string value. + /// + /// The string to encode. + /// The encoded string. + /// or is . + public string EncodeString(string value) + { + if (value == null) + throw new ArgumentNullException(nameof(value)); + return encoding.EncodeString(value.AsSpan()); + } - /// - /// Encodes a string value. - /// - /// The string to encode. - /// Maximum bytes required for encoding. - /// The encoding to use. - /// The encoded string. - /// or is . - /// is less than actually required. - /// is negative. - public static string EncodeString(this Encoding encoding, string value, int maxByteCount) - { - if (value == null) - throw new ArgumentNullException(nameof(value)); + /// + /// Encodes a string value. + /// + /// The string to encode. + /// Maximum bytes required for encoding. + /// The encoded string. + /// or is . + /// is less than actually required. + /// is negative. + public string EncodeString(string value, int maxByteCount) + { + if (value == null) + throw new ArgumentNullException(nameof(value)); - return encoding.EncodeString(value.AsSpan(), maxByteCount); - } + return encoding.EncodeString(value.AsSpan(), maxByteCount); + } - /// - /// Encodes a character sequence. - /// - /// The span of characters to encode. - /// The encoding to use. - /// The encoded string. - /// is . - public static string EncodeString(this Encoding encoding, ReadOnlySpan value) - { - if (encoding == null) - throw new ArgumentNullException(nameof(encoding)); + /// + /// Encodes a character sequence. + /// + /// The span of characters to encode. + /// The encoded string. + /// is . + public string EncodeString(ReadOnlySpan value) + { + if (encoding == null) + throw new ArgumentNullException(nameof(encoding)); - return encoding.EncodeString(value, encoding.GetMaxByteCount(value.Length)); - } + return encoding.EncodeString(value, encoding.GetMaxByteCount(value.Length)); + } - /// - /// Encodes a character sequence. - /// - /// The span of characters to encode. - /// Maximum bytes required for encoding. - /// The encoding to use. - /// The encoded string. - /// is . - /// is less than actually required. - /// is negative. - public static unsafe string EncodeString(this Encoding encoding, ReadOnlySpan value, int maxByteCount) - { - if (encoding == null) - throw new ArgumentNullException(nameof(encoding)); - if (maxByteCount < 0) - throw new ArgumentOutOfRangeException(nameof(maxByteCount), "value must not be negative."); + /// + /// Encodes a character sequence. + /// + /// The span of characters to encode. + /// Maximum bytes required for encoding. + /// The encoded string. + /// is . + /// is less than actually required. + /// is negative. + public unsafe string EncodeString(ReadOnlySpan value, int maxByteCount) + { + if (encoding == null) + throw new ArgumentNullException(nameof(encoding)); + if (maxByteCount < 0) + throw new ArgumentOutOfRangeException(nameof(maxByteCount), "value must not be negative."); - var buffer = maxByteCount <= 256 ? stackalloc byte[maxByteCount] : new byte[maxByteCount]; + var buffer = maxByteCount <= 256 ? stackalloc byte[maxByteCount] : new byte[maxByteCount]; - var stringBytes = encoding.GetBytesReadOnly(value, buffer); - return encoding.GetString(stringBytes); - } + var stringBytes = encoding.GetBytesReadOnly(value, buffer); + return encoding.GetString(stringBytes); + } - /// - /// Encodes into a span of characters a set of characters from the specified read-only span. - /// - /// The encoding to use. - /// The span of characters to encode. - /// The character span to hold the encoded characters. - /// The actual number of characters written at the span indicated by the parameter. - public static int EncodeString(this Encoding encoding, ReadOnlySpan source, Span destination) - { - if (encoding == null) - throw new ArgumentNullException(nameof(encoding)); - var numMaxBytes = encoding.GetMaxByteCount(source.Length); - return EncodeString(encoding, source, destination, numMaxBytes); - } + /// + /// Encodes into a span of characters a set of characters from the specified read-only span. + /// + /// The span of characters to encode. + /// The character span to hold the encoded characters. + /// The actual number of characters written at the span indicated by the parameter. + public int EncodeString(ReadOnlySpan source, Span destination) + { + if (encoding == null) + throw new ArgumentNullException(nameof(encoding)); + var numMaxBytes = encoding.GetMaxByteCount(source.Length); + return EncodeString(encoding, source, destination, numMaxBytes); + } - /// - /// Encodes into a span of characters a set of characters from the specified read-only span. - /// - /// The encoding to use. - /// The span of characters to encode. - /// The character span to hold the encoded characters. - /// Maximum bytes *not characters!* required for encoding. - /// The actual number of characters written at the span indicated by the parameter. - /// is . - /// is less than actually required. - /// is negative. - public static unsafe int EncodeString(this Encoding encoding, ReadOnlySpan source, Span destination, int maxByteCount) - { - if (encoding == null) - throw new ArgumentNullException(nameof(encoding)); - if (maxByteCount < 0) - throw new ArgumentOutOfRangeException(nameof(maxByteCount), "value must not be negative."); + /// + /// Encodes into a span of characters a set of characters from the specified read-only span. + /// + /// The span of characters to encode. + /// The character span to hold the encoded characters. + /// Maximum bytes *not characters!* required for encoding. + /// The actual number of characters written at the span indicated by the parameter. + /// is . + /// is less than actually required. + /// is negative. + public unsafe int EncodeString(ReadOnlySpan source, Span destination, int maxByteCount) + { + if (encoding == null) + throw new ArgumentNullException(nameof(encoding)); + if (maxByteCount < 0) + throw new ArgumentOutOfRangeException(nameof(maxByteCount), "value must not be negative."); - var buffer = maxByteCount > 265 ? new byte[maxByteCount] : stackalloc byte[maxByteCount]; - var bytes = encoding.GetBytesReadOnly(source, buffer); - return encoding.GetChars(bytes, destination); - } + var buffer = maxByteCount > 265 ? new byte[maxByteCount] : stackalloc byte[maxByteCount]; + var bytes = encoding.GetBytesReadOnly(source, buffer); + return encoding.GetChars(bytes, destination); + } - /// - /// Encodes into a read-only span of bytes a set of characters from the specified read-only span. - /// - /// - /// The returned read-only span is sliced from . - /// This means, modifying might also modify the returned read-only span. - /// - /// The encoding to use. - /// The span of characters to encode. - /// The byte span to hold the encoded bytes. - /// The read-only byte span that holds the encoded bytes. - public static ReadOnlySpan GetBytesReadOnly(this Encoding encoding, ReadOnlySpan value, Span inputBuffer) - { - var pathBytesWritten = encoding.GetBytes(value, inputBuffer); - return inputBuffer.Slice(0, pathBytesWritten); + /// + /// Encodes into a read-only span of bytes a set of characters from the specified read-only span. + /// + /// + /// The returned read-only span is sliced from . + /// This means, modifying might also modify the returned read-only span. + /// + /// The span of characters to encode. + /// The byte span to hold the encoded bytes. + /// The read-only byte span that holds the encoded bytes. + public ReadOnlySpan GetBytesReadOnly(ReadOnlySpan value, Span inputBuffer) + { + var pathBytesWritten = encoding.GetBytes(value, inputBuffer); + return inputBuffer.Slice(0, pathBytesWritten); + } } } \ No newline at end of file From f8144bf3addd686e9b697a38a6d8c19dda83afe3 Mon Sep 17 00:00:00 2001 From: AnakinRaW Date: Sun, 7 Dec 2025 18:39:25 +0100 Subject: [PATCH 20/23] logging --- .../src/DownloadManager.cs | 10 +- .../src/Providers/HttpClientDownloader.cs | 6 +- .../src/Providers/WebClientDownloader.cs | 12 +- .../src/Runners/StepRunnerBase.cs | 4 +- .../src/Steps/PipelineStep.cs | 4 +- .../src/Steps/RunPipelineStep.cs | 4 +- .../src/Extensions/EncodingExtensions.cs | 217 +++++++++--------- 7 files changed, 129 insertions(+), 128 deletions(-) diff --git a/src/CommonUtilities.DownloadManager/src/DownloadManager.cs b/src/CommonUtilities.DownloadManager/src/DownloadManager.cs index 14430df..55f7b15 100644 --- a/src/CommonUtilities.DownloadManager/src/DownloadManager.cs +++ b/src/CommonUtilities.DownloadManager/src/DownloadManager.cs @@ -90,7 +90,7 @@ public Task DownloadAsync( if (!uri.IsAbsoluteUri) throw new ArgumentException("Uri must be absolute.", nameof(uri)); - _logger?.LogTrace($"Download requested: {uri.AbsoluteUri}"); + _logger?.LogTrace("Download requested: {Uri}", uri.AbsoluteUri); if (uri is { IsFile: false, IsUnc: false }) { @@ -139,7 +139,7 @@ private async Task DownloadWithRetry( var length = outputStream.Length; try { - _logger?.LogTrace($"Attempting download '{uri.AbsoluteUri}' using provider '{provider.Name}'"); + _logger?.LogTrace("Attempting download '{Uri}' using provider '{ProviderName}'", uri.AbsoluteUri, provider.Name); var summary = await provider.DownloadAsync(uri, outputStream, status => { @@ -193,7 +193,7 @@ private async Task DownloadWithRetry( } } - _logger?.LogInformation($"Download of '{uri.AbsoluteUri}' succeeded using provider '{provider.Name}'"); + _logger?.LogInformation("Download of '{Uri}' succeeded using provider '{ProviderName}'", uri.AbsoluteUri, provider.Name); _leastRecentlyUsedDownloadProviders.LastSuccessfulProvider = provider.Name; summary.DownloadProvider = provider.Name; @@ -207,7 +207,7 @@ private async Task DownloadWithRetry( catch (Exception ex) { failureList.Add(new DownloadFailureInformation(ex, provider.Name)); - _logger?.LogTrace($"Download failed using {provider.Name} provider. {ex}"); + _logger?.LogTrace("Download failed using {Provider} provider. {Exception}", provider.Name, ex); if (provider.Equals(providers.LastOrDefault())) throw new DownloadFailedException(failureList); @@ -222,7 +222,7 @@ private async Task DownloadWithRetry( if (millisecondsTimeout <= 0) continue; - _logger?.LogTrace($"Sleeping {millisecondsTimeout} before retrying download."); + _logger?.LogTrace("Sleeping {WaitTime} before retrying download.", millisecondsTimeout); await Task.Delay(TimeSpan.FromMilliseconds(millisecondsTimeout), cancellationToken); } diff --git a/src/CommonUtilities.DownloadManager/src/Providers/HttpClientDownloader.cs b/src/CommonUtilities.DownloadManager/src/Providers/HttpClientDownloader.cs index 581a963..fc2609d 100644 --- a/src/CommonUtilities.DownloadManager/src/Providers/HttpClientDownloader.cs +++ b/src/CommonUtilities.DownloadManager/src/Providers/HttpClientDownloader.cs @@ -143,15 +143,15 @@ private static HttpRequestMessage CreateRequest(Uri uri) if (cancellationToken.IsCancellationRequested) { _logger?.LogTrace( - "HttpClient error with '" + uri.AbsoluteUri + "' - " + errorMessage); + "HttpClient error with '{Uri}' - {Message}", uri.AbsoluteUri, errorMessage); cancellationToken.ThrowIfCancellationRequested(); } - _logger?.LogTrace("WebClient error - '" + uri.AbsoluteUri + "'."); + _logger?.LogTrace("WebClient error - '{Uri}'.", uri.AbsoluteUri); throw; } catch (Exception ex) { - _logger?.LogError(ex, "General exception error in HttpClient"); + _logger?.LogError(ex, "General exception error in HttpClient: {Message}", ex.Message); throw; } finally diff --git a/src/CommonUtilities.DownloadManager/src/Providers/WebClientDownloader.cs b/src/CommonUtilities.DownloadManager/src/Providers/WebClientDownloader.cs index acfea4c..4031c19 100644 --- a/src/CommonUtilities.DownloadManager/src/Providers/WebClientDownloader.cs +++ b/src/CommonUtilities.DownloadManager/src/Providers/WebClientDownloader.cs @@ -91,13 +91,12 @@ protected override async Task DownloadAsyncCore( : "DownloadCore failed"; if (cancellationToken.IsCancellationRequested) { - _logger?.LogTrace("WebClient error '" + ex.Status + "' with '" + uri.AbsoluteUri + "' - " + - message); + _logger?.LogTrace("WebClient error '{Status}' with '{Uri}' - {Message}", ex.Status, uri.AbsoluteUri, message); cancellationToken.ThrowIfCancellationRequested(); } else { - _logger?.LogTrace("WebClient error '" + ex.Status + "' with '" + uri.AbsoluteUri + "'."); + _logger?.LogTrace("WebClient error '{Status}' with '{Uri}'.", ex.Status, uri.AbsoluteUri); throw; } } @@ -160,7 +159,7 @@ private static HttpWebRequest CreateRequest(Uri uri, DownloadOptions? downloadOp success = true; return httpWebResponse; default: - _logger?.LogTrace($"WebResponse error for '{uri.AbsoluteUri}' ({httpWebResponse.StatusCode})."); + _logger?.LogTrace("WebResponse error for '{Uri}' ({Status}).", uri.AbsoluteUri, httpWebResponse.StatusCode); break; } } @@ -171,12 +170,11 @@ private static HttpWebRequest CreateRequest(Uri uri, DownloadOptions? downloadOp : "GetWebResponse failed"; if (cancellationToken.IsCancellationRequested) { - _logger?.LogTrace( - "WebClient error '" + ex.Status + "' with '" + uri.AbsoluteUri + "' - " + errorMessage); + _logger?.LogTrace("WebClient error '{Status}' with '{Uri}' - {Message}", ex.Status, uri.AbsoluteUri, errorMessage); cancellationToken.ThrowIfCancellationRequested(); } - _logger?.LogTrace("WebClient error '" + ex.Status + "' - '" + uri.AbsoluteUri + "'."); + _logger?.LogTrace("WebClient error '{Status}' - '{Uri}'.", ex.Status, uri.AbsoluteUri); throw; } catch (Exception ex) diff --git a/src/CommonUtilities.SimplePipeline/src/Runners/StepRunnerBase.cs b/src/CommonUtilities.SimplePipeline/src/Runners/StepRunnerBase.cs index d692c9e..2db7260 100644 --- a/src/CommonUtilities.SimplePipeline/src/Runners/StepRunnerBase.cs +++ b/src/CommonUtilities.SimplePipeline/src/Runners/StepRunnerBase.cs @@ -87,9 +87,9 @@ protected void RunSteps(CancellationToken token) if (!alreadyCancelled) { if (e.IsExceptionType()) - Logger?.LogTrace($"Step {step} cancelled"); + Logger?.LogTrace("Step {Step} cancelled", step); else - Logger?.LogTrace(e, $"Step {step} threw an exception: {e.GetType()}: {e.Message}"); + Logger?.LogTrace(e, "Step {Step} threw an exception: {Exception}: {EMessage}", step, e.GetType(), e.Message); } var error = new StepRunnerErrorEventArgs(e, step) diff --git a/src/CommonUtilities.SimplePipeline/src/Steps/PipelineStep.cs b/src/CommonUtilities.SimplePipeline/src/Steps/PipelineStep.cs index e15d119..94f4c41 100644 --- a/src/CommonUtilities.SimplePipeline/src/Steps/PipelineStep.cs +++ b/src/CommonUtilities.SimplePipeline/src/Steps/PipelineStep.cs @@ -40,11 +40,11 @@ protected PipelineStep(IServiceProvider serviceProvider) /// public void Run(CancellationToken token) { - Logger?.LogTrace($"BEGIN: {this}"); + Logger?.LogTrace("BEGIN: {Step}", this); try { RunCore(token); - Logger?.LogTrace($"END: {this}"); + Logger?.LogTrace("END: {Step}", this); } catch (OperationCanceledException ex) { diff --git a/src/CommonUtilities.SimplePipeline/src/Steps/RunPipelineStep.cs b/src/CommonUtilities.SimplePipeline/src/Steps/RunPipelineStep.cs index acaac39..7a13f29 100644 --- a/src/CommonUtilities.SimplePipeline/src/Steps/RunPipelineStep.cs +++ b/src/CommonUtilities.SimplePipeline/src/Steps/RunPipelineStep.cs @@ -17,12 +17,12 @@ public class RunPipelineStep(IPipeline pipeline, IServiceProvider serviceProvide /// protected override void RunSynchronized(CancellationToken token) { - Logger?.LogTrace($"Running {_pipeline}..."); + Logger?.LogTrace("Running {Pipeline}...", _pipeline); try { // ReSharper disable once MethodSupportsCancellation _pipeline.RunAsync(token).Wait(); - Logger?.LogTrace($"Finished {_pipeline}"); + Logger?.LogTrace("Finished {Pipeline}", _pipeline); } catch (AggregateException e) { diff --git a/src/CommonUtilities/src/Extensions/EncodingExtensions.cs b/src/CommonUtilities/src/Extensions/EncodingExtensions.cs index f1b3da5..204917e 100644 --- a/src/CommonUtilities/src/Extensions/EncodingExtensions.cs +++ b/src/CommonUtilities/src/Extensions/EncodingExtensions.cs @@ -8,125 +8,128 @@ namespace AnakinRaW.CommonUtilities.Extensions; /// public static partial class EncodingExtensions { + /// + /// Encodes a string value. + /// + /// The string to encode. /// The encoding to use. - extension(Encoding encoding) + /// The encoded string. + /// or is . + public static string EncodeString(this Encoding encoding, string value) { - /// - /// Encodes a string value. - /// - /// The string to encode. - /// The encoded string. - /// or is . - public string EncodeString(string value) - { - if (value == null) - throw new ArgumentNullException(nameof(value)); - return encoding.EncodeString(value.AsSpan()); - } + if (value == null) + throw new ArgumentNullException(nameof(value)); + return encoding.EncodeString(value.AsSpan()); + } - /// - /// Encodes a string value. - /// - /// The string to encode. - /// Maximum bytes required for encoding. - /// The encoded string. - /// or is . - /// is less than actually required. - /// is negative. - public string EncodeString(string value, int maxByteCount) - { - if (value == null) - throw new ArgumentNullException(nameof(value)); + /// + /// Encodes a string value. + /// + /// The string to encode. + /// Maximum bytes required for encoding. + /// The encoding to use. + /// The encoded string. + /// or is . + /// is less than actually required. + /// is negative. + public static string EncodeString(this Encoding encoding, string value, int maxByteCount) + { + if (value == null) + throw new ArgumentNullException(nameof(value)); - return encoding.EncodeString(value.AsSpan(), maxByteCount); - } + return encoding.EncodeString(value.AsSpan(), maxByteCount); + } - /// - /// Encodes a character sequence. - /// - /// The span of characters to encode. - /// The encoded string. - /// is . - public string EncodeString(ReadOnlySpan value) - { - if (encoding == null) - throw new ArgumentNullException(nameof(encoding)); + /// + /// Encodes a character sequence. + /// + /// The span of characters to encode. + /// The encoding to use. + /// The encoded string. + /// is . + public static string EncodeString(this Encoding encoding, ReadOnlySpan value) + { + if (encoding == null) + throw new ArgumentNullException(nameof(encoding)); - return encoding.EncodeString(value, encoding.GetMaxByteCount(value.Length)); - } + return encoding.EncodeString(value, encoding.GetMaxByteCount(value.Length)); + } - /// - /// Encodes a character sequence. - /// - /// The span of characters to encode. - /// Maximum bytes required for encoding. - /// The encoded string. - /// is . - /// is less than actually required. - /// is negative. - public unsafe string EncodeString(ReadOnlySpan value, int maxByteCount) - { - if (encoding == null) - throw new ArgumentNullException(nameof(encoding)); - if (maxByteCount < 0) - throw new ArgumentOutOfRangeException(nameof(maxByteCount), "value must not be negative."); + /// + /// Encodes a character sequence. + /// + /// The span of characters to encode. + /// Maximum bytes required for encoding. + /// The encoding to use. + /// The encoded string. + /// is . + /// is less than actually required. + /// is negative. + public static unsafe string EncodeString(this Encoding encoding, ReadOnlySpan value, int maxByteCount) + { + if (encoding == null) + throw new ArgumentNullException(nameof(encoding)); + if (maxByteCount < 0) + throw new ArgumentOutOfRangeException(nameof(maxByteCount), "value must not be negative."); - var buffer = maxByteCount <= 256 ? stackalloc byte[maxByteCount] : new byte[maxByteCount]; + var buffer = maxByteCount <= 256 ? stackalloc byte[maxByteCount] : new byte[maxByteCount]; - var stringBytes = encoding.GetBytesReadOnly(value, buffer); - return encoding.GetString(stringBytes); - } + var stringBytes = encoding.GetBytesReadOnly(value, buffer); + return encoding.GetString(stringBytes); + } - /// - /// Encodes into a span of characters a set of characters from the specified read-only span. - /// - /// The span of characters to encode. - /// The character span to hold the encoded characters. - /// The actual number of characters written at the span indicated by the parameter. - public int EncodeString(ReadOnlySpan source, Span destination) - { - if (encoding == null) - throw new ArgumentNullException(nameof(encoding)); - var numMaxBytes = encoding.GetMaxByteCount(source.Length); - return EncodeString(encoding, source, destination, numMaxBytes); - } + /// + /// Encodes into a span of characters a set of characters from the specified read-only span. + /// + /// The span of characters to encode. + /// The character span to hold the encoded characters. + /// The encoding to use. + /// The actual number of characters written at the span indicated by the parameter. + public static int EncodeString(this Encoding encoding, ReadOnlySpan source, Span destination) + { + if (encoding == null) + throw new ArgumentNullException(nameof(encoding)); + var numMaxBytes = encoding.GetMaxByteCount(source.Length); + return EncodeString(encoding, source, destination, numMaxBytes); + } - /// - /// Encodes into a span of characters a set of characters from the specified read-only span. - /// - /// The span of characters to encode. - /// The character span to hold the encoded characters. - /// Maximum bytes *not characters!* required for encoding. - /// The actual number of characters written at the span indicated by the parameter. - /// is . - /// is less than actually required. - /// is negative. - public unsafe int EncodeString(ReadOnlySpan source, Span destination, int maxByteCount) - { - if (encoding == null) - throw new ArgumentNullException(nameof(encoding)); - if (maxByteCount < 0) - throw new ArgumentOutOfRangeException(nameof(maxByteCount), "value must not be negative."); + /// + /// Encodes into a span of characters a set of characters from the specified read-only span. + /// + /// The span of characters to encode. + /// The character span to hold the encoded characters. + /// Maximum bytes *not characters!* required for encoding. + /// The encoding to use. + /// The actual number of characters written at the span indicated by the parameter. + /// is . + /// is less than actually required. + /// is negative. + public static unsafe int EncodeString(this Encoding encoding, ReadOnlySpan source, Span destination, int maxByteCount) + { + if (encoding == null) + throw new ArgumentNullException(nameof(encoding)); + if (maxByteCount < 0) + throw new ArgumentOutOfRangeException(nameof(maxByteCount), "value must not be negative."); - var buffer = maxByteCount > 265 ? new byte[maxByteCount] : stackalloc byte[maxByteCount]; - var bytes = encoding.GetBytesReadOnly(source, buffer); - return encoding.GetChars(bytes, destination); - } + var buffer = maxByteCount > 265 ? new byte[maxByteCount] : stackalloc byte[maxByteCount]; + var bytes = encoding.GetBytesReadOnly(source, buffer); + return encoding.GetChars(bytes, destination); + } - /// - /// Encodes into a read-only span of bytes a set of characters from the specified read-only span. - /// - /// - /// The returned read-only span is sliced from . - /// This means, modifying might also modify the returned read-only span. - /// - /// The span of characters to encode. - /// The byte span to hold the encoded bytes. - /// The read-only byte span that holds the encoded bytes. - public ReadOnlySpan GetBytesReadOnly(ReadOnlySpan value, Span inputBuffer) - { - var pathBytesWritten = encoding.GetBytes(value, inputBuffer); - return inputBuffer.Slice(0, pathBytesWritten); - } + /// + /// Encodes into a read-only span of bytes a set of characters from the specified read-only span. + /// + /// + /// The returned read-only span is sliced from . + /// This means, modifying might also modify the returned read-only span. + /// + /// The span of characters to encode. + /// The byte span to hold the encoded bytes. + /// The encoding to use. + /// The read-only byte span that holds the encoded bytes. + public static ReadOnlySpan GetBytesReadOnly(this Encoding encoding, ReadOnlySpan value, Span inputBuffer) + { + var pathBytesWritten = encoding.GetBytes(value, inputBuffer); + return inputBuffer.Slice(0, pathBytesWritten); } } \ No newline at end of file From a8a56c5fdff700880a90c8fb09d6749f8ec5630e Mon Sep 17 00:00:00 2001 From: AnakinRaW Date: Sun, 7 Dec 2025 18:46:05 +0100 Subject: [PATCH 21/23] revert extensions --- .../src/Extensions/FileSystemExtensions.cs | 94 +++++++++---------- .../Extensions/FileSystemInfoExtensions.cs | 79 ++++++++-------- .../src/Windows/WindowsPathExtensions.cs | 93 +++++++++--------- 3 files changed, 130 insertions(+), 136 deletions(-) diff --git a/src/CommonUtilities.FileSystem/src/Extensions/FileSystemExtensions.cs b/src/CommonUtilities.FileSystem/src/Extensions/FileSystemExtensions.cs index 289843e..e972643 100644 --- a/src/CommonUtilities.FileSystem/src/Extensions/FileSystemExtensions.cs +++ b/src/CommonUtilities.FileSystem/src/Extensions/FileSystemExtensions.cs @@ -9,58 +9,56 @@ namespace AnakinRaW.CommonUtilities.FileSystem; /// public static class FileSystemExtensions { + /// + /// Tries to create a new file and returns an open to the created file, or if the file could not be created. + /// An existing file will be overwritten. + /// + /// The file's location. + /// A bitwise combination of the enumeration values that determines how the file can be accessed by the object. + /// A bitwise combination of the enumeration values that determines how the file will be shared by processes. + /// Number of retry attempts tempts until the operation fails. + /// Delay time in ms between each new attempt. /// - extension(IFileSystem fs) + /// Open file stream or if the file could not be created. + /// or is . + public static FileSystemStream? CreateFileWithRetry(this IFileSystem fs, string path, + FileAccess fileAccess = FileAccess.ReadWrite, + FileShare fileShare = FileShare.None, + int retryCount = 2, + int retryDelay = 500) { - /// - /// Tries to create a new file and returns an open to the created file, or if the file could not be created. - /// An existing file will be overwritten. - /// - /// The file's location. - /// A bitwise combination of the enumeration values that determines how the file can be accessed by the object. - /// A bitwise combination of the enumeration values that determines how the file will be shared by processes. - /// Number of retry attempts tempts until the operation fails. - /// Delay time in ms between each new attempt. - /// Open file stream or if the file could not be created. - /// or is . - public FileSystemStream? CreateFileWithRetry(string path, - FileAccess fileAccess = FileAccess.ReadWrite, - FileShare fileShare = FileShare.None, - int retryCount = 2, - int retryDelay = 500) - { - if (fs == null) - throw new ArgumentNullException(nameof(fs)); - if (path == null) - throw new ArgumentNullException(nameof(path)); + if (fs == null) + throw new ArgumentNullException(nameof(fs)); + if (path == null) + throw new ArgumentNullException(nameof(path)); - FileSystemStream? stream = null; - FileSystemUtilities.ExecuteFileSystemActionWithRetry(retryCount, retryDelay, - () => stream = fs.FileStream.New(path, FileMode.Create, fileAccess, fileShare)); - return stream; - } + FileSystemStream? stream = null; + FileSystemUtilities.ExecuteFileSystemActionWithRetry(retryCount, retryDelay, + () => stream = fs.FileStream.New(path, FileMode.Create, fileAccess, fileShare)); + return stream; + } - /// - /// Tries to create a new unique folder within the current users temporary directory. - /// - /// Number of retry attempts tempts until the operation fails. - /// Delay time in ms between each new attempt. - /// The of the created folder or . - /// is . - public IDirectoryInfo? CreateTemporaryFolderInTempWithRetry(int retryCount = 2, int retryDelay = 500) - { - if (fs == null) - throw new ArgumentNullException(nameof(fs)); + /// + /// Tries to create a new unique folder within the current users temporary directory. + /// + /// Number of retry attempts tempts until the operation fails. + /// Delay time in ms between each new attempt. + /// + /// The of the created folder or . + /// is . + public static IDirectoryInfo? CreateTemporaryFolderInTempWithRetry(this IFileSystem fs, int retryCount = 2, int retryDelay = 500) + { + if (fs == null) + throw new ArgumentNullException(nameof(fs)); - IDirectoryInfo? newTempFolder = null; - FileSystemUtilities.ExecuteFileSystemActionWithRetry(retryCount, retryDelay, () => - { - var tempFolder = fs.Path.GetTempPath(); - var folderName = fs.Path.GetRandomFileName(); - var fullFolderPath = fs.Path.Combine(tempFolder, folderName); - newTempFolder = fs.Directory.CreateDirectory(fullFolderPath); - }); - return newTempFolder; - } + IDirectoryInfo? newTempFolder = null; + FileSystemUtilities.ExecuteFileSystemActionWithRetry(retryCount, retryDelay, () => + { + var tempFolder = fs.Path.GetTempPath(); + var folderName = fs.Path.GetRandomFileName(); + var fullFolderPath = fs.Path.Combine(tempFolder, folderName); + newTempFolder = fs.Directory.CreateDirectory(fullFolderPath); + }); + return newTempFolder; } } \ No newline at end of file diff --git a/src/CommonUtilities.FileSystem/src/Extensions/FileSystemInfoExtensions.cs b/src/CommonUtilities.FileSystem/src/Extensions/FileSystemInfoExtensions.cs index 448737e..49c24fa 100644 --- a/src/CommonUtilities.FileSystem/src/Extensions/FileSystemInfoExtensions.cs +++ b/src/CommonUtilities.FileSystem/src/Extensions/FileSystemInfoExtensions.cs @@ -9,52 +9,51 @@ namespace AnakinRaW.CommonUtilities.FileSystem; /// public static class FileSystemInfoExtensions { + /// + /// Gets the remaining free bytes on the drive where is located. + /// /// Some file or directory at the targeted drive. - extension(IFileSystemInfo fsItem) + /// free drive space in bytes + /// is . + public static long GetDriveFreeSpace(this IFileSystemInfo fsItem) { - /// - /// Gets the remaining free bytes on the drive where is located. - /// - /// free drive space in bytes - /// is . - public long GetDriveFreeSpace() - { - if (fsItem == null) - throw new ArgumentNullException(nameof(fsItem)); + if (fsItem == null) + throw new ArgumentNullException(nameof(fsItem)); - var root = fsItem.FileSystem.Path.GetPathRoot(fsItem.FullName); - return fsItem.FileSystem.DriveInfo.New(root!).AvailableFreeSpace; - } + var root = fsItem.FileSystem.Path.GetPathRoot(fsItem.FullName); + return fsItem.FileSystem.DriveInfo.New(root!).AvailableFreeSpace; + } - /// - /// Removes attributes from a given filesystem entry. - /// - /// Attributes to remove. - /// is . - public void RemoveAttributes(FileAttributes attributesToRemove) - { - if (fsItem == null) - throw new ArgumentNullException(nameof(fsItem)); + /// + /// Removes attributes from a given filesystem entry. + /// + /// Attributes to remove. + /// Some file or directory at the targeted drive. + /// is . + public static void RemoveAttributes(this IFileSystemInfo fsItem, FileAttributes attributesToRemove) + { + if (fsItem == null) + throw new ArgumentNullException(nameof(fsItem)); - var currentAttributes = fsItem.Attributes; - var newAttributes = currentAttributes & ~attributesToRemove; - fsItem.Attributes = newAttributes; - fsItem.Refresh(); - } + var currentAttributes = fsItem.Attributes; + var newAttributes = currentAttributes & ~attributesToRemove; + fsItem.Attributes = newAttributes; + fsItem.Refresh(); + } - /// - /// Set attributes from a given filesystem entry. - /// - /// Attributes to add. - /// is . - public void SetAttributes(FileAttributes attributesToAdd) - { - if (fsItem == null) - throw new ArgumentNullException(nameof(fsItem)); + /// + /// Set attributes from a given filesystem entry. + /// + /// Attributes to add. + /// Some file or directory at the targeted drive. + /// is . + public static void SetAttributes(this IFileSystemInfo fsItem, FileAttributes attributesToAdd) + { + if (fsItem == null) + throw new ArgumentNullException(nameof(fsItem)); - var currentAttributes = fsItem.Attributes; - fsItem.Attributes = currentAttributes | attributesToAdd; - fsItem.Refresh(); - } + var currentAttributes = fsItem.Attributes; + fsItem.Attributes = currentAttributes | attributesToAdd; + fsItem.Refresh(); } } \ No newline at end of file diff --git a/src/CommonUtilities.FileSystem/src/Windows/WindowsPathExtensions.cs b/src/CommonUtilities.FileSystem/src/Windows/WindowsPathExtensions.cs index c648504..2cd00d8 100644 --- a/src/CommonUtilities.FileSystem/src/Windows/WindowsPathExtensions.cs +++ b/src/CommonUtilities.FileSystem/src/Windows/WindowsPathExtensions.cs @@ -19,67 +19,64 @@ namespace AnakinRaW.CommonUtilities.FileSystem.Windows; public static class WindowsPathExtensions { // Based on: https://stackoverflow.com/questions/1410127/c-sharp-test-if-user-has-write-access-to-a-folder + /// + /// Checks whether the current executing user that the requested rights on a given location. + /// /// The directory to check rights on. - extension(IDirectoryInfo directoryInfo) + /// The requested rights. + /// + /// If does not exists. + /// If the current system is not Windows. + /// is . + public static bool UserHasDirectoryAccessRights(this IDirectoryInfo directoryInfo, FileSystemRights accessRights) { - /// - /// Checks whether the current executing user that the requested rights on a given location. - /// - /// The requested rights. - /// - /// If does not exists. - /// If the current system is not Windows. - /// is . - public bool UserHasDirectoryAccessRights(FileSystemRights accessRights) + ThrowHelper.ThrowIfNotWindows(); + if (directoryInfo == null) + throw new ArgumentNullException(nameof(directoryInfo)); + bool isInRoleWithAccess; + try { - ThrowHelper.ThrowIfNotWindows(); - if (directoryInfo == null) - throw new ArgumentNullException(nameof(directoryInfo)); - bool isInRoleWithAccess; - try - { - if (!directoryInfo.Exists) - throw new DirectoryNotFoundException($"Unable to find {directoryInfo.FullName}"); - isInRoleWithAccess = TestAccessRightsOnWindows(directoryInfo, accessRights); - } - catch (UnauthorizedAccessException) - { - return false; - } - - return isInRoleWithAccess; + if (!directoryInfo.Exists) + throw new DirectoryNotFoundException($"Unable to find {directoryInfo.FullName}"); + isInRoleWithAccess = TestAccessRightsOnWindows(directoryInfo, accessRights); + } + catch (UnauthorizedAccessException) + { + return false; } - private bool TestAccessRightsOnWindows(FileSystemRights accessRights) + return isInRoleWithAccess; + } + + private static bool TestAccessRightsOnWindows(this IDirectoryInfo directoryInfo, FileSystemRights accessRights) + { + var acl = directoryInfo.GetAccessControl(); + var rules = acl.GetAccessRules(true, true, + // If Windows 7 + Environment.OSVersion.VersionString.StartsWith("6.1") + ? typeof(SecurityIdentifier) + : typeof(NTAccount)); + + var currentUser = WindowsIdentity.GetCurrent(); + var principal = new WindowsPrincipal(currentUser); + foreach (AuthorizationRule rule in rules) { - var acl = directoryInfo.GetAccessControl(); - var rules = acl.GetAccessRules(true, true, - // If Windows 7 - Environment.OSVersion.VersionString.StartsWith("6.1") - ? typeof(SecurityIdentifier) - : typeof(NTAccount)); + if (rule is not FileSystemAccessRule fsAccessRule) + continue; - var currentUser = WindowsIdentity.GetCurrent(); - var principal = new WindowsPrincipal(currentUser); - foreach (AuthorizationRule rule in rules) + if ((fsAccessRule.FileSystemRights & accessRights) > 0) { - if (rule is not FileSystemAccessRule fsAccessRule) + var ntAccount = rule.IdentityReference as NTAccount; + if (ntAccount == null) continue; - if ((fsAccessRule.FileSystemRights & accessRights) > 0) + if (principal.IsInRole(ntAccount.Value)) { - var ntAccount = rule.IdentityReference as NTAccount; - if (ntAccount == null) - continue; - - if (principal.IsInRole(ntAccount.Value)) - { - return fsAccessRule.AccessControlType != AccessControlType.Deny; - } + return fsAccessRule.AccessControlType != AccessControlType.Deny; } } - - return false; } + + return false; } } \ No newline at end of file From ee205f7be7794f722e8f0516ad7e0bb383985624 Mon Sep 17 00:00:00 2001 From: AnakinRaW Date: Mon, 8 Dec 2025 11:46:40 +0100 Subject: [PATCH 22/23] remove some warning --- .../test/Progress/ProgressTypeTest.cs | 4 ++-- .../Collections/IReadOnlyListTestSuite.cs | 2 ++ .../test/Collections/FrugalListTestBase.cs | 6 ++++++ .../test/Collections/ReadOnlyFrugalListTestBase.cs | 8 ++++++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/CommonUtilities.SimplePipeline/test/Progress/ProgressTypeTest.cs b/src/CommonUtilities.SimplePipeline/test/Progress/ProgressTypeTest.cs index 8ea839c..e559be4 100644 --- a/src/CommonUtilities.SimplePipeline/test/Progress/ProgressTypeTest.cs +++ b/src/CommonUtilities.SimplePipeline/test/Progress/ProgressTypeTest.cs @@ -57,10 +57,10 @@ public void EqualsGetHashCode() Assert.True(pt.Equals(pt)); Assert.True(pt.Equals((object)pt)); - // ReSharper disable once EqualExpressionComparison +#pragma warning disable CS1718 // ReSharper disable EqualExpressionComparison Assert.True(pt == pt); - // ReSharper disable once EqualExpressionComparison Assert.False(pt != pt); +#pragma warning restore CS1718 Assert.True(pt.Equals(equal)); Assert.True(pt == equal); Assert.False(pt != equal); diff --git a/src/CommonUtilities.TestingUtilities/Collections/IReadOnlyListTestSuite.cs b/src/CommonUtilities.TestingUtilities/Collections/IReadOnlyListTestSuite.cs index cc7cc52..fb0ef1b 100644 --- a/src/CommonUtilities.TestingUtilities/Collections/IReadOnlyListTestSuite.cs +++ b/src/CommonUtilities.TestingUtilities/Collections/IReadOnlyListTestSuite.cs @@ -40,7 +40,9 @@ protected override IReadOnlyCollection GenericIReadOnlyCollectionFactory(IEnu [Theory] [MemberData(nameof(GetEnumerableTestData))] + #pragma warning disable xUnit1026 public void From_IEnumerable(int _, int enumerableLength, int __, int numberOfDuplicateElements) + #pragma warning restore xUnit1026 { var enumerable = CreateEnumerable(null, enumerableLength, 0, numberOfDuplicateElements); var list = GenericIReadOnlyListFactory(enumerable); diff --git a/src/CommonUtilities/test/Collections/FrugalListTestBase.cs b/src/CommonUtilities/test/Collections/FrugalListTestBase.cs index 551fdce..d9f60ea 100644 --- a/src/CommonUtilities/test/Collections/FrugalListTestBase.cs +++ b/src/CommonUtilities/test/Collections/FrugalListTestBase.cs @@ -7,6 +7,8 @@ namespace AnakinRaW.CommonUtilities.Test.Collections; +#pragma warning disable xUnit2013 + /// /// Contains tests that ensure the correctness of the class. /// @@ -98,7 +100,9 @@ public void Constructor_IEnumerable(int _, int enumerableLength, int __, int num [Theory] [MemberData(nameof(GetEnumerableTestData))] + #pragma warning disable xUnit1026 public void Constructor_IEnumerable_Creates_Copy(int _, int enumerableLength, int __, int numberOfDuplicateElements) + #pragma warning restore xUnit1026 { foreach (var modifyEnumerable in GetModifyEnumerables(ModifyEnumeratorThrows)) { @@ -316,7 +320,9 @@ public void ToArray(int count) [Theory] [MemberData(nameof(GetEnumerableTestData))] + #pragma warning disable xUnit1026 public void GetEnumerator(int _, int enumerableLength, int __, int numberOfDuplicateElements) + #pragma warning restore xUnit1026 { var enumerable = CreateEnumerable(null, enumerableLength, 0, numberOfDuplicateElements); var list = new FrugalList(enumerable); diff --git a/src/CommonUtilities/test/Collections/ReadOnlyFrugalListTestBase.cs b/src/CommonUtilities/test/Collections/ReadOnlyFrugalListTestBase.cs index 1134afb..53313a0 100644 --- a/src/CommonUtilities/test/Collections/ReadOnlyFrugalListTestBase.cs +++ b/src/CommonUtilities/test/Collections/ReadOnlyFrugalListTestBase.cs @@ -8,6 +8,8 @@ namespace AnakinRaW.CommonUtilities.Test.Collections; +#pragma warning disable xUnit2013 + /// /// Contains tests that ensure the correctness of the class. /// @@ -37,7 +39,9 @@ protected override IReadOnlyList GenericIReadOnlyListFactory(IEnumerable e [Fact] public void Empty_Idempotent() { + #pragma warning disable xUnit2002 Assert.NotNull(ReadOnlyFrugalList.Empty); + #pragma warning restore xUnit2002 Assert.Equal(0, ReadOnlyFrugalList.Empty.Count); Assert.Equal(ReadOnlyFrugalList.Empty, ReadOnlyFrugalList.Empty); } @@ -63,7 +67,9 @@ public void Ctor_Single() [Theory] [MemberData(nameof(GetEnumerableTestData))] + #pragma warning disable xUnit1026 public void Ctor_ModificationsGetNotReflectedWhenOriginalListChanges(int _, int enumerableLength, int __, int numberOfDuplicateElements) + #pragma warning restore xUnit1026 { var enumerable = CreateEnumerable(null, enumerableLength, 0, numberOfDuplicateElements); @@ -228,7 +234,9 @@ public void ToArray(int count) [Theory] [MemberData(nameof(GetEnumerableTestData))] + #pragma warning disable xUnit1026 public void GetEnumerator(int _, int enumerableLength, int __, int numberOfDuplicateElements) + #pragma warning restore xUnit1026 { var enumerable = CreateEnumerable(null, enumerableLength, 0, numberOfDuplicateElements); var list = new FrugalList(enumerable); From f9724fcf2ac2c77eaefa28e45fa966d52eb3d01e Mon Sep 17 00:00:00 2001 From: AnakinRaW Date: Mon, 8 Dec 2025 11:50:39 +0100 Subject: [PATCH 23/23] remove more warnings --- src/CommonUtilities/test/Collections/FrugalListTestBase.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/CommonUtilities/test/Collections/FrugalListTestBase.cs b/src/CommonUtilities/test/Collections/FrugalListTestBase.cs index d9f60ea..c58981f 100644 --- a/src/CommonUtilities/test/Collections/FrugalListTestBase.cs +++ b/src/CommonUtilities/test/Collections/FrugalListTestBase.cs @@ -84,7 +84,9 @@ public void Constructor_OtherFrugalList_Creates_Copy(int count) [Theory] [MemberData(nameof(GetEnumerableTestData))] + #pragma warning disable xUnit1026 public void Constructor_IEnumerable(int _, int enumerableLength, int __, int numberOfDuplicateElements) + #pragma warning restore xUnit1026 { var enumerable = CreateEnumerable(null, enumerableLength, 0, numberOfDuplicateElements); var list = new FrugalList(enumerable);