From bba86eab05767d2f6e8f1d8e1c197330e8a82b9a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Sep 2023 04:56:16 +0000 Subject: [PATCH 1/3] Bump MSTest.TestAdapter from 2.2.8 to 3.1.1 Bumps [MSTest.TestAdapter](https://github.com/microsoft/testfx) from 2.2.8 to 3.1.1. - [Release notes](https://github.com/microsoft/testfx/releases) - [Changelog](https://github.com/microsoft/testfx/blob/main/docs/Changelog.md) - [Commits](https://github.com/microsoft/testfx/compare/v2.2.8...v3.1.1) --- updated-dependencies: - dependency-name: MSTest.TestAdapter dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- tests/Shared.LibraryTests/Shared.LibraryTests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Shared.LibraryTests/Shared.LibraryTests.csproj b/tests/Shared.LibraryTests/Shared.LibraryTests.csproj index 1ca20f1..edc6e40 100644 --- a/tests/Shared.LibraryTests/Shared.LibraryTests.csproj +++ b/tests/Shared.LibraryTests/Shared.LibraryTests.csproj @@ -6,7 +6,7 @@ - + From b864d942de77055d8053642341a823895500f021 Mon Sep 17 00:00:00 2001 From: BoBoBaSs84 <73112377+BoBoBaSs84@users.noreply.github.com> Date: Wed, 20 Sep 2023 18:29:14 +0200 Subject: [PATCH 2/3] That'll fix it ... --- .../Classes/Images/DDSImageTests.cs | 26 ++++++++--------- .../Classes/Images/PNGImageTests.cs | 29 ++++++++++--------- 2 files changed, 27 insertions(+), 28 deletions(-) diff --git a/tests/Shared.LibraryTests/Classes/Images/DDSImageTests.cs b/tests/Shared.LibraryTests/Classes/Images/DDSImageTests.cs index 6bb9b3a..477f599 100644 --- a/tests/Shared.LibraryTests/Classes/Images/DDSImageTests.cs +++ b/tests/Shared.LibraryTests/Classes/Images/DDSImageTests.cs @@ -1,26 +1,26 @@ using Shared.Library.Factories; using Shared.Library.Interfaces; -using TC = Shared.LibraryTests.TestConstants; - namespace Shared.LibraryTests.Classes.Images; [TestClass] -[SuppressMessage("Style", "IDE0058", Justification = "UnitTest")] +[DeploymentItem(TestConstants.DdsImage, TestConstants.SourceFolder)] public class DDSImageTests { + private readonly string _sourcePath; + private readonly string _targetPath; + public DDSImageTests() { - Directory.CreateDirectory(TC.SourceFolder); - Directory.CreateDirectory(TC.TargetFolder); + _sourcePath = Path.Combine(AppContext.BaseDirectory, TestConstants.SourceFolder); + _targetPath = Path.Combine(AppContext.BaseDirectory, TestConstants.TargetFolder); } [TestMethod] - [DeploymentItem(TC.DdsImage, TC.SourceFolder)] public void SaveTest() { - string sourceFolder = $"{TC.SourceFolder}\\{TC.DdsImage}"; - string targetFolder = $"{TC.TargetFolder}\\{TC.PngImageSave}"; + string sourceFolder = Path.Combine(_sourcePath, TestConstants.DdsImage); + string targetFolder = Path.Combine(_targetPath, TestConstants.PngImageSave); IImage image = ImageFactory.CreateDdsImage(sourceFolder); image.Save(targetFolder); @@ -36,25 +36,23 @@ public void SaveTest() } [TestMethod] - [DeploymentItem(TC.DdsImage, TC.SourceFolder)] [ExpectedException(typeof(ArgumentOutOfRangeException))] public void SaveWithCompressionExceptionTest() { int compressionLevel = 99; - string sourceFolder = $"{TC.SourceFolder}\\{TC.DdsImage}"; - string targetFolder = $"{TC.TargetFolder}\\{TC.PngImageSave}"; + string sourceFolder = Path.Combine(_sourcePath, TestConstants.DdsImage); + string targetFolder = Path.Combine(_targetPath, TestConstants.PngImageSave); IImage image = ImageFactory.CreateDdsImage(sourceFolder); image.Save(targetFolder, compressionLevel); } [TestMethod] - [DeploymentItem(TC.DdsImage, TC.SourceFolder)] public void SaveWithCompressionTest() { int compressionLevel = 9; - string sourceFolder = $"{TC.SourceFolder}\\{TC.DdsImage}"; - string targetFolder = $"{TC.TargetFolder}\\{compressionLevel}_{TC.PngImageSave}"; + string sourceFolder = Path.Combine(_sourcePath, TestConstants.DdsImage); + string targetFolder = Path.Combine(_targetPath, $"{compressionLevel}_{TestConstants.PngImageSave}"); IImage image = ImageFactory.CreateDdsImage(sourceFolder); image.Save(targetFolder, compressionLevel); diff --git a/tests/Shared.LibraryTests/Classes/Images/PNGImageTests.cs b/tests/Shared.LibraryTests/Classes/Images/PNGImageTests.cs index d42b29c..7df82b1 100644 --- a/tests/Shared.LibraryTests/Classes/Images/PNGImageTests.cs +++ b/tests/Shared.LibraryTests/Classes/Images/PNGImageTests.cs @@ -1,26 +1,27 @@ using Shared.Library.Factories; using Shared.Library.Interfaces; -using TC = Shared.LibraryTests.TestConstants; - namespace Shared.LibraryTests.Classes.Images; [TestClass] -[SuppressMessage("Style", "IDE0058", Justification = "UnitTest")] +[DeploymentItem(TestConstants.PngImage, TestConstants.SourceFolder)] public class PNGImageTests { + private readonly string _sourcePath; + private readonly string _targetPath; + public PNGImageTests() { - Directory.CreateDirectory(TC.SourceFolder); - Directory.CreateDirectory(TC.TargetFolder); + _sourcePath = Path.Combine(AppContext.BaseDirectory, TestConstants.SourceFolder); + _targetPath = Path.Combine(AppContext.BaseDirectory, TestConstants.TargetFolder); } [TestMethod] - [DeploymentItem(TC.PngImage, TC.SourceFolder)] + [DeploymentItem(TestConstants.PngImage, TestConstants.SourceFolder)] public void SaveTest() { - string sourceFolder = $"{TC.SourceFolder}\\{TC.PngImage}"; - string targetFolder = $"{TC.TargetFolder}\\{TC.DdsImageSave}"; + string sourceFolder = Path.Combine(_sourcePath, TestConstants.PngImage); + string targetFolder = Path.Combine(_targetPath, TestConstants.DdsImageSave); IImage image = ImageFactory.CreatePngImage(sourceFolder); image.Save(targetFolder); @@ -36,25 +37,25 @@ public void SaveTest() } [TestMethod] - [DeploymentItem(TC.PngImage, TC.SourceFolder)] + [DeploymentItem(TestConstants.PngImage, TestConstants.SourceFolder)] [ExpectedException(typeof(ArgumentOutOfRangeException))] public void SaveWithCompressionExceptionTest() { int compressionLevel = 99; - string sourceFolder = $"{TC.SourceFolder}\\{TC.PngImage}"; - string targetFolder = $"{TC.TargetFolder}\\{TC.DdsImageSave}"; + string sourceFolder = Path.Combine(_sourcePath, TestConstants.PngImage); + string targetFolder = Path.Combine(_targetPath, TestConstants.DdsImageSave); IImage image = ImageFactory.CreatePngImage(sourceFolder); image.Save(targetFolder, compressionLevel); } [TestMethod] - [DeploymentItem(TC.PngImage, TC.SourceFolder)] + [DeploymentItem(TestConstants.PngImage, TestConstants.SourceFolder)] public void SaveWithCompressionTest() { int compressionLevel = 0; - string sourceFolder = $"{TC.SourceFolder}\\{TC.PngImage}"; - string targetFolder = $"{TC.TargetFolder}\\{compressionLevel}_{TC.DdsImageSave}"; + string sourceFolder = Path.Combine(_sourcePath, TestConstants.PngImage); + string targetFolder = Path.Combine(_targetPath, $"{compressionLevel}_{TestConstants.DdsImageSave}"); IImage image = ImageFactory.CreatePngImage(sourceFolder); image.Save(targetFolder, compressionLevel); From 0b982d25f267b2862dfd8e755629c1a996a5fa4a Mon Sep 17 00:00:00 2001 From: BoBoBaSs84 <73112377+BoBoBaSs84@users.noreply.github.com> Date: Wed, 20 Sep 2023 18:41:34 +0200 Subject: [PATCH 3/3] This will do it... --- tests/Shared.LibraryTests/Classes/Images/DDSImageTests.cs | 3 +++ tests/Shared.LibraryTests/Classes/Images/PNGImageTests.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/tests/Shared.LibraryTests/Classes/Images/DDSImageTests.cs b/tests/Shared.LibraryTests/Classes/Images/DDSImageTests.cs index 477f599..ae3180e 100644 --- a/tests/Shared.LibraryTests/Classes/Images/DDSImageTests.cs +++ b/tests/Shared.LibraryTests/Classes/Images/DDSImageTests.cs @@ -14,6 +14,9 @@ public DDSImageTests() { _sourcePath = Path.Combine(AppContext.BaseDirectory, TestConstants.SourceFolder); _targetPath = Path.Combine(AppContext.BaseDirectory, TestConstants.TargetFolder); + + Directory.CreateDirectory(_sourcePath); + Directory.CreateDirectory(_targetPath); } [TestMethod] diff --git a/tests/Shared.LibraryTests/Classes/Images/PNGImageTests.cs b/tests/Shared.LibraryTests/Classes/Images/PNGImageTests.cs index 7df82b1..b7e7728 100644 --- a/tests/Shared.LibraryTests/Classes/Images/PNGImageTests.cs +++ b/tests/Shared.LibraryTests/Classes/Images/PNGImageTests.cs @@ -14,6 +14,9 @@ public PNGImageTests() { _sourcePath = Path.Combine(AppContext.BaseDirectory, TestConstants.SourceFolder); _targetPath = Path.Combine(AppContext.BaseDirectory, TestConstants.TargetFolder); + + Directory.CreateDirectory(_sourcePath); + Directory.CreateDirectory(_targetPath); } [TestMethod]