From 5317f4f5b396bace90e42a6d5f18907ad9a7b77c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Tue, 5 Dec 2023 13:58:30 +0100 Subject: [PATCH 1/2] Simplify versioning handling --- Directory.Build.Local.props | 6 ------ Directory.Build.Local.targets | 9 +++++++++ src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.csproj | 1 + .../MSTestAdapter.PlatformServices.csproj | 1 + .../TestFramework.Extensions.csproj | 1 + src/TestFramework/TestFramework/TestFramework.csproj | 1 + 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Directory.Build.Local.props b/Directory.Build.Local.props index cbb2eddc0a..acb3ca72f5 100644 --- a/Directory.Build.Local.props +++ b/Directory.Build.Local.props @@ -50,12 +50,6 @@ - - 14.0.0.0 - 14.0.0.0 true false diff --git a/Directory.Build.Local.targets b/Directory.Build.Local.targets index 4e16979548..292d1a0d5a 100644 --- a/Directory.Build.Local.targets +++ b/Directory.Build.Local.targets @@ -10,4 +10,13 @@ $(NetCoreAppLatestStableVersion) + + + 14.0.0.0 + 14.0.0.0 + + diff --git a/src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.csproj b/src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.csproj index 76b60e31e3..73ed1bf026 100644 --- a/src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.csproj +++ b/src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.csproj @@ -3,6 +3,7 @@ netstandard2.0;$(NetCoreAppCurrent);$(NetCoreAppMinimum);$(NetFrameworkMinimum) enable + true diff --git a/src/Adapter/MSTestAdapter.PlatformServices/MSTestAdapter.PlatformServices.csproj b/src/Adapter/MSTestAdapter.PlatformServices/MSTestAdapter.PlatformServices.csproj index 7fd408e0bb..10971dfda4 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/MSTestAdapter.PlatformServices.csproj +++ b/src/Adapter/MSTestAdapter.PlatformServices/MSTestAdapter.PlatformServices.csproj @@ -3,6 +3,7 @@ $(UwpMinimum);$(WinUiMinimum);netstandard2.0;$(NetFrameworkMinimum);$(NetCoreAppMinimum);$(NetCoreAppCurrent) enable + true diff --git a/src/TestFramework/TestFramework.Extensions/TestFramework.Extensions.csproj b/src/TestFramework/TestFramework.Extensions/TestFramework.Extensions.csproj index acca798852..30d5829bfe 100644 --- a/src/TestFramework/TestFramework.Extensions/TestFramework.Extensions.csproj +++ b/src/TestFramework/TestFramework.Extensions/TestFramework.Extensions.csproj @@ -3,6 +3,7 @@ $(UwpMinimum);$(WinUiMinimum);netstandard2.0;$(NetCoreAppCurrent);$(NetCoreAppMinimum);$(NetFrameworkMinimum) enable + true diff --git a/src/TestFramework/TestFramework/TestFramework.csproj b/src/TestFramework/TestFramework/TestFramework.csproj index 3b2d4d5fd6..193d663edd 100644 --- a/src/TestFramework/TestFramework/TestFramework.csproj +++ b/src/TestFramework/TestFramework/TestFramework.csproj @@ -3,6 +3,7 @@ netstandard2.0;$(NetCoreAppCurrent);$(NetCoreAppMinimum);$(NetFrameworkMinimum) enable + true From 88b95f3f330cdbc33bd23c4c0819b470f44022fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amaury=20Lev=C3=A9?= Date: Tue, 5 Dec 2023 17:23:43 +0100 Subject: [PATCH 2/2] Fix tests --- ...tAdapter.PlatformServices.UnitTests.csproj | 1 + .../Utilities/XmlUtilitiesTests.cs | 85 +++++++++++++++---- 2 files changed, 71 insertions(+), 15 deletions(-) diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/MSTestAdapter.PlatformServices.UnitTests.csproj b/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/MSTestAdapter.PlatformServices.UnitTests.csproj index 3b57820a97..0564434317 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/MSTestAdapter.PlatformServices.UnitTests.csproj +++ b/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/MSTestAdapter.PlatformServices.UnitTests.csproj @@ -4,6 +4,7 @@ net48 net462;$(NetStandardNetFrameworkHolder);netcoreapp3.1;net6.0;$(WinUiMinimum) true + true diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/XmlUtilitiesTests.cs b/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/XmlUtilitiesTests.cs index ba1700fce3..9365e95a10 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/XmlUtilitiesTests.cs +++ b/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/XmlUtilitiesTests.cs @@ -16,12 +16,7 @@ namespace MSTestAdapter.PlatformServices.UnitTests.Utilities; public class XmlUtilitiesTests : TestContainer { - private readonly TestableXmlUtilities _testableXmlUtilities; - - public XmlUtilitiesTests() - { - _testableXmlUtilities = new TestableXmlUtilities(); - } + private readonly TestableXmlUtilities _testableXmlUtilities = new(); public void AddAssemblyRedirectionShouldAddRedirectionToAnEmptyXml() { @@ -35,8 +30,19 @@ public void AddAssemblyRedirectionShouldAddRedirectionToAnEmptyXml() assemblyName.Version.ToString()); // Assert. - var expectedXml = - ""; + var expectedXml = """ + + + + + + + + + + + + """; var doc = new XmlDocument(); doc.LoadXml(expectedXml); byte[] expectedConfigBytes = null; @@ -64,8 +70,19 @@ public void AddAssemblyRedirectionShouldAddRedirectionToAnEmptyConfig() assemblyName.Version.ToString()); // Assert. - var expectedXml = - ""; + var expectedXml = """ + + + + + + + + + + + + """; var doc = new XmlDocument(); doc.LoadXml(expectedXml); byte[] expectedConfigBytes = null; @@ -95,8 +112,19 @@ public void AddAssemblyRedirectionShouldAddRedirectionToAConfigWithARuntimeSecti assemblyName.Version.ToString()); // Assert. - var expectedXml = - ""; + var expectedXml = """ + + + + + + + + + + + + """; var doc = new XmlDocument(); #pragma warning disable CA3075 // Insecure DTD processing in XML doc.LoadXml(expectedXml); @@ -114,7 +142,19 @@ public void AddAssemblyRedirectionShouldAddRedirectionToAConfigWithARuntimeSecti public void AddAssemblyRedirectionShouldAddRedirectionToAConfigWithRedirections() { - _testableXmlUtilities.ConfigXml = ""; + _testableXmlUtilities.ConfigXml = """ + + + + + + + + + + + + """; var assemblyName = Assembly.GetExecutingAssembly().GetName(); var configBytes = _testableXmlUtilities.AddAssemblyRedirection( @@ -124,8 +164,23 @@ public void AddAssemblyRedirectionShouldAddRedirectionToAConfigWithRedirections( assemblyName.Version.ToString()); // Assert. - var expectedXml = - ""; + var expectedXml = """ + + + + + + + + + + + + + + + + """; var doc = new XmlDocument(); doc.LoadXml(expectedXml); byte[] expectedConfigBytes = null;