diff --git a/MSTest.slnf b/MSTest.slnf index 13f1d59828..50374d833a 100644 --- a/MSTest.slnf +++ b/MSTest.slnf @@ -6,7 +6,7 @@ "samples\\Playground\\Playground.csproj", "src\\Adapter\\MSTest.Engine\\MSTest.Engine.csproj", "src\\Adapter\\MSTest.TestAdapter\\MSTest.TestAdapter.csproj", - "src\\Adapter\\MSTestAdapter.PlatformServices\\MSTestAdapter.PlatformServices.csproj", + "src\\Adapter\\MSTest.PlatformServices\\MSTest.PlatformServices.csproj", "src\\Analyzers\\MSTest.Analyzers.CodeFixes\\MSTest.Analyzers.CodeFixes.csproj", "src\\Analyzers\\MSTest.Analyzers.Package\\MSTest.Analyzers.Package.csproj", "src\\Analyzers\\MSTest.Analyzers\\MSTest.Analyzers.csproj", @@ -49,10 +49,10 @@ "test\\IntegrationTests\\TestAssets\\TimeoutTestProject\\TimeoutTestProject.csproj", "test\\Performance\\MSTest.Performance.Runner\\MSTest.Performance.Runner.csproj", "test\\UnitTests\\MSTest.Analyzers.UnitTests\\MSTest.Analyzers.UnitTests.csproj", - "test\\UnitTests\\MSTestAdapter.PlatformServices.UnitTests\\MSTestAdapter.PlatformServices.UnitTests.csproj", - "test\\UnitTests\\MSTestAdapter.UnitTests\\MSTestAdapter.UnitTests.csproj", + "test\\UnitTests\\MSTest.PlatformServices.UnitTests\\MSTest.PlatformServices.UnitTests.csproj", + "test\\UnitTests\\MSTest.TestAdapter.UnitTests\\MSTest.TestAdapter.UnitTests.csproj", "test\\UnitTests\\MSTest.SelfRealExamples.UnitTests\\MSTest.SelfRealExamples.UnitTests.csproj", - "test\\UnitTests\\TestFramework.UnitTests\\TestFramework.UnitTests.csproj", + "test\\UnitTests\\MSTest.TestFramework.UnitTests\\MSTest.TestFramework.UnitTests.csproj", "test\\Utilities\\Automation.CLI\\Automation.CLI.csproj", "test\\Utilities\\Microsoft.Testing.TestInfrastructure\\Microsoft.Testing.TestInfrastructure.csproj", "test\\Utilities\\TestFramework.ForTestingMSTest\\TestFramework.ForTestingMSTest.csproj" diff --git a/NonWindowsTests.slnf b/NonWindowsTests.slnf index a095540370..5dbf7fc9ff 100644 --- a/NonWindowsTests.slnf +++ b/NonWindowsTests.slnf @@ -4,7 +4,7 @@ "projects": [ "src\\Adapter\\MSTest.Engine\\MSTest.Engine.csproj", "src\\Adapter\\MSTest.TestAdapter\\MSTest.TestAdapter.csproj", - "src\\Adapter\\MSTestAdapter.PlatformServices\\MSTestAdapter.PlatformServices.csproj", + "src\\Adapter\\MSTest.PlatformServices\\MSTest.PlatformServices.csproj", "src\\Analyzers\\MSTest.Analyzers.CodeFixes\\MSTest.Analyzers.CodeFixes.csproj", "src\\Analyzers\\MSTest.Analyzers.Package\\MSTest.Analyzers.Package.csproj", "src\\Analyzers\\MSTest.Analyzers\\MSTest.Analyzers.csproj", diff --git a/TestFx.slnx b/TestFx.slnx index 321210072b..4c0ae20e52 100644 --- a/TestFx.slnx +++ b/TestFx.slnx @@ -49,7 +49,7 @@ - + @@ -78,7 +78,7 @@ - + @@ -127,8 +127,8 @@ - - - + + + diff --git a/eng/install-access-database-engine.ps1 b/eng/install-access-database-engine.ps1 index 3ff7705794..2b5c9515f4 100644 --- a/eng/install-access-database-engine.ps1 +++ b/eng/install-access-database-engine.ps1 @@ -1,7 +1,7 @@ # This is required for DataSourceTests # Otherwise, the tests will fail with: # The unit test adapter failed to connect to the data source or to read the data. For more information on troubleshooting this error, see "Troubleshooting Data-Driven Unit Tests" (http://go.microsoft.com/fwlink/?LinkId=62412) in the MSDN Library. Error details: The 'Microsoft.Ace.OLEDB.12.0' provider is not registered on the local machine. -# at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.TestDataSource.GetData(ITestMethod testMethodInfo, ITestContext testContext) in /_/src/Adapter/MSTestAdapter.PlatformServices/Services/TestDataSource.cs:84 +# at MSTest.PlatformServices.TestDataSource.GetData(ITestMethod testMethodInfo, ITestContext testContext) in /_/src/Adapter/MSTest.PlatformServices/Services/TestDataSource.cs:84 # The direct download link originates from https://www.microsoft.com/en-us/download/details.aspx?id=54920&msockid=01fa77be234c617f31936293223560aa Invoke-RestMethod https://download.microsoft.com/download/3/5/C/35C84C36-661A-44E6-9324-8786B8DBE231/accessdatabaseengine_X64.exe -OutFile ./accessdatabaseengine_X64.exe Start-Process ./accessdatabaseengine_X64.exe -Wait -ArgumentList "/quiet /passive /norestart" diff --git a/samples/Playground/Program.cs b/samples/Playground/Program.cs index 8e12c8794c..e6f2ac99f3 100644 --- a/samples/Playground/Program.cs +++ b/samples/Playground/Program.cs @@ -8,7 +8,9 @@ using Microsoft.Testing.Platform.Messages; #if NETCOREAPP using Microsoft.Testing.Platform.ServerMode.IntegrationTests.Messages.V100; + using MSTest.Acceptance.IntegrationTests.Messages.V100; + #endif using Microsoft.Testing.Platform.TestHost; using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/Adapter/MSTestAdapter.PlatformServices/AssemblyResolver.cs b/src/Adapter/MSTest.PlatformServices/AssemblyResolver.cs similarity index 99% rename from src/Adapter/MSTestAdapter.PlatformServices/AssemblyResolver.cs rename to src/Adapter/MSTest.PlatformServices/AssemblyResolver.cs index 1a3ee15129..de98386534 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/AssemblyResolver.cs +++ b/src/Adapter/MSTest.PlatformServices/AssemblyResolver.cs @@ -11,7 +11,7 @@ using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; +namespace MSTest.PlatformServices; /// /// Helps resolve MSTestFramework assemblies for CLR loader. @@ -57,7 +57,7 @@ class AssemblyResolver : /// saying we could not find en-gb resource dll which is normal. For more information, /// . /// - private const string PlatformServicesResourcesName = "Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources"; + private const string PlatformServicesResourcesName = "MSTest.PlatformServices.resources"; /// /// This will have the list of all directories read from runsettings. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Data/CsvDataConnection.cs b/src/Adapter/MSTest.PlatformServices/Data/CsvDataConnection.cs similarity index 98% rename from src/Adapter/MSTestAdapter.PlatformServices/Data/CsvDataConnection.cs rename to src/Adapter/MSTest.PlatformServices/Data/CsvDataConnection.cs index 5a50d54742..de1537017e 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Data/CsvDataConnection.cs +++ b/src/Adapter/MSTest.PlatformServices/Data/CsvDataConnection.cs @@ -9,7 +9,7 @@ using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Data; +namespace MSTest.PlatformServices.Data; /// /// Utility classes to access databases, and to handle quoted strings etc for comma separated value files. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Data/OdbcDataConnection.cs b/src/Adapter/MSTest.PlatformServices/Data/OdbcDataConnection.cs similarity index 97% rename from src/Adapter/MSTestAdapter.PlatformServices/Data/OdbcDataConnection.cs rename to src/Adapter/MSTest.PlatformServices/Data/OdbcDataConnection.cs index a02afb0351..7fd5889e13 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Data/OdbcDataConnection.cs +++ b/src/Adapter/MSTest.PlatformServices/Data/OdbcDataConnection.cs @@ -7,7 +7,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Data; +namespace MSTest.PlatformServices.Data; /// /// Utility classes to access databases, and to handle quoted strings etc for ODBC. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Data/OleDataConnection.cs b/src/Adapter/MSTest.PlatformServices/Data/OleDataConnection.cs similarity index 97% rename from src/Adapter/MSTestAdapter.PlatformServices/Data/OleDataConnection.cs rename to src/Adapter/MSTest.PlatformServices/Data/OleDataConnection.cs index afe551583c..5e4c6161b7 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Data/OleDataConnection.cs +++ b/src/Adapter/MSTest.PlatformServices/Data/OleDataConnection.cs @@ -7,7 +7,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Data; +namespace MSTest.PlatformServices; /// /// Utility classes to access databases, and to handle quoted strings etc for OLE DB. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Data/SqlDataConnection.cs b/src/Adapter/MSTest.PlatformServices/Data/SqlDataConnection.cs similarity index 96% rename from src/Adapter/MSTestAdapter.PlatformServices/Data/SqlDataConnection.cs rename to src/Adapter/MSTest.PlatformServices/Data/SqlDataConnection.cs index e0bb32fa1b..c0b5f1ac6e 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Data/SqlDataConnection.cs +++ b/src/Adapter/MSTest.PlatformServices/Data/SqlDataConnection.cs @@ -7,7 +7,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Data; +namespace MSTest.PlatformServices; /// /// Utility classes to access databases, and to handle quoted strings etc for SQL Server. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Data/TestDataConnection.cs b/src/Adapter/MSTest.PlatformServices/Data/TestDataConnection.cs similarity index 98% rename from src/Adapter/MSTestAdapter.PlatformServices/Data/TestDataConnection.cs rename to src/Adapter/MSTest.PlatformServices/Data/TestDataConnection.cs index dc617706d5..46eaa954b4 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Data/TestDataConnection.cs +++ b/src/Adapter/MSTest.PlatformServices/Data/TestDataConnection.cs @@ -8,7 +8,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Data; +namespace MSTest.PlatformServices; /// /// This used to be "DataUtility", a helper class to handle quoted strings etc for different diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Data/TestDataConnectionFactory.cs b/src/Adapter/MSTest.PlatformServices/Data/TestDataConnectionFactory.cs similarity index 97% rename from src/Adapter/MSTestAdapter.PlatformServices/Data/TestDataConnectionFactory.cs rename to src/Adapter/MSTest.PlatformServices/Data/TestDataConnectionFactory.cs index 35929bf664..37a30277ce 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Data/TestDataConnectionFactory.cs +++ b/src/Adapter/MSTest.PlatformServices/Data/TestDataConnectionFactory.cs @@ -5,7 +5,9 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Data; +using MSTest.PlatformServices.Data; + +namespace MSTest.PlatformServices; /// /// Defines a class that creates TestDataConnection instances to connect to data sources. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Data/TestDataConnectionSql.cs b/src/Adapter/MSTest.PlatformServices/Data/TestDataConnectionSql.cs similarity index 99% rename from src/Adapter/MSTestAdapter.PlatformServices/Data/TestDataConnectionSql.cs rename to src/Adapter/MSTest.PlatformServices/Data/TestDataConnectionSql.cs index 90c377b952..6ebe55e8c6 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Data/TestDataConnectionSql.cs +++ b/src/Adapter/MSTest.PlatformServices/Data/TestDataConnectionSql.cs @@ -11,7 +11,9 @@ using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Data; +using MSTest.PlatformServices.Data; + +namespace MSTest.PlatformServices; /// /// Data connections based on direct DB implementations all derive from this one. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Data/XmlDataConnection.cs b/src/Adapter/MSTest.PlatformServices/Data/XmlDataConnection.cs similarity index 98% rename from src/Adapter/MSTestAdapter.PlatformServices/Data/XmlDataConnection.cs rename to src/Adapter/MSTest.PlatformServices/Data/XmlDataConnection.cs index 66b155147c..edd092fed9 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Data/XmlDataConnection.cs +++ b/src/Adapter/MSTest.PlatformServices/Data/XmlDataConnection.cs @@ -8,7 +8,7 @@ using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Data; +namespace MSTest.PlatformServices.Data; /// /// Utility classes to access databases, and to handle quoted strings etc for XML data. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Deployment/AssemblyLoadWorker.cs b/src/Adapter/MSTest.PlatformServices/Deployment/AssemblyLoadWorker.cs similarity index 98% rename from src/Adapter/MSTestAdapter.PlatformServices/Deployment/AssemblyLoadWorker.cs rename to src/Adapter/MSTest.PlatformServices/Deployment/AssemblyLoadWorker.cs index 3c2b3f7e20..38ca1faf09 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Deployment/AssemblyLoadWorker.cs +++ b/src/Adapter/MSTest.PlatformServices/Deployment/AssemblyLoadWorker.cs @@ -3,10 +3,11 @@ #if NETFRAMEWORK -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Deployment; +using MSTest.PlatformServices.Utilities; + +namespace MSTest.PlatformServices; /* * /!\ WARNING /!\ diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Deployment/DeploymentItem.cs b/src/Adapter/MSTest.PlatformServices/Deployment/DeploymentItem.cs similarity index 98% rename from src/Adapter/MSTestAdapter.PlatformServices/Deployment/DeploymentItem.cs rename to src/Adapter/MSTest.PlatformServices/Deployment/DeploymentItem.cs index e041ce0d32..09a3ab2dda 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Deployment/DeploymentItem.cs +++ b/src/Adapter/MSTest.PlatformServices/Deployment/DeploymentItem.cs @@ -5,7 +5,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Deployment; +namespace MSTest.PlatformServices; /// /// Specifies type of deployment item origin, where the item comes from. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Deployment/TestRunDirectories.cs b/src/Adapter/MSTest.PlatformServices/Deployment/TestRunDirectories.cs similarity index 95% rename from src/Adapter/MSTestAdapter.PlatformServices/Deployment/TestRunDirectories.cs rename to src/Adapter/MSTest.PlatformServices/Deployment/TestRunDirectories.cs index 8dceb58277..307c4cdce0 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Deployment/TestRunDirectories.cs +++ b/src/Adapter/MSTest.PlatformServices/Deployment/TestRunDirectories.cs @@ -5,7 +5,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Deployment; +namespace MSTest.PlatformServices.Deployment; /// /// The test run directories. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Discovery/AssemblyEnumerationResult.cs b/src/Adapter/MSTest.PlatformServices/Discovery/AssemblyEnumerationResult.cs similarity index 79% rename from src/Adapter/MSTestAdapter.PlatformServices/Discovery/AssemblyEnumerationResult.cs rename to src/Adapter/MSTest.PlatformServices/Discovery/AssemblyEnumerationResult.cs index a6db3ce581..73b4c9b95a 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Discovery/AssemblyEnumerationResult.cs +++ b/src/Adapter/MSTest.PlatformServices/Discovery/AssemblyEnumerationResult.cs @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; +using MSTest.PlatformServices.ObjectModel; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Discovery; +namespace MSTest.PlatformServices.Discovery; /// /// Helps us communicate results that were created inside of AppDomain, when AppDomains are available and enabled. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Discovery/AssemblyEnumerator.cs b/src/Adapter/MSTest.PlatformServices/Discovery/AssemblyEnumerator.cs similarity index 98% rename from src/Adapter/MSTestAdapter.PlatformServices/Discovery/AssemblyEnumerator.cs rename to src/Adapter/MSTest.PlatformServices/Discovery/AssemblyEnumerator.cs index 62d35947b2..94d143b112 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Discovery/AssemblyEnumerator.cs +++ b/src/Adapter/MSTest.PlatformServices/Discovery/AssemblyEnumerator.cs @@ -4,15 +4,15 @@ using System.Runtime.Serialization; using System.Security; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting.Internal; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Discovery; +using MSTest.PlatformServices.Execution; +using MSTest.PlatformServices.Helpers; +using MSTest.PlatformServices.ObjectModel; + +namespace MSTest.PlatformServices.Discovery; /// /// Enumerates through all types in the assembly in search of valid test methods. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Discovery/AssemblyEnumeratorWrapper.cs b/src/Adapter/MSTest.PlatformServices/Discovery/AssemblyEnumeratorWrapper.cs similarity index 91% rename from src/Adapter/MSTestAdapter.PlatformServices/Discovery/AssemblyEnumeratorWrapper.cs rename to src/Adapter/MSTest.PlatformServices/Discovery/AssemblyEnumeratorWrapper.cs index 31cb06435a..9f2ff134c2 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Discovery/AssemblyEnumeratorWrapper.cs +++ b/src/Adapter/MSTest.PlatformServices/Discovery/AssemblyEnumeratorWrapper.cs @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Discovery; +using MSTest.PlatformServices.Interface; +using MSTest.PlatformServices.ObjectModel; + +namespace MSTest.PlatformServices.Discovery; /// /// Enumerates through an assembly to get a set of test methods. @@ -84,12 +85,12 @@ internal sealed class AssemblyEnumeratorWrapper private static AssemblyEnumerationResult GetTestsInIsolation(string fullFilePath, IRunSettings? runSettings) { - using MSTestAdapter.PlatformServices.Interface.ITestSourceHost isolationHost = PlatformServiceProvider.Instance.CreateTestSourceHost(fullFilePath, runSettings, frameworkHandle: null); + using MSTest.PlatformServices.Interface.ITestSourceHost isolationHost = PlatformServiceProvider.Instance.CreateTestSourceHost(fullFilePath, runSettings, frameworkHandle: null); // Create an instance of a type defined in adapter so that adapter gets loaded in the child app domain var assemblyEnumerator = (AssemblyEnumerator)isolationHost.CreateInstanceForType(typeof(AssemblyEnumerator), [MSTestSettings.CurrentSettings])!; - // This might not be supported if an older version of Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices + // This might not be supported if an older version of MSTest.PlatformServices // assembly is already loaded into the App Domain. string? xml = null; try diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Discovery/DiscoveryTestMethodInfo.cs b/src/Adapter/MSTest.PlatformServices/Discovery/DiscoveryTestMethodInfo.cs similarity index 75% rename from src/Adapter/MSTestAdapter.PlatformServices/Discovery/DiscoveryTestMethodInfo.cs rename to src/Adapter/MSTest.PlatformServices/Discovery/DiscoveryTestMethodInfo.cs index e63bb0b24c..722fa65df6 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Discovery/DiscoveryTestMethodInfo.cs +++ b/src/Adapter/MSTest.PlatformServices/Discovery/DiscoveryTestMethodInfo.cs @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; +using MSTest.PlatformServices.Execution; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Discovery; +namespace MSTest.PlatformServices.Discovery; internal readonly struct DiscoveryTestMethodInfo { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Discovery/TestMethodValidator.cs b/src/Adapter/MSTest.PlatformServices/Discovery/TestMethodValidator.cs similarity index 93% rename from src/Adapter/MSTestAdapter.PlatformServices/Discovery/TestMethodValidator.cs rename to src/Adapter/MSTest.PlatformServices/Discovery/TestMethodValidator.cs index 8810b420e1..f03c7fb8de 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Discovery/TestMethodValidator.cs +++ b/src/Adapter/MSTest.PlatformServices/Discovery/TestMethodValidator.cs @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Discovery; +using MSTest.PlatformServices.Extensions; +using MSTest.PlatformServices.Helpers; + +namespace MSTest.PlatformServices.Discovery; /// /// Determines if a method is a valid test method. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Discovery/TypeEnumerator.cs b/src/Adapter/MSTest.PlatformServices/Discovery/TypeEnumerator.cs similarity index 96% rename from src/Adapter/MSTestAdapter.PlatformServices/Discovery/TypeEnumerator.cs rename to src/Adapter/MSTest.PlatformServices/Discovery/TypeEnumerator.cs index 88192b09bb..11992214c0 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Discovery/TypeEnumerator.cs +++ b/src/Adapter/MSTest.PlatformServices/Discovery/TypeEnumerator.cs @@ -3,12 +3,13 @@ using Microsoft.TestPlatform.AdapterUtilities; using Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Discovery; +using MSTest.PlatformServices.Extensions; +using MSTest.PlatformServices.Helpers; +using MSTest.PlatformServices.ObjectModel; + +namespace MSTest.PlatformServices.Discovery; /// /// Enumerates through the type looking for Valid Test Methods to execute. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Discovery/TypeValidator.cs b/src/Adapter/MSTest.PlatformServices/Discovery/TypeValidator.cs similarity index 98% rename from src/Adapter/MSTestAdapter.PlatformServices/Discovery/TypeValidator.cs rename to src/Adapter/MSTest.PlatformServices/Discovery/TypeValidator.cs index b4b346e649..ae65b82c9e 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Discovery/TypeValidator.cs +++ b/src/Adapter/MSTest.PlatformServices/Discovery/TypeValidator.cs @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Discovery; +using MSTest.PlatformServices.Helpers; + +namespace MSTest.PlatformServices.Discovery; /// /// Determines whether a type is a valid test class for this adapter. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Discovery/UnitTestDiscoverer.cs b/src/Adapter/MSTest.PlatformServices/Discovery/UnitTestDiscoverer.cs similarity index 94% rename from src/Adapter/MSTestAdapter.PlatformServices/Discovery/UnitTestDiscoverer.cs rename to src/Adapter/MSTest.PlatformServices/Discovery/UnitTestDiscoverer.cs index 9421b3c09b..1f732e32ee 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Discovery/UnitTestDiscoverer.cs +++ b/src/Adapter/MSTest.PlatformServices/Discovery/UnitTestDiscoverer.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Discovery; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; +using MSTest.PlatformServices.Discovery; +using MSTest.PlatformServices.Interface; +using MSTest.PlatformServices.ObjectModel; + +namespace MSTest.PlatformServices; [SuppressMessage("Performance", "CA1852: Seal internal types", Justification = "Overrides required for testability")] internal class UnitTestDiscoverer diff --git a/src/Adapter/MSTestAdapter.PlatformServices/EngineConstants.cs b/src/Adapter/MSTest.PlatformServices/EngineConstants.cs similarity index 99% rename from src/Adapter/MSTestAdapter.PlatformServices/EngineConstants.cs rename to src/Adapter/MSTest.PlatformServices/EngineConstants.cs index 519543f4b2..33aea31c50 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/EngineConstants.cs +++ b/src/Adapter/MSTest.PlatformServices/EngineConstants.cs @@ -3,7 +3,7 @@ using Microsoft.VisualStudio.TestPlatform.ObjectModel; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; +namespace MSTest.PlatformServices; internal static class EngineConstants { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/ClassCleanupManager.cs b/src/Adapter/MSTest.PlatformServices/Execution/ClassCleanupManager.cs similarity index 92% rename from src/Adapter/MSTestAdapter.PlatformServices/Execution/ClassCleanupManager.cs rename to src/Adapter/MSTest.PlatformServices/Execution/ClassCleanupManager.cs index 3210819ee5..c2ade421eb 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/ClassCleanupManager.cs +++ b/src/Adapter/MSTest.PlatformServices/Execution/ClassCleanupManager.cs @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; +using MSTest.PlatformServices.ObjectModel; + +namespace MSTest.PlatformServices.Execution; internal sealed class ClassCleanupManager { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/ConsoleErrorRouter.cs b/src/Adapter/MSTest.PlatformServices/Execution/ConsoleErrorRouter.cs similarity index 89% rename from src/Adapter/MSTestAdapter.PlatformServices/Execution/ConsoleErrorRouter.cs rename to src/Adapter/MSTest.PlatformServices/Execution/ConsoleErrorRouter.cs index 7ca55cf1f2..cc00b88d6b 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/ConsoleErrorRouter.cs +++ b/src/Adapter/MSTest.PlatformServices/Execution/ConsoleErrorRouter.cs @@ -1,9 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; - -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; +namespace MSTest.PlatformServices.Execution; internal sealed class ConsoleErrorRouter : TextWriter { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/ConsoleOutRouter.cs b/src/Adapter/MSTest.PlatformServices/Execution/ConsoleOutRouter.cs similarity index 89% rename from src/Adapter/MSTestAdapter.PlatformServices/Execution/ConsoleOutRouter.cs rename to src/Adapter/MSTest.PlatformServices/Execution/ConsoleOutRouter.cs index c4774ec629..c5254524f6 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/ConsoleOutRouter.cs +++ b/src/Adapter/MSTest.PlatformServices/Execution/ConsoleOutRouter.cs @@ -1,9 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; - -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; +namespace MSTest.PlatformServices.Execution; internal sealed class ConsoleOutRouter : TextWriter { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/ExceptionHelper.cs b/src/Adapter/MSTest.PlatformServices/Execution/ExceptionHelper.cs similarity index 96% rename from src/Adapter/MSTestAdapter.PlatformServices/Execution/ExceptionHelper.cs rename to src/Adapter/MSTest.PlatformServices/Execution/ExceptionHelper.cs index a6e0c95214..d2ef879548 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/ExceptionHelper.cs +++ b/src/Adapter/MSTest.PlatformServices/Execution/ExceptionHelper.cs @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; +using MSTest.PlatformServices.ObjectModel; + +namespace MSTest.PlatformServices.Execution; /// /// Provides helper methods to parse stack trace. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TcmTestPropertiesProvider.cs b/src/Adapter/MSTest.PlatformServices/Execution/TcmTestPropertiesProvider.cs similarity index 95% rename from src/Adapter/MSTestAdapter.PlatformServices/Execution/TcmTestPropertiesProvider.cs rename to src/Adapter/MSTest.PlatformServices/Execution/TcmTestPropertiesProvider.cs index 92d8534c6b..8fa0b04b76 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TcmTestPropertiesProvider.cs +++ b/src/Adapter/MSTest.PlatformServices/Execution/TcmTestPropertiesProvider.cs @@ -1,11 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; - using TestPlatformObjectModel = Microsoft.VisualStudio.TestPlatform.ObjectModel; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; +namespace MSTest.PlatformServices.Execution; /// /// Reads and parses the TcmTestProperties in order to populate them in TestRunParameters. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestAssemblyInfo.cs b/src/Adapter/MSTest.PlatformServices/Execution/TestAssemblyInfo.cs similarity index 96% rename from src/Adapter/MSTestAdapter.PlatformServices/Execution/TestAssemblyInfo.cs rename to src/Adapter/MSTest.PlatformServices/Execution/TestAssemblyInfo.cs index 5851e70d6a..88528fadd8 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestAssemblyInfo.cs +++ b/src/Adapter/MSTest.PlatformServices/Execution/TestAssemblyInfo.cs @@ -1,16 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Extensions; using Microsoft.VisualStudio.TestTools.UnitTesting; +using MSTest.PlatformServices.Extensions; +using MSTest.PlatformServices.Helpers; +using MSTest.PlatformServices.ObjectModel; + using UnitTestOutcome = Microsoft.VisualStudio.TestTools.UnitTesting.UnitTestOutcome; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; +namespace MSTest.PlatformServices.Execution; /// /// Defines TestAssembly Info object. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestAssemblySettingsProvider.cs b/src/Adapter/MSTest.PlatformServices/Execution/TestAssemblySettingsProvider.cs similarity index 88% rename from src/Adapter/MSTestAdapter.PlatformServices/Execution/TestAssemblySettingsProvider.cs rename to src/Adapter/MSTest.PlatformServices/Execution/TestAssemblySettingsProvider.cs index 06763e6d6b..34c0e49c92 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestAssemblySettingsProvider.cs +++ b/src/Adapter/MSTest.PlatformServices/Execution/TestAssemblySettingsProvider.cs @@ -3,11 +3,12 @@ using System.Security; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; +using MSTest.PlatformServices.Helpers; +using MSTest.PlatformServices.ObjectModel; + +namespace MSTest.PlatformServices.Execution; internal sealed class TestAssemblySettingsProvider : MarshalByRefObject { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestCaseDiscoverySink.cs b/src/Adapter/MSTest.PlatformServices/Execution/TestCaseDiscoverySink.cs similarity index 91% rename from src/Adapter/MSTestAdapter.PlatformServices/Execution/TestCaseDiscoverySink.cs rename to src/Adapter/MSTest.PlatformServices/Execution/TestCaseDiscoverySink.cs index 8ae3f43e28..3d86a82d87 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestCaseDiscoverySink.cs +++ b/src/Adapter/MSTest.PlatformServices/Execution/TestCaseDiscoverySink.cs @@ -4,7 +4,7 @@ using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; +namespace MSTest.PlatformServices.Execution; /// /// The test case discovery sink. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestClassInfo.cs b/src/Adapter/MSTest.PlatformServices/Execution/TestClassInfo.cs similarity index 97% rename from src/Adapter/MSTestAdapter.PlatformServices/Execution/TestClassInfo.cs rename to src/Adapter/MSTest.PlatformServices/Execution/TestClassInfo.cs index 5d7aff2f97..e98354fbab 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestClassInfo.cs +++ b/src/Adapter/MSTest.PlatformServices/Execution/TestClassInfo.cs @@ -1,17 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Extensions; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; using Microsoft.VisualStudio.TestTools.UnitTesting; +using MSTest.PlatformServices.Extensions; +using MSTest.PlatformServices.Helpers; +using MSTest.PlatformServices.Interface; +using MSTest.PlatformServices.ObjectModel; + +using UnitTestOutcome = Microsoft.VisualStudio.TestTools.UnitTesting.UnitTestOutcome; using UTFUnitTestOutcome = Microsoft.VisualStudio.TestTools.UnitTesting.UnitTestOutcome; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; +namespace MSTest.PlatformServices.Execution; /// /// Defines the TestClassInfo object. @@ -355,7 +355,7 @@ internal TestResult GetResultOrRunClassInitialize(ITestContext testContext, stri if (ClassInitializeMethod is null && BaseClassInitMethods.Count == 0) { IsClassInitializeExecuted = true; - return _classInitializeResult = new() { Outcome = TestTools.UnitTesting.UnitTestOutcome.Passed }; + return _classInitializeResult = new() { Outcome = UnitTestOutcome.Passed }; } // At this point, maybe class initialize was executed by another thread such @@ -386,7 +386,7 @@ internal TestResult GetResultOrRunClassInitialize(ITestContext testContext, stri { var result = new TestResult { - Outcome = TestTools.UnitTesting.UnitTestOutcome.Error, + Outcome = UnitTestOutcome.Error, IgnoreReason = "MSTest STATestClass ClassInitialize didn't complete", }; @@ -430,7 +430,7 @@ TestResult DoRun() { var result = new TestResult { - Outcome = TestTools.UnitTesting.UnitTestOutcome.Passed, + Outcome = UnitTestOutcome.Passed, }; try @@ -668,7 +668,7 @@ void DoRun() #pragma warning disable IDE0056 // Use index operator TestResult lastResult = results[results.Length - 1]; #pragma warning restore IDE0056 // Use index operator - lastResult.Outcome = TestTools.UnitTesting.UnitTestOutcome.Error; + lastResult.Outcome = UnitTestOutcome.Error; lastResult.TestFailureException = ex; } } diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestExecutionManager.cs b/src/Adapter/MSTest.PlatformServices/Execution/TestExecutionManager.cs similarity index 95% rename from src/Adapter/MSTestAdapter.PlatformServices/Execution/TestExecutionManager.cs rename to src/Adapter/MSTest.PlatformServices/Execution/TestExecutionManager.cs index 83ab2c96eb..7ede7763dc 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestExecutionManager.cs +++ b/src/Adapter/MSTest.PlatformServices/Execution/TestExecutionManager.cs @@ -1,19 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; +using MSTest.PlatformServices.Extensions; +using MSTest.PlatformServices.Helpers; +using MSTest.PlatformServices.Interface; +using MSTest.PlatformServices.ObjectModel; + using ExecutionScope = Microsoft.VisualStudio.TestTools.UnitTesting.ExecutionScope; +using TestResult = Microsoft.VisualStudio.TestTools.UnitTesting.TestResult; +using UnitTestOutcome = Microsoft.VisualStudio.TestTools.UnitTesting.UnitTestOutcome; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; +namespace MSTest.PlatformServices.Execution; /// /// Class responsible for execution of tests at assembly level and sending tests via framework handle. @@ -193,10 +195,10 @@ group test by test.Source into testGroup internal virtual UnitTestDiscoverer GetUnitTestDiscoverer(ITestSourceHandler testSourceHandler) => new(testSourceHandler); - internal void SendTestResults(TestCase test, TestTools.UnitTesting.TestResult[] unitTestResults, DateTimeOffset startTime, DateTimeOffset endTime, + internal void SendTestResults(TestCase test, TestResult[] unitTestResults, DateTimeOffset startTime, DateTimeOffset endTime, ITestExecutionRecorder testExecutionRecorder) { - foreach (TestTools.UnitTesting.TestResult unitTestResult in unitTestResults) + foreach (TestResult unitTestResult in unitTestResults) { _testRunCancellationToken?.ThrowIfCancellationRequested(); @@ -265,7 +267,7 @@ private async Task ExecuteTestsInSourceAsync(IEnumerable tests, IRunCo source = Path.Combine(PlatformServiceProvider.Instance.TestDeployment.GetDeploymentDirectory()!, Path.GetFileName(source)); } - using MSTestAdapter.PlatformServices.Interface.ITestSourceHost isolationHost = PlatformServiceProvider.Instance.CreateTestSourceHost(source, runContext?.RunSettings, frameworkHandle); + using MSTest.PlatformServices.Interface.ITestSourceHost isolationHost = PlatformServiceProvider.Instance.CreateTestSourceHost(source, runContext?.RunSettings, frameworkHandle); bool usesAppDomains = isolationHost is TestSourceHost { UsesAppDomain: true }; PlatformServiceProvider.Instance.AdapterTraceLogger.LogInfo("Created unit-test runner {0}", source); @@ -467,7 +469,7 @@ private async Task ExecuteTestsWithTestRunnerAsync( IDictionary? tcmProperties = TcmTestPropertiesProvider.GetTcmProperties(currentTest); Dictionary testContextProperties = GetTestContextProperties(tcmProperties, sourceLevelParameters); - TestTools.UnitTesting.TestResult[] unitTestResult; + TestResult[] unitTestResult; if (usesAppDomains || Thread.CurrentThread.GetApartmentState() == ApartmentState.STA) { #pragma warning disable VSTHRD103 // Call async methods when in an async method - We cannot do right now because we are crossing app domains. @@ -507,9 +509,9 @@ private async Task ExecuteTestsWithTestRunnerAsync( // If there were only fixture tests, send an inconclusive result. if (!hasAnyRunnableTests) { - var result = new TestTools.UnitTesting.TestResult + var result = new TestResult { - Outcome = TestTools.UnitTesting.UnitTestOutcome.Inconclusive, + Outcome = UnitTestOutcome.Inconclusive, }; SendTestResults(currentTest, [result], DateTimeOffset.Now, DateTimeOffset.Now, testExecutionRecorder); @@ -522,7 +524,7 @@ private async Task ExecuteTestsWithTestRunnerAsync( if (fixtureTestResult.IsExecuted) { - var result = new TestTools.UnitTesting.TestResult + var result = new TestResult { Outcome = fixtureTestResult.Outcome, }; diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestMethodInfo.cs b/src/Adapter/MSTest.PlatformServices/Execution/TestMethodInfo.cs similarity index 96% rename from src/Adapter/MSTestAdapter.PlatformServices/Execution/TestMethodInfo.cs rename to src/Adapter/MSTest.PlatformServices/Execution/TestMethodInfo.cs index 2f07fecc14..59aa66664b 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestMethodInfo.cs +++ b/src/Adapter/MSTest.PlatformServices/Execution/TestMethodInfo.cs @@ -1,18 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Extensions; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; using Microsoft.VisualStudio.TestTools.UnitTesting; -using UTF = Microsoft.VisualStudio.TestTools.UnitTesting; +using MSTest.PlatformServices.Extensions; +using MSTest.PlatformServices.Helpers; +using MSTest.PlatformServices.Interface; +using MSTest.PlatformServices.ObjectModel; + using UTFUnitTestOutcome = Microsoft.VisualStudio.TestTools.UnitTesting.UnitTestOutcome; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; +namespace MSTest.PlatformServices.Execution; /// /// Defines the TestMethod Info object. @@ -428,7 +426,7 @@ private async Task ExecuteInternalAsync(object?[]? arguments, Cancel } } - result.Outcome = UTF.UnitTestOutcome.Passed; + result.Outcome = UTFUnitTestOutcome.Passed; } } } @@ -438,7 +436,7 @@ private async Task ExecuteInternalAsync(object?[]? arguments, Cancel if (realException.IsOperationCanceledExceptionFromToken(TestContext!.Context.CancellationTokenSource.Token)) { - result.Outcome = UTF.UnitTestOutcome.Timeout; + result.Outcome = UTFUnitTestOutcome.Timeout; result.TestFailureException = new TestFailedException( UTFUnitTestOutcome.Timeout, timeoutTokenSource?.Token.IsCancellationRequested == true @@ -459,11 +457,11 @@ private async Task ExecuteInternalAsync(object?[]? arguments, Cancel result.TestFailureException ??= HandleMethodException(ex, realException, TestClassName, TestMethodName); } - if (result.Outcome != UTF.UnitTestOutcome.Passed) + if (result.Outcome != UTFUnitTestOutcome.Passed) { result.Outcome = ex is AssertInconclusiveException || ex.InnerException is AssertInconclusiveException - ? UTF.UnitTestOutcome.Inconclusive - : UTF.UnitTestOutcome.Failed; + ? UTFUnitTestOutcome.Inconclusive + : UTFUnitTestOutcome.Failed; } } } @@ -673,7 +671,7 @@ private static TestFailedException HandleMethodException(Exception ex, Exception } Exception realException = testCleanupException.GetRealException(); - UTFUnitTestOutcome outcomeFromRealException = realException is AssertInconclusiveException ? UTF.UnitTestOutcome.Inconclusive : UTF.UnitTestOutcome.Failed; + UTFUnitTestOutcome outcomeFromRealException = realException is AssertInconclusiveException ? UTFUnitTestOutcome.Inconclusive : UTFUnitTestOutcome.Failed; result.Outcome = result.Outcome.GetMoreImportantOutcome(outcomeFromRealException); realException = testCleanupMethod != null @@ -780,8 +778,8 @@ private bool RunTestInitializeMethod(object classInstance, TestResult result, re StackTraceInformation? stackTrace = realException.GetStackTraceInformation(); result.Outcome = realException is AssertInconclusiveException - ? UTF.UnitTestOutcome.Inconclusive - : UTF.UnitTestOutcome.Failed; + ? UTFUnitTestOutcome.Inconclusive + : UTFUnitTestOutcome.Failed; result.TestFailureException = new TestFailedException( result.Outcome, errorMessage, @@ -971,7 +969,7 @@ private bool SetTestContext(object classInstance, TestResult result) TestClassName, realException.GetFormattedExceptionMessage()); - result.Outcome = UTF.UnitTestOutcome.Failed; + result.Outcome = UTFUnitTestOutcome.Failed; StackTraceInformation? stackTraceInfo = realException.GetStackTraceInformation(); result.TestFailureException = new TestFailedException(UTFUnitTestOutcome.Failed, errorMessage, stackTraceInfo); } @@ -1020,7 +1018,7 @@ private bool SetTestContext(object classInstance, TestResult result) if (realException.IsOperationCanceledExceptionFromToken(TestContext!.Context.CancellationTokenSource.Token)) { - result.Outcome = UTF.UnitTestOutcome.Timeout; + result.Outcome = UTFUnitTestOutcome.Timeout; result.TestFailureException = new TestFailedException(UTFUnitTestOutcome.Timeout, string.Format(CultureInfo.CurrentCulture, Resource.Execution_Test_Timeout, TestMethodName, TimeoutInfo.Timeout)); } else @@ -1034,7 +1032,7 @@ private bool SetTestContext(object classInstance, TestResult result) TestClassName, exceptionMessage); - result.Outcome = UTF.UnitTestOutcome.Failed; + result.Outcome = UTFUnitTestOutcome.Failed; result.TestFailureException = new TestFailedException(UTFUnitTestOutcome.Failed, errorMessage, stackTraceInfo); } } @@ -1063,7 +1061,7 @@ private async Task ExecuteInternalWithTimeoutAsync(object?[]? argume { return new() { - Outcome = UTF.UnitTestOutcome.Timeout, + Outcome = UTFUnitTestOutcome.Timeout, TestFailureException = new TestFailedException( UTFUnitTestOutcome.Timeout, string.Format(CultureInfo.CurrentCulture, Resource.Execution_Test_Timeout, TestMethodName, TimeoutInfo.Timeout)), @@ -1080,7 +1078,7 @@ private async Task ExecuteInternalWithTimeoutAsync(object?[]? argume // instances are not well defined so we have to handle the exception entirely. return new() { - Outcome = UTF.UnitTestOutcome.Timeout, + Outcome = UTFUnitTestOutcome.Timeout, TestFailureException = new TestFailedException( UTFUnitTestOutcome.Timeout, timeoutTokenSource.Token.IsCancellationRequested @@ -1123,7 +1121,7 @@ private async Task ExecuteInternalWithTimeoutAsync(object?[]? argume await TestContext.Context.CancellationTokenSource.CancelAsync().ConfigureAwait(false); } - TestResult timeoutResult = new() { Outcome = UTF.UnitTestOutcome.Timeout, TestFailureException = new TestFailedException(UTFUnitTestOutcome.Timeout, errorMessage) }; + TestResult timeoutResult = new() { Outcome = UTFUnitTestOutcome.Timeout, TestFailureException = new TestFailedException(UTFUnitTestOutcome.Timeout, errorMessage) }; // TODO: execution context propagation here may still not be accurate. // if test init was successfully executed by ExecuteAsyncAction, but then the test itself timed out or cancelled, diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestMethodRunner.cs b/src/Adapter/MSTest.PlatformServices/Execution/TestMethodRunner.cs similarity index 97% rename from src/Adapter/MSTestAdapter.PlatformServices/Execution/TestMethodRunner.cs rename to src/Adapter/MSTest.PlatformServices/Execution/TestMethodRunner.cs index b6186984ff..1fa42dcf90 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestMethodRunner.cs +++ b/src/Adapter/MSTest.PlatformServices/Execution/TestMethodRunner.cs @@ -1,19 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions; - -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Extensions; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting.Internal; +using MSTest.PlatformServices.Extensions; +using MSTest.PlatformServices.Helpers; +using MSTest.PlatformServices.Interface; +using MSTest.PlatformServices.ObjectModel; + using UTF = Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; +namespace MSTest.PlatformServices.Execution; /// /// This class is responsible to running tests and converting framework TestResults to adapter TestResults. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestRunCancellationToken.cs b/src/Adapter/MSTest.PlatformServices/Execution/TestRunCancellationToken.cs similarity index 96% rename from src/Adapter/MSTestAdapter.PlatformServices/Execution/TestRunCancellationToken.cs rename to src/Adapter/MSTest.PlatformServices/Execution/TestRunCancellationToken.cs index b2e64085eb..93877172b8 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestRunCancellationToken.cs +++ b/src/Adapter/MSTest.PlatformServices/Execution/TestRunCancellationToken.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; +namespace MSTest.PlatformServices.Execution; /// /// Cancellation token supporting cancellation of a test run. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TimeoutInfo.cs b/src/Adapter/MSTest.PlatformServices/Execution/TimeoutInfo.cs similarity index 93% rename from src/Adapter/MSTestAdapter.PlatformServices/Execution/TimeoutInfo.cs rename to src/Adapter/MSTest.PlatformServices/Execution/TimeoutInfo.cs index e943de5027..a20f8879ac 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TimeoutInfo.cs +++ b/src/Adapter/MSTest.PlatformServices/Execution/TimeoutInfo.cs @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; +using MSTest.PlatformServices.Helpers; + +namespace MSTest.PlatformServices.Execution; internal readonly struct TimeoutInfo { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TraceTextWriter.cs b/src/Adapter/MSTest.PlatformServices/Execution/TraceTextWriter.cs similarity index 81% rename from src/Adapter/MSTestAdapter.PlatformServices/Execution/TraceTextWriter.cs rename to src/Adapter/MSTest.PlatformServices/Execution/TraceTextWriter.cs index 261de5d466..dac07b5838 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TraceTextWriter.cs +++ b/src/Adapter/MSTest.PlatformServices/Execution/TraceTextWriter.cs @@ -1,9 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; - -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; +namespace MSTest.PlatformServices.Execution; internal sealed class TraceTextWriter : TextWriter { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TypeCache.cs b/src/Adapter/MSTest.PlatformServices/Execution/TypeCache.cs similarity index 98% rename from src/Adapter/MSTestAdapter.PlatformServices/Execution/TypeCache.cs rename to src/Adapter/MSTest.PlatformServices/Execution/TypeCache.cs index 673aaf7ac5..1672076cc4 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TypeCache.cs +++ b/src/Adapter/MSTest.PlatformServices/Execution/TypeCache.cs @@ -4,14 +4,15 @@ using System.Security; using Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Discovery; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; +using MSTest.PlatformServices.Discovery; +using MSTest.PlatformServices.Extensions; +using MSTest.PlatformServices.Helpers; +using MSTest.PlatformServices.Interface; +using MSTest.PlatformServices.ObjectModel; + +namespace MSTest.PlatformServices.Execution; /// /// Defines type cache which reflects upon a type and cache its test artifacts. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/UnitTestRunner.cs b/src/Adapter/MSTest.PlatformServices/Execution/UnitTestRunner.cs similarity index 95% rename from src/Adapter/MSTestAdapter.PlatformServices/Execution/UnitTestRunner.cs rename to src/Adapter/MSTest.PlatformServices/Execution/UnitTestRunner.cs index 5c6850e7fa..0cf71cccaf 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/UnitTestRunner.cs +++ b/src/Adapter/MSTest.PlatformServices/Execution/UnitTestRunner.cs @@ -3,20 +3,18 @@ using System.Security; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Extensions; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting.Logging; +using MSTest.PlatformServices.Extensions; +using MSTest.PlatformServices.Helpers; +using MSTest.PlatformServices.Interface; +using MSTest.PlatformServices.ObjectModel; + using UnitTestOutcome = Microsoft.VisualStudio.TestTools.UnitTesting.UnitTestOutcome; -using UTF = Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; +namespace MSTest.PlatformServices.Execution; /// /// The runner that runs a single unit test. Also manages the assembly and class cleanup methods at the end of the run. @@ -142,7 +140,7 @@ internal async Task RunSingleTestAsync(TestMethod testMethod, IDic try { - testContextForTestExecution = PlatformServiceProvider.Instance.GetTestContext(testMethod, null, testContextProperties, messageLogger, UTF.UnitTestOutcome.InProgress); + testContextForTestExecution = PlatformServiceProvider.Instance.GetTestContext(testMethod, null, testContextProperties, messageLogger, UnitTestOutcome.InProgress); // Get the testMethod TestMethodInfo? testMethodInfo = _typeCache.GetTestMethodInfo( @@ -169,7 +167,7 @@ internal async Task RunSingleTestAsync(TestMethod testMethod, IDic TestResult assemblyInitializeResult = RunAssemblyInitializeIfNeeded(testMethodInfo, testContextForAssemblyInit); - if (assemblyInitializeResult.Outcome != UTF.UnitTestOutcome.Passed) + if (assemblyInitializeResult.Outcome != UnitTestOutcome.Passed) { result = [assemblyInitializeResult]; } @@ -179,7 +177,7 @@ internal async Task RunSingleTestAsync(TestMethod testMethod, IDic TestResult classInitializeResult = testMethodInfo.Parent.GetResultOrRunClassInitialize(testContextForClassInit, assemblyInitializeResult.LogOutput, assemblyInitializeResult.LogError, assemblyInitializeResult.DebugTrace, assemblyInitializeResult.TestContextMessages); DebugEx.Assert(testMethodInfo.Parent.IsClassInitializeExecuted, "IsClassInitializeExecuted should be true after attempting to run it."); - if (classInitializeResult.Outcome != UTF.UnitTestOutcome.Passed) + if (classInitializeResult.Outcome != UnitTestOutcome.Passed) { result = [classInitializeResult]; } @@ -284,7 +282,7 @@ private static void RunAssemblyCleanupIfNeeded(ITestContext testContext, ClassCl #pragma warning disable IDE0056 // Use index operator TestResult lastResult = results[results.Length - 1]; #pragma warning restore IDE0056 // Use index operator - lastResult.Outcome = UTF.UnitTestOutcome.Error; + lastResult.Outcome = UnitTestOutcome.Error; lastResult.TestFailureException = ex; return; } diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Extensions/ExceptionExtensions.cs b/src/Adapter/MSTest.PlatformServices/Extensions/ExceptionExtensions.cs similarity index 96% rename from src/Adapter/MSTestAdapter.PlatformServices/Extensions/ExceptionExtensions.cs rename to src/Adapter/MSTest.PlatformServices/Extensions/ExceptionExtensions.cs index 55aff750c6..aa2ad64ce8 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Extensions/ExceptionExtensions.cs +++ b/src/Adapter/MSTest.PlatformServices/Extensions/ExceptionExtensions.cs @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; using Microsoft.VisualStudio.TestTools.UnitTesting; +using MSTest.PlatformServices.ObjectModel; + using UTF = Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Extensions; +namespace MSTest.PlatformServices.Extensions; /// /// Extension methods for the exception class. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Extensions/MethodInfoExtensions.cs b/src/Adapter/MSTest.PlatformServices/Extensions/MethodInfoExtensions.cs similarity index 94% rename from src/Adapter/MSTestAdapter.PlatformServices/Extensions/MethodInfoExtensions.cs rename to src/Adapter/MSTest.PlatformServices/Extensions/MethodInfoExtensions.cs index 03ccf99eb5..6853ae21b3 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Extensions/MethodInfoExtensions.cs +++ b/src/Adapter/MSTest.PlatformServices/Extensions/MethodInfoExtensions.cs @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Extensions; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions; +using MSTest.PlatformServices.Helpers; +using MSTest.PlatformServices.ObjectModel; + +namespace MSTest.PlatformServices.Extensions; internal static class MethodInfoExtensions { @@ -125,7 +125,7 @@ private static bool IsValueTask(this MethodInfo method) if (methodParameters is { Length: > 0 } && arguments == null) { throw new TestFailedException( - TestTools.UnitTesting.UnitTestOutcome.Error, + Microsoft.VisualStudio.TestTools.UnitTesting.UnitTestOutcome.Error, string.Format( CultureInfo.InvariantCulture, Resource.CannotRunTestMethodNoDataError, @@ -168,7 +168,7 @@ private static bool IsValueTask(this MethodInfo method) catch (Exception ex) when (ex is TargetParameterCountException or ArgumentException) { throw new TestFailedException( - TestTools.UnitTesting.UnitTestOutcome.Error, + Microsoft.VisualStudio.TestTools.UnitTesting.UnitTestOutcome.Error, string.Format( CultureInfo.InvariantCulture, Resource.CannotRunTestArgumentsMismatchError, @@ -267,7 +267,7 @@ private static MethodInfo ConstructGenericMethod(MethodInfo methodInfo, object?[ // An example where this could happen is: // [TestMethod] // public void MyTestMethod() { } - throw new TestFailedException(TestTools.UnitTesting.UnitTestOutcome.Error, string.Format(CultureInfo.InvariantCulture, Resource.GenericParameterCantBeInferredBecauseNoArguments, methodInfo.Name)); + throw new TestFailedException(Microsoft.VisualStudio.TestTools.UnitTesting.UnitTestOutcome.Error, string.Format(CultureInfo.InvariantCulture, Resource.GenericParameterCantBeInferredBecauseNoArguments, methodInfo.Name)); } Type[] genericDefinitions = methodInfo.GetGenericArguments(); @@ -326,7 +326,7 @@ private static MethodInfo ConstructGenericMethod(MethodInfo methodInfo, object?[ { // The caller catches ArgumentExceptions and will lose the original exception details. // We transform the exception to TestFailedException here to preserve its details. - throw new TestFailedException(TestTools.UnitTesting.UnitTestOutcome.Error, e.TryGetMessage(), e.TryGetStackTraceInformation(), e); + throw new TestFailedException(Microsoft.VisualStudio.TestTools.UnitTesting.UnitTestOutcome.Error, e.TryGetMessage(), e.TryGetStackTraceInformation(), e); } } diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Extensions/TestCaseExtensions.cs b/src/Adapter/MSTest.PlatformServices/Extensions/TestCaseExtensions.cs similarity index 96% rename from src/Adapter/MSTestAdapter.PlatformServices/Extensions/TestCaseExtensions.cs rename to src/Adapter/MSTest.PlatformServices/Extensions/TestCaseExtensions.cs index 17dfdc277f..2340935d61 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Extensions/TestCaseExtensions.cs +++ b/src/Adapter/MSTest.PlatformServices/Extensions/TestCaseExtensions.cs @@ -2,12 +2,12 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.TestPlatform.AdapterUtilities; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions; +using MSTest.PlatformServices.ObjectModel; + +namespace MSTest.PlatformServices.Extensions; /// /// Extension Methods for TestCase Class. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Extensions/TestContextExtensions.cs b/src/Adapter/MSTest.PlatformServices/Extensions/TestContextExtensions.cs similarity index 81% rename from src/Adapter/MSTestAdapter.PlatformServices/Extensions/TestContextExtensions.cs rename to src/Adapter/MSTest.PlatformServices/Extensions/TestContextExtensions.cs index 5b97b61599..827ab517a8 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Extensions/TestContextExtensions.cs +++ b/src/Adapter/MSTest.PlatformServices/Extensions/TestContextExtensions.cs @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; +using MSTest.PlatformServices.Interface; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions; +namespace MSTest.PlatformServices.Extensions; internal static class TestContextExtensions { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Extensions/TestResultExtensions.cs b/src/Adapter/MSTest.PlatformServices/Extensions/TestResultExtensions.cs similarity index 94% rename from src/Adapter/MSTestAdapter.PlatformServices/Extensions/TestResultExtensions.cs rename to src/Adapter/MSTest.PlatformServices/Extensions/TestResultExtensions.cs index 01afe0677e..dd5280b07a 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Extensions/TestResultExtensions.cs +++ b/src/Adapter/MSTest.PlatformServices/Extensions/TestResultExtensions.cs @@ -1,21 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Extensions; using Microsoft.VisualStudio.TestTools.UnitTesting; -using UTF = Microsoft.VisualStudio.TestTools.UnitTesting; +using MSTest.PlatformServices.Helpers; +using MSTest.PlatformServices.ObjectModel; +using UTF = Microsoft.VisualStudio.TestTools.UnitTesting; using VSTestAttachmentSet = Microsoft.VisualStudio.TestPlatform.ObjectModel.AttachmentSet; using VSTestTestCase = Microsoft.VisualStudio.TestPlatform.ObjectModel.TestCase; using VSTestTestResult = Microsoft.VisualStudio.TestPlatform.ObjectModel.TestResult; using VSTestTestResultMessage = Microsoft.VisualStudio.TestPlatform.ObjectModel.TestResultMessage; using VSTestUriDataAttachment = Microsoft.VisualStudio.TestPlatform.ObjectModel.UriDataAttachment; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions; +namespace MSTest.PlatformServices.Extensions; /// /// Extension methods for TestResult. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Extensions/UnitTestOutcomeExtensions.cs b/src/Adapter/MSTest.PlatformServices/Extensions/UnitTestOutcomeExtensions.cs similarity index 93% rename from src/Adapter/MSTestAdapter.PlatformServices/Extensions/UnitTestOutcomeExtensions.cs rename to src/Adapter/MSTest.PlatformServices/Extensions/UnitTestOutcomeExtensions.cs index 111bcf16c6..4b3fc66072 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Extensions/UnitTestOutcomeExtensions.cs +++ b/src/Adapter/MSTest.PlatformServices/Extensions/UnitTestOutcomeExtensions.cs @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; +using MSTest.PlatformServices.ObjectModel; using UTF = Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions; +namespace MSTest.PlatformServices.Extensions; /// /// Extension methods for . diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/AttributeHelpers.cs b/src/Adapter/MSTest.PlatformServices/Helpers/AttributeHelpers.cs similarity index 95% rename from src/Adapter/MSTestAdapter.PlatformServices/Helpers/AttributeHelpers.cs rename to src/Adapter/MSTest.PlatformServices/Helpers/AttributeHelpers.cs index a2bbcbe98e..dd8d9b7c33 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/AttributeHelpers.cs +++ b/src/Adapter/MSTest.PlatformServices/Helpers/AttributeHelpers.cs @@ -3,7 +3,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; +namespace MSTest.PlatformServices.Helpers; internal static class AttributeExtensions { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/DataSerializationHelper.cs b/src/Adapter/MSTest.PlatformServices/Helpers/DataSerializationHelper.cs similarity index 98% rename from src/Adapter/MSTestAdapter.PlatformServices/Helpers/DataSerializationHelper.cs rename to src/Adapter/MSTest.PlatformServices/Helpers/DataSerializationHelper.cs index c7c980e9fd..37b7daa6d4 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/DataSerializationHelper.cs +++ b/src/Adapter/MSTest.PlatformServices/Helpers/DataSerializationHelper.cs @@ -8,7 +8,7 @@ using System.Runtime.Serialization; using System.Runtime.Serialization.Json; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; +namespace MSTest.PlatformServices.Helpers; internal static class DataSerializationHelper { @@ -16,7 +16,7 @@ internal static class DataSerializationHelper private static readonly DataContractJsonSerializerSettings SerializerSettings = new() { UseSimpleDictionaryFormat = true, - EmitTypeInformation = System.Runtime.Serialization.EmitTypeInformation.Always, + EmitTypeInformation = EmitTypeInformation.Always, DateTimeFormat = new DateTimeFormat("O", CultureInfo.InvariantCulture), #if NETFRAMEWORK DataContractSurrogate = SerializationSurrogateProvider.Instance, diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/DictionaryHelper.cs b/src/Adapter/MSTest.PlatformServices/Helpers/DictionaryHelper.cs similarity index 97% rename from src/Adapter/MSTestAdapter.PlatformServices/Helpers/DictionaryHelper.cs rename to src/Adapter/MSTest.PlatformServices/Helpers/DictionaryHelper.cs index 9608fdd26c..f577c22ba1 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/DictionaryHelper.cs +++ b/src/Adapter/MSTest.PlatformServices/Helpers/DictionaryHelper.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; +namespace MSTest.PlatformServices.Helpers; internal static class DictionaryHelper { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/ExecutionContextHelpers.cs b/src/Adapter/MSTest.PlatformServices/Helpers/ExecutionContextHelpers.cs similarity index 93% rename from src/Adapter/MSTestAdapter.PlatformServices/Helpers/ExecutionContextHelpers.cs rename to src/Adapter/MSTest.PlatformServices/Helpers/ExecutionContextHelpers.cs index bc45585b18..a5373b356a 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/ExecutionContextHelpers.cs +++ b/src/Adapter/MSTest.PlatformServices/Helpers/ExecutionContextHelpers.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; +namespace MSTest.PlatformServices.Helpers; internal static class ExecutionContextHelpers { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/FixtureKind.cs b/src/Adapter/MSTest.PlatformServices/Helpers/FixtureKind.cs similarity index 86% rename from src/Adapter/MSTestAdapter.PlatformServices/Helpers/FixtureKind.cs rename to src/Adapter/MSTest.PlatformServices/Helpers/FixtureKind.cs index 7258055724..458c8a724b 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/FixtureKind.cs +++ b/src/Adapter/MSTest.PlatformServices/Helpers/FixtureKind.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; +namespace MSTest.PlatformServices.Helpers; [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1602:Enumeration items should be documented", Justification = "Internal and self-explanatory")] internal enum FixtureKind diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/FixtureMethodRunner.cs b/src/Adapter/MSTest.PlatformServices/Helpers/FixtureMethodRunner.cs similarity index 97% rename from src/Adapter/MSTestAdapter.PlatformServices/Helpers/FixtureMethodRunner.cs rename to src/Adapter/MSTest.PlatformServices/Helpers/FixtureMethodRunner.cs index 5feb0ce26b..e653028fa3 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/FixtureMethodRunner.cs +++ b/src/Adapter/MSTest.PlatformServices/Helpers/FixtureMethodRunner.cs @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Extensions; +using MSTest.PlatformServices.Execution; +using MSTest.PlatformServices.Extensions; +using MSTest.PlatformServices.ObjectModel; using UnitTestOutcome = Microsoft.VisualStudio.TestTools.UnitTesting.UnitTestOutcome; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; +namespace MSTest.PlatformServices.Helpers; internal static class FixtureMethodRunner { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/ReflectHelper.cs b/src/Adapter/MSTest.PlatformServices/Helpers/ReflectHelper.cs similarity index 99% rename from src/Adapter/MSTestAdapter.PlatformServices/Helpers/ReflectHelper.cs rename to src/Adapter/MSTest.PlatformServices/Helpers/ReflectHelper.cs index c5a10c4044..32d7ec6f13 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/ReflectHelper.cs +++ b/src/Adapter/MSTest.PlatformServices/Helpers/ReflectHelper.cs @@ -6,7 +6,7 @@ using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; +namespace MSTest.PlatformServices.Helpers; [SuppressMessage("Performance", "CA1852: Seal internal types", Justification = "Overrides required for mocking")] internal class ReflectHelper : MarshalByRefObject diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/RunSettingsUtilities.cs b/src/Adapter/MSTest.PlatformServices/Helpers/RunSettingsUtilities.cs similarity index 94% rename from src/Adapter/MSTestAdapter.PlatformServices/Helpers/RunSettingsUtilities.cs rename to src/Adapter/MSTest.PlatformServices/Helpers/RunSettingsUtilities.cs index e4a457b0cc..0f86127929 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/RunSettingsUtilities.cs +++ b/src/Adapter/MSTest.PlatformServices/Helpers/RunSettingsUtilities.cs @@ -5,7 +5,7 @@ using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; +namespace MSTest.PlatformServices.Helpers; internal static class RunSettingsUtilities { @@ -41,7 +41,7 @@ internal static void ThrowOnHasAttributes(XmlReader reader) string.Format( CultureInfo.CurrentCulture, Resource.InvalidSettingsXmlAttribute, - TestPlatform.ObjectModel.Constants.RunConfigurationSettingsName, + Constants.RunConfigurationSettingsName, reader.Name)); } } diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/RuntimeContext.cs b/src/Adapter/MSTest.PlatformServices/Helpers/RuntimeContext.cs similarity index 89% rename from src/Adapter/MSTestAdapter.PlatformServices/Helpers/RuntimeContext.cs rename to src/Adapter/MSTest.PlatformServices/Helpers/RuntimeContext.cs index ddb0a272bf..e717597f40 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/RuntimeContext.cs +++ b/src/Adapter/MSTest.PlatformServices/Helpers/RuntimeContext.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; +namespace MSTest.PlatformServices.Helpers; internal static class RuntimeContext { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/TestDataSourceHelpers.cs b/src/Adapter/MSTest.PlatformServices/Helpers/TestDataSourceHelpers.cs similarity index 98% rename from src/Adapter/MSTestAdapter.PlatformServices/Helpers/TestDataSourceHelpers.cs rename to src/Adapter/MSTest.PlatformServices/Helpers/TestDataSourceHelpers.cs index 4f3e0b614a..f1e957909e 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/TestDataSourceHelpers.cs +++ b/src/Adapter/MSTest.PlatformServices/Helpers/TestDataSourceHelpers.cs @@ -3,7 +3,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; +namespace MSTest.PlatformServices.Helpers; internal static class TestDataSourceHelpers { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/TestRunParameters.cs b/src/Adapter/MSTest.PlatformServices/Helpers/TestRunParameters.cs similarity index 96% rename from src/Adapter/MSTestAdapter.PlatformServices/Helpers/TestRunParameters.cs rename to src/Adapter/MSTest.PlatformServices/Helpers/TestRunParameters.cs index 9a324be172..a06eeab367 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/TestRunParameters.cs +++ b/src/Adapter/MSTest.PlatformServices/Helpers/TestRunParameters.cs @@ -3,7 +3,7 @@ using Microsoft.VisualStudio.TestPlatform.ObjectModel; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; +namespace MSTest.PlatformServices.Helpers; internal static class TestRunParameters { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/UnitTestOutcomeHelper.cs b/src/Adapter/MSTest.PlatformServices/Helpers/UnitTestOutcomeHelper.cs similarity index 95% rename from src/Adapter/MSTestAdapter.PlatformServices/Helpers/UnitTestOutcomeHelper.cs rename to src/Adapter/MSTest.PlatformServices/Helpers/UnitTestOutcomeHelper.cs index 7582c02fe2..435cddfe89 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/UnitTestOutcomeHelper.cs +++ b/src/Adapter/MSTest.PlatformServices/Helpers/UnitTestOutcomeHelper.cs @@ -5,7 +5,7 @@ using UTF = Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; +namespace MSTest.PlatformServices.Helpers; internal static class UnitTestOutcomeHelper { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/IPlatformServiceProvider.cs b/src/Adapter/MSTest.PlatformServices/IPlatformServiceProvider.cs similarity index 89% rename from src/Adapter/MSTestAdapter.PlatformServices/IPlatformServiceProvider.cs rename to src/Adapter/MSTest.PlatformServices/IPlatformServiceProvider.cs index 0fefda4afd..e22edfd86c 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/IPlatformServiceProvider.cs +++ b/src/Adapter/MSTest.PlatformServices/IPlatformServiceProvider.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.ObjectModel; +using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; +using MSTest.PlatformServices.Execution; +using MSTest.PlatformServices.Interface; +using MSTest.PlatformServices.Interface.ObjectModel; + +using ISettingsProvider = MSTest.PlatformServices.Interface.ISettingsProvider; using UTF = Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; +namespace MSTest.PlatformServices; /// /// The definition of a PlatformServiceProvider with a hook to all the services. @@ -76,8 +80,8 @@ internal interface IPlatformServiceProvider /// ITestSourceHost CreateTestSourceHost( string source, - TestPlatform.ObjectModel.Adapter.IRunSettings? runSettings, - TestPlatform.ObjectModel.Adapter.IFrameworkHandle? frameworkHandle); + IRunSettings? runSettings, + IFrameworkHandle? frameworkHandle); /// /// Gets the TestContext object for a platform. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/IAdapterTraceLogger.cs b/src/Adapter/MSTest.PlatformServices/Interfaces/IAdapterTraceLogger.cs similarity index 93% rename from src/Adapter/MSTestAdapter.PlatformServices/Interfaces/IAdapterTraceLogger.cs rename to src/Adapter/MSTest.PlatformServices/Interfaces/IAdapterTraceLogger.cs index db42f2708e..3f12b4b1da 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/IAdapterTraceLogger.cs +++ b/src/Adapter/MSTest.PlatformServices/Interfaces/IAdapterTraceLogger.cs @@ -2,7 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. #pragma warning disable CA1716 // Do not use reserved keywords -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; +namespace MSTest.PlatformServices.Interface; #pragma warning restore CA1716 // Do not use reserved keywords /// diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/IConfiguration.cs b/src/Adapter/MSTest.PlatformServices/Interfaces/IConfiguration.cs similarity index 86% rename from src/Adapter/MSTestAdapter.PlatformServices/Interfaces/IConfiguration.cs rename to src/Adapter/MSTest.PlatformServices/Interfaces/IConfiguration.cs index 0630e03f79..d64f4b66ba 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/IConfiguration.cs +++ b/src/Adapter/MSTest.PlatformServices/Interfaces/IConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; +namespace MSTest.PlatformServices.Interface; /// /// Represents a configuration interface. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/IFileOperations.cs b/src/Adapter/MSTest.PlatformServices/Interfaces/IFileOperations.cs similarity index 94% rename from src/Adapter/MSTestAdapter.PlatformServices/Interfaces/IFileOperations.cs rename to src/Adapter/MSTest.PlatformServices/Interfaces/IFileOperations.cs index 4cd6561417..0018dacec5 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/IFileOperations.cs +++ b/src/Adapter/MSTest.PlatformServices/Interfaces/IFileOperations.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; +namespace MSTest.PlatformServices.Interface; /// /// This service is responsible for any file based operations. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/IReflectionOperations.cs b/src/Adapter/MSTest.PlatformServices/Interfaces/IReflectionOperations.cs similarity index 94% rename from src/Adapter/MSTestAdapter.PlatformServices/Interfaces/IReflectionOperations.cs rename to src/Adapter/MSTest.PlatformServices/Interfaces/IReflectionOperations.cs index dc5f77808b..c160faa17f 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/IReflectionOperations.cs +++ b/src/Adapter/MSTest.PlatformServices/Interfaces/IReflectionOperations.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; +namespace MSTest.PlatformServices.Interface; /// /// This service is responsible for platform specific reflection operations. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/IReflectionOperations2.cs b/src/Adapter/MSTest.PlatformServices/Interfaces/IReflectionOperations2.cs similarity index 92% rename from src/Adapter/MSTestAdapter.PlatformServices/Interfaces/IReflectionOperations2.cs rename to src/Adapter/MSTest.PlatformServices/Interfaces/IReflectionOperations2.cs index f7fc969270..07450af4ee 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/IReflectionOperations2.cs +++ b/src/Adapter/MSTest.PlatformServices/Interfaces/IReflectionOperations2.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; +namespace MSTest.PlatformServices.Interface; internal interface IReflectionOperations2 : IReflectionOperations { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/ISettingsProvider.cs b/src/Adapter/MSTest.PlatformServices/Interfaces/ISettingsProvider.cs similarity index 92% rename from src/Adapter/MSTestAdapter.PlatformServices/Interfaces/ISettingsProvider.cs rename to src/Adapter/MSTest.PlatformServices/Interfaces/ISettingsProvider.cs index c07464577e..5d5bb4c8c7 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/ISettingsProvider.cs +++ b/src/Adapter/MSTest.PlatformServices/Interfaces/ISettingsProvider.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; +namespace MSTest.PlatformServices.Interface; /// /// To read settings from the runsettings xml for the corresponding platform service. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/ITestContext.cs b/src/Adapter/MSTest.PlatformServices/Interfaces/ITestContext.cs similarity index 97% rename from src/Adapter/MSTestAdapter.PlatformServices/Interfaces/ITestContext.cs rename to src/Adapter/MSTest.PlatformServices/Interfaces/ITestContext.cs index efb621b6e5..97ff07cde7 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/ITestContext.cs +++ b/src/Adapter/MSTest.PlatformServices/Interfaces/ITestContext.cs @@ -3,7 +3,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; +namespace MSTest.PlatformServices.Interface; /// /// Operations on the TestContext object that is implemented differently for each platform. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/ITestDataSource.cs b/src/Adapter/MSTest.PlatformServices/Interfaces/ITestDataSource.cs similarity index 90% rename from src/Adapter/MSTestAdapter.PlatformServices/Interfaces/ITestDataSource.cs rename to src/Adapter/MSTest.PlatformServices/Interfaces/ITestDataSource.cs index b39c269722..c6ff35f982 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/ITestDataSource.cs +++ b/src/Adapter/MSTest.PlatformServices/Interfaces/ITestDataSource.cs @@ -3,7 +3,7 @@ using UTF = Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; +namespace MSTest.PlatformServices.Interface; /// /// Interface that provides values from data source when data driven tests are run. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/ITestDeployment.cs b/src/Adapter/MSTest.PlatformServices/Interfaces/ITestDeployment.cs similarity index 94% rename from src/Adapter/MSTestAdapter.PlatformServices/Interfaces/ITestDeployment.cs rename to src/Adapter/MSTest.PlatformServices/Interfaces/ITestDeployment.cs index f5e3aa1460..c2ed59671b 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/ITestDeployment.cs +++ b/src/Adapter/MSTest.PlatformServices/Interfaces/ITestDeployment.cs @@ -4,7 +4,7 @@ using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; +namespace MSTest.PlatformServices.Interface; /// /// The TestDeployment interface. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/ITestSourceHandler.cs b/src/Adapter/MSTest.PlatformServices/Interfaces/ITestSourceHandler.cs similarity index 93% rename from src/Adapter/MSTestAdapter.PlatformServices/Interfaces/ITestSourceHandler.cs rename to src/Adapter/MSTest.PlatformServices/Interfaces/ITestSourceHandler.cs index 3c1c86cb61..bb13df556a 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/ITestSourceHandler.cs +++ b/src/Adapter/MSTest.PlatformServices/Interfaces/ITestSourceHandler.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; +namespace MSTest.PlatformServices.Interface; /// /// This platform service is responsible for any data or operations to validate diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/ITestSourceHost.cs b/src/Adapter/MSTest.PlatformServices/Interfaces/ITestSourceHost.cs similarity index 93% rename from src/Adapter/MSTestAdapter.PlatformServices/Interfaces/ITestSourceHost.cs rename to src/Adapter/MSTest.PlatformServices/Interfaces/ITestSourceHost.cs index 85e13570f0..75dc310718 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/ITestSourceHost.cs +++ b/src/Adapter/MSTest.PlatformServices/Interfaces/ITestSourceHost.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; +namespace MSTest.PlatformServices.Interface; /// /// A host that loads the test source.This can be in isolation for desktop using an AppDomain or just loading the source in the current context. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/IThreadOperations.cs b/src/Adapter/MSTest.PlatformServices/Interfaces/IThreadOperations.cs similarity index 90% rename from src/Adapter/MSTestAdapter.PlatformServices/Interfaces/IThreadOperations.cs rename to src/Adapter/MSTest.PlatformServices/Interfaces/IThreadOperations.cs index b31bf4bdce..ea51e5a783 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/IThreadOperations.cs +++ b/src/Adapter/MSTest.PlatformServices/Interfaces/IThreadOperations.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; +namespace MSTest.PlatformServices.Interface; /// /// This service is responsible for any thread operations specific to a platform. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/ObjectModel/ITestMethod.cs b/src/Adapter/MSTest.PlatformServices/Interfaces/ObjectModel/ITestMethod.cs similarity index 95% rename from src/Adapter/MSTestAdapter.PlatformServices/Interfaces/ObjectModel/ITestMethod.cs rename to src/Adapter/MSTest.PlatformServices/Interfaces/ObjectModel/ITestMethod.cs index e20cc45d5a..42752b7fa9 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Interfaces/ObjectModel/ITestMethod.cs +++ b/src/Adapter/MSTest.PlatformServices/Interfaces/ObjectModel/ITestMethod.cs @@ -2,7 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. #pragma warning disable CA1716 // Do not use reserved keywords -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.ObjectModel; +namespace MSTest.PlatformServices.Interface.ObjectModel; #pragma warning restore CA1716 // Do not use reserved keywords /// diff --git a/src/Adapter/MSTestAdapter.PlatformServices/MSTestAdapter.PlatformServices.csproj b/src/Adapter/MSTest.PlatformServices/MSTest.PlatformServices.csproj similarity index 87% rename from src/Adapter/MSTestAdapter.PlatformServices/MSTestAdapter.PlatformServices.csproj rename to src/Adapter/MSTest.PlatformServices/MSTest.PlatformServices.csproj index 390d6afe16..66f44cc2de 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/MSTestAdapter.PlatformServices.csproj +++ b/src/Adapter/MSTest.PlatformServices/MSTest.PlatformServices.csproj @@ -10,7 +10,7 @@ - Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices + MSTest.PlatformServices $(DefineConstants);TRACE true @@ -41,9 +41,9 @@ - - - + + + diff --git a/src/Adapter/MSTestAdapter.PlatformServices/MSTestSettings.cs b/src/Adapter/MSTest.PlatformServices/MSTestSettings.cs similarity index 99% rename from src/Adapter/MSTestAdapter.PlatformServices/MSTestSettings.cs rename to src/Adapter/MSTest.PlatformServices/MSTestSettings.cs index e0653929b7..075556e5bb 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/MSTestSettings.cs +++ b/src/Adapter/MSTest.PlatformServices/MSTestSettings.cs @@ -1,19 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -#if !WINDOWS_UWP -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -#endif -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities; using Microsoft.VisualStudio.TestTools.UnitTesting; +using MSTest.PlatformServices.Interface; +using MSTest.PlatformServices.ObjectModel; + using ExecutionScope = Microsoft.VisualStudio.TestTools.UnitTesting.ExecutionScope; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; +namespace MSTest.PlatformServices; /// /// Adapter Settings for the run. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/AdapterSettingsException.cs b/src/Adapter/MSTest.PlatformServices/ObjectModel/AdapterSettingsException.cs similarity index 80% rename from src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/AdapterSettingsException.cs rename to src/Adapter/MSTest.PlatformServices/ObjectModel/AdapterSettingsException.cs index 1942c45c2a..342f6f5cd0 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/AdapterSettingsException.cs +++ b/src/Adapter/MSTest.PlatformServices/ObjectModel/AdapterSettingsException.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; +namespace MSTest.PlatformServices.ObjectModel; internal sealed class AdapterSettingsException : Exception { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/DynamicDataType.cs b/src/Adapter/MSTest.PlatformServices/ObjectModel/DynamicDataType.cs similarity index 72% rename from src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/DynamicDataType.cs rename to src/Adapter/MSTest.PlatformServices/ObjectModel/DynamicDataType.cs index 6046f3dfd8..16c567c7bd 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/DynamicDataType.cs +++ b/src/Adapter/MSTest.PlatformServices/ObjectModel/DynamicDataType.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; +namespace MSTest.PlatformServices.ObjectModel; /// /// The kind of dynamic data. @@ -14,7 +14,7 @@ internal enum DynamicDataType : int None = 0, /// - /// Dynamic data from . + /// Dynamic data from . /// ITestDataSource = 1, } diff --git a/src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/FixtureTestResult.cs b/src/Adapter/MSTest.PlatformServices/ObjectModel/FixtureTestResult.cs similarity index 90% rename from src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/FixtureTestResult.cs rename to src/Adapter/MSTest.PlatformServices/ObjectModel/FixtureTestResult.cs index 82c137cd72..9c04d4752c 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/FixtureTestResult.cs +++ b/src/Adapter/MSTest.PlatformServices/ObjectModel/FixtureTestResult.cs @@ -3,7 +3,7 @@ using UTF = Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; +namespace MSTest.PlatformServices.ObjectModel; [Serializable] internal readonly struct FixtureTestResult diff --git a/src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/StackTraceInformation.cs b/src/Adapter/MSTest.PlatformServices/ObjectModel/StackTraceInformation.cs similarity index 95% rename from src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/StackTraceInformation.cs rename to src/Adapter/MSTest.PlatformServices/ObjectModel/StackTraceInformation.cs index 43923ec246..484be1f602 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/StackTraceInformation.cs +++ b/src/Adapter/MSTest.PlatformServices/ObjectModel/StackTraceInformation.cs @@ -3,7 +3,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; +namespace MSTest.PlatformServices.ObjectModel; [Serializable] internal sealed class StackTraceInformation diff --git a/src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/TestAssemblySettings.cs b/src/Adapter/MSTest.PlatformServices/ObjectModel/TestAssemblySettings.cs similarity index 91% rename from src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/TestAssemblySettings.cs rename to src/Adapter/MSTest.PlatformServices/ObjectModel/TestAssemblySettings.cs index e376c5f04c..e161ef73f0 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/TestAssemblySettings.cs +++ b/src/Adapter/MSTest.PlatformServices/ObjectModel/TestAssemblySettings.cs @@ -3,7 +3,7 @@ using ExecutionScope = Microsoft.VisualStudio.TestTools.UnitTesting.ExecutionScope; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; +namespace MSTest.PlatformServices.ObjectModel; [Serializable] internal sealed class TestAssemblySettings diff --git a/src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/TestFailedException.cs b/src/Adapter/MSTest.PlatformServices/ObjectModel/TestFailedException.cs similarity index 95% rename from src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/TestFailedException.cs rename to src/Adapter/MSTest.PlatformServices/ObjectModel/TestFailedException.cs index 965723b4c9..e0a4164b7f 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/TestFailedException.cs +++ b/src/Adapter/MSTest.PlatformServices/ObjectModel/TestFailedException.cs @@ -5,7 +5,7 @@ using UTF = Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; +namespace MSTest.PlatformServices.ObjectModel; /// /// Internal class to indicate Test Execution failure. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/TestMethod.cs b/src/Adapter/MSTest.PlatformServices/ObjectModel/TestMethod.cs similarity index 96% rename from src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/TestMethod.cs rename to src/Adapter/MSTest.PlatformServices/ObjectModel/TestMethod.cs index 81b3bdea53..5bfb9d683c 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/TestMethod.cs +++ b/src/Adapter/MSTest.PlatformServices/ObjectModel/TestMethod.cs @@ -6,9 +6,9 @@ using Microsoft.TestPlatform.AdapterUtilities; using Microsoft.VisualStudio.TestTools.UnitTesting; -using ITestMethod = Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.ObjectModel.ITestMethod; +using ITestMethod = MSTest.PlatformServices.Interface.ObjectModel.ITestMethod; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; +namespace MSTest.PlatformServices.ObjectModel; /// /// TestMethod contains information about a unit test method that needs to be executed. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/TypeInspectionException.cs b/src/Adapter/MSTest.PlatformServices/ObjectModel/TypeInspectionException.cs similarity index 88% rename from src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/TypeInspectionException.cs rename to src/Adapter/MSTest.PlatformServices/ObjectModel/TypeInspectionException.cs index 0e13ffe8e9..7c2b637092 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/TypeInspectionException.cs +++ b/src/Adapter/MSTest.PlatformServices/ObjectModel/TypeInspectionException.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; +namespace MSTest.PlatformServices.ObjectModel; /// /// Internal class to indicate type inspection failure. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/UnitTestElement.cs b/src/Adapter/MSTest.PlatformServices/ObjectModel/UnitTestElement.cs similarity index 97% rename from src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/UnitTestElement.cs rename to src/Adapter/MSTest.PlatformServices/ObjectModel/UnitTestElement.cs index 849ccdd19f..eb1e5134c8 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/UnitTestElement.cs +++ b/src/Adapter/MSTest.PlatformServices/ObjectModel/UnitTestElement.cs @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; +using MSTest.PlatformServices.Extensions; + +namespace MSTest.PlatformServices.ObjectModel; /// /// The unit test element. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/UnitTestOutcome.cs b/src/Adapter/MSTest.PlatformServices/ObjectModel/UnitTestOutcome.cs similarity index 94% rename from src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/UnitTestOutcome.cs rename to src/Adapter/MSTest.PlatformServices/ObjectModel/UnitTestOutcome.cs index 9f769fe0bb..12b7dcff02 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/UnitTestOutcome.cs +++ b/src/Adapter/MSTest.PlatformServices/ObjectModel/UnitTestOutcome.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; +namespace MSTest.PlatformServices.ObjectModel; /// /// Outcome of a test. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/UnitTestResult.cs b/src/Adapter/MSTest.PlatformServices/ObjectModel/UnitTestResult.cs similarity index 96% rename from src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/UnitTestResult.cs rename to src/Adapter/MSTest.PlatformServices/ObjectModel/UnitTestResult.cs index 48cb0d3121..c9faa33ee6 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/UnitTestResult.cs +++ b/src/Adapter/MSTest.PlatformServices/ObjectModel/UnitTestResult.cs @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions; +using MSTest.PlatformServices.Extensions; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; +namespace MSTest.PlatformServices.ObjectModel; /// /// Represents the result of a unit test. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/PlatformServiceProvider.cs b/src/Adapter/MSTest.PlatformServices/PlatformServiceProvider.cs similarity index 91% rename from src/Adapter/MSTestAdapter.PlatformServices/PlatformServiceProvider.cs rename to src/Adapter/MSTest.PlatformServices/PlatformServiceProvider.cs index 0dbee53d5b..48263b3b77 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/PlatformServiceProvider.cs +++ b/src/Adapter/MSTest.PlatformServices/PlatformServiceProvider.cs @@ -1,14 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.ObjectModel; +using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; +using MSTest.PlatformServices.Execution; +using MSTest.PlatformServices.Interface; +using MSTest.PlatformServices.Interface.ObjectModel; + +using ISettingsProvider = MSTest.PlatformServices.Interface.ISettingsProvider; using UTF = Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; +namespace MSTest.PlatformServices; /// /// The main service provider class that exposes all the platform services available. @@ -138,8 +141,8 @@ internal static IPlatformServiceProvider Instance /// public ITestSourceHost CreateTestSourceHost( string source, - TestPlatform.ObjectModel.Adapter.IRunSettings? runSettings, - TestPlatform.ObjectModel.Adapter.IFrameworkHandle? frameworkHandle) + IRunSettings? runSettings, + IFrameworkHandle? frameworkHandle) { var testSourceHost = new TestSourceHost(source, runSettings, frameworkHandle); testSourceHost.SetupHost(); diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/Polyfills/EmbeddedAttribute.cs b/src/Adapter/MSTest.PlatformServices/Polyfills/EmbeddedAttribute.cs similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/Execution/Polyfills/EmbeddedAttribute.cs rename to src/Adapter/MSTest.PlatformServices/Polyfills/EmbeddedAttribute.cs diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/Polyfills/OSPlatform.cs b/src/Adapter/MSTest.PlatformServices/Polyfills/OSPlatform.cs similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/Execution/Polyfills/OSPlatform.cs rename to src/Adapter/MSTest.PlatformServices/Polyfills/OSPlatform.cs diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/Polyfills/RuntimeInformation.cs b/src/Adapter/MSTest.PlatformServices/Polyfills/RuntimeInformation.cs similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/Execution/Polyfills/RuntimeInformation.cs rename to src/Adapter/MSTest.PlatformServices/Polyfills/RuntimeInformation.cs diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/Polyfills/TupleElementNamesAttribute.cs b/src/Adapter/MSTest.PlatformServices/Polyfills/TupleElementNamesAttribute.cs similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/Execution/Polyfills/TupleElementNamesAttribute.cs rename to src/Adapter/MSTest.PlatformServices/Polyfills/TupleElementNamesAttribute.cs diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/Polyfills/ValueTuple`2.cs b/src/Adapter/MSTest.PlatformServices/Polyfills/ValueTuple`2.cs similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/Execution/Polyfills/ValueTuple`2.cs rename to src/Adapter/MSTest.PlatformServices/Polyfills/ValueTuple`2.cs diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Properties/AssemblyInfo.cs b/src/Adapter/MSTest.PlatformServices/Properties/AssemblyInfo.cs similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/Properties/AssemblyInfo.cs rename to src/Adapter/MSTest.PlatformServices/Properties/AssemblyInfo.cs diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Properties/ProviderService.UAP.rd.xml b/src/Adapter/MSTest.PlatformServices/Properties/ProviderService.UAP.rd.xml similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/Properties/ProviderService.UAP.rd.xml rename to src/Adapter/MSTest.PlatformServices/Properties/ProviderService.UAP.rd.xml diff --git a/src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/PublicAPI.Shipped.txt b/src/Adapter/MSTest.PlatformServices/PublicAPI/PublicAPI.Shipped.txt similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/PublicAPI.Shipped.txt rename to src/Adapter/MSTest.PlatformServices/PublicAPI/PublicAPI.Shipped.txt diff --git a/src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/PublicAPI.Unshipped.txt b/src/Adapter/MSTest.PlatformServices/PublicAPI/PublicAPI.Unshipped.txt similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/PublicAPI.Unshipped.txt rename to src/Adapter/MSTest.PlatformServices/PublicAPI/PublicAPI.Unshipped.txt diff --git a/src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/net462/PublicAPI.Shipped.txt b/src/Adapter/MSTest.PlatformServices/PublicAPI/net462/PublicAPI.Shipped.txt similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/net462/PublicAPI.Shipped.txt rename to src/Adapter/MSTest.PlatformServices/PublicAPI/net462/PublicAPI.Shipped.txt diff --git a/src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/net462/PublicAPI.Unshipped.txt b/src/Adapter/MSTest.PlatformServices/PublicAPI/net462/PublicAPI.Unshipped.txt similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/net462/PublicAPI.Unshipped.txt rename to src/Adapter/MSTest.PlatformServices/PublicAPI/net462/PublicAPI.Unshipped.txt diff --git a/src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/net8.0-windows10.0.18362.0/PublicAPI.Shipped.txt b/src/Adapter/MSTest.PlatformServices/PublicAPI/net8.0-windows10.0.18362.0/PublicAPI.Shipped.txt similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/net8.0-windows10.0.18362.0/PublicAPI.Shipped.txt rename to src/Adapter/MSTest.PlatformServices/PublicAPI/net8.0-windows10.0.18362.0/PublicAPI.Shipped.txt diff --git a/src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/net8.0-windows10.0.18362.0/PublicAPI.Unshipped.txt b/src/Adapter/MSTest.PlatformServices/PublicAPI/net8.0-windows10.0.18362.0/PublicAPI.Unshipped.txt similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/net8.0-windows10.0.18362.0/PublicAPI.Unshipped.txt rename to src/Adapter/MSTest.PlatformServices/PublicAPI/net8.0-windows10.0.18362.0/PublicAPI.Unshipped.txt diff --git a/src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/net8.0/PublicAPI.Shipped.txt b/src/Adapter/MSTest.PlatformServices/PublicAPI/net8.0/PublicAPI.Shipped.txt similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/net8.0/PublicAPI.Shipped.txt rename to src/Adapter/MSTest.PlatformServices/PublicAPI/net8.0/PublicAPI.Shipped.txt diff --git a/src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/net8.0/PublicAPI.Unshipped.txt b/src/Adapter/MSTest.PlatformServices/PublicAPI/net8.0/PublicAPI.Unshipped.txt similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/net8.0/PublicAPI.Unshipped.txt rename to src/Adapter/MSTest.PlatformServices/PublicAPI/net8.0/PublicAPI.Unshipped.txt diff --git a/src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/net9.0-windows10.0.17763.0/PublicAPI.Shipped.txt b/src/Adapter/MSTest.PlatformServices/PublicAPI/net9.0-windows10.0.17763.0/PublicAPI.Shipped.txt similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/net9.0-windows10.0.17763.0/PublicAPI.Shipped.txt rename to src/Adapter/MSTest.PlatformServices/PublicAPI/net9.0-windows10.0.17763.0/PublicAPI.Shipped.txt diff --git a/src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/net9.0-windows10.0.17763.0/PublicAPI.Unshipped.txt b/src/Adapter/MSTest.PlatformServices/PublicAPI/net9.0-windows10.0.17763.0/PublicAPI.Unshipped.txt similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/net9.0-windows10.0.17763.0/PublicAPI.Unshipped.txt rename to src/Adapter/MSTest.PlatformServices/PublicAPI/net9.0-windows10.0.17763.0/PublicAPI.Unshipped.txt diff --git a/src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/net9.0/PublicAPI.Shipped.txt b/src/Adapter/MSTest.PlatformServices/PublicAPI/net9.0/PublicAPI.Shipped.txt similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/net9.0/PublicAPI.Shipped.txt rename to src/Adapter/MSTest.PlatformServices/PublicAPI/net9.0/PublicAPI.Shipped.txt diff --git a/src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/net9.0/PublicAPI.Unshipped.txt b/src/Adapter/MSTest.PlatformServices/PublicAPI/net9.0/PublicAPI.Unshipped.txt similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/net9.0/PublicAPI.Unshipped.txt rename to src/Adapter/MSTest.PlatformServices/PublicAPI/net9.0/PublicAPI.Unshipped.txt diff --git a/src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/netstandard2.0/PublicAPI.Shipped.txt b/src/Adapter/MSTest.PlatformServices/PublicAPI/netstandard2.0/PublicAPI.Shipped.txt similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/netstandard2.0/PublicAPI.Shipped.txt rename to src/Adapter/MSTest.PlatformServices/PublicAPI/netstandard2.0/PublicAPI.Shipped.txt diff --git a/src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt b/src/Adapter/MSTest.PlatformServices/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt rename to src/Adapter/MSTest.PlatformServices/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt diff --git a/src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/uap10.0.16299/PublicAPI.Shipped.txt b/src/Adapter/MSTest.PlatformServices/PublicAPI/uap10.0.16299/PublicAPI.Shipped.txt similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/uap10.0.16299/PublicAPI.Shipped.txt rename to src/Adapter/MSTest.PlatformServices/PublicAPI/uap10.0.16299/PublicAPI.Shipped.txt diff --git a/src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/uap10.0.16299/PublicAPI.Unshipped.txt b/src/Adapter/MSTest.PlatformServices/PublicAPI/uap10.0.16299/PublicAPI.Unshipped.txt similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/PublicAPI/uap10.0.16299/PublicAPI.Unshipped.txt rename to src/Adapter/MSTest.PlatformServices/PublicAPI/uap10.0.16299/PublicAPI.Unshipped.txt diff --git a/src/Adapter/MSTestAdapter.PlatformServices/RecursiveDirectoryPath.cs b/src/Adapter/MSTest.PlatformServices/RecursiveDirectoryPath.cs similarity index 96% rename from src/Adapter/MSTestAdapter.PlatformServices/RecursiveDirectoryPath.cs rename to src/Adapter/MSTest.PlatformServices/RecursiveDirectoryPath.cs index 2e10aad852..a05fe64adf 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/RecursiveDirectoryPath.cs +++ b/src/Adapter/MSTest.PlatformServices/RecursiveDirectoryPath.cs @@ -4,7 +4,7 @@ #if !WINDOWS_UWP using System.Security; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; +namespace MSTest.PlatformServices; /// /// MSTest settings in runsettings look like this diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Resources/Resource.resx b/src/Adapter/MSTest.PlatformServices/Resources/Resource.resx similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/Resources/Resource.resx rename to src/Adapter/MSTest.PlatformServices/Resources/Resource.resx diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.cs.xlf b/src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.cs.xlf similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.cs.xlf rename to src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.cs.xlf diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.de.xlf b/src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.de.xlf similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.de.xlf rename to src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.de.xlf diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.es.xlf b/src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.es.xlf similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.es.xlf rename to src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.es.xlf diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.fr.xlf b/src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.fr.xlf similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.fr.xlf rename to src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.fr.xlf diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.it.xlf b/src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.it.xlf similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.it.xlf rename to src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.it.xlf diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.ja.xlf b/src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.ja.xlf similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.ja.xlf rename to src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.ja.xlf diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.ko.xlf b/src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.ko.xlf similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.ko.xlf rename to src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.ko.xlf diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.pl.xlf b/src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.pl.xlf similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.pl.xlf rename to src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.pl.xlf diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.pt-BR.xlf b/src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.pt-BR.xlf similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.pt-BR.xlf rename to src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.pt-BR.xlf diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.ru.xlf b/src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.ru.xlf similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.ru.xlf rename to src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.ru.xlf diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.tr.xlf b/src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.tr.xlf similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.tr.xlf rename to src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.tr.xlf diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.zh-Hans.xlf b/src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.zh-Hans.xlf similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.zh-Hans.xlf rename to src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.zh-Hans.xlf diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.zh-Hant.xlf b/src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.zh-Hant.xlf similarity index 100% rename from src/Adapter/MSTestAdapter.PlatformServices/Resources/xlf/Resource.zh-Hant.xlf rename to src/Adapter/MSTest.PlatformServices/Resources/xlf/Resource.zh-Hant.xlf diff --git a/src/Adapter/MSTestAdapter.PlatformServices/RunConfigurationSettings.cs b/src/Adapter/MSTest.PlatformServices/RunConfigurationSettings.cs similarity index 97% rename from src/Adapter/MSTestAdapter.PlatformServices/RunConfigurationSettings.cs rename to src/Adapter/MSTest.PlatformServices/RunConfigurationSettings.cs index 964b5e0da9..5a7d409fd7 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/RunConfigurationSettings.cs +++ b/src/Adapter/MSTest.PlatformServices/RunConfigurationSettings.cs @@ -2,13 +2,13 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. #if !WINDOWS_UWP -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; +using MSTest.PlatformServices.Interface; #endif using Microsoft.VisualStudio.TestPlatform.PlatformAbstractions; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; +namespace MSTest.PlatformServices; /// /// The run configuration settings. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Services/FileOperations.cs b/src/Adapter/MSTest.PlatformServices/Services/FileOperations.cs similarity index 95% rename from src/Adapter/MSTestAdapter.PlatformServices/Services/FileOperations.cs rename to src/Adapter/MSTest.PlatformServices/Services/FileOperations.cs index 20d7c87d8c..1a73d436b2 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Services/FileOperations.cs +++ b/src/Adapter/MSTest.PlatformServices/Services/FileOperations.cs @@ -2,15 +2,16 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. #if WIN_UI -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.AppContainer; +using MSTest.PlatformServices.AppContainer; #endif -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; +using MSTest.PlatformServices.Interface; + #if NETFRAMEWORK using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestTools.UnitTesting; #endif -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; +namespace MSTest.PlatformServices; /// /// The file operations. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Services/MSTestAdapterSettings.cs b/src/Adapter/MSTest.PlatformServices/Services/MSTestAdapterSettings.cs similarity index 98% rename from src/Adapter/MSTestAdapter.PlatformServices/Services/MSTestAdapterSettings.cs rename to src/Adapter/MSTest.PlatformServices/Services/MSTestAdapterSettings.cs index a9c9bf0192..abbe24ecde 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Services/MSTestAdapterSettings.cs +++ b/src/Adapter/MSTest.PlatformServices/Services/MSTestAdapterSettings.cs @@ -3,12 +3,13 @@ #if !WINDOWS_UWP -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; +using MSTest.PlatformServices.Interface; + +namespace MSTest.PlatformServices; /// /// The MSTest settings. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Services/MessageLevel.cs b/src/Adapter/MSTest.PlatformServices/Services/MessageLevel.cs similarity index 90% rename from src/Adapter/MSTestAdapter.PlatformServices/Services/MessageLevel.cs rename to src/Adapter/MSTest.PlatformServices/Services/MessageLevel.cs index 455c39aaf8..bc3352d172 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Services/MessageLevel.cs +++ b/src/Adapter/MSTest.PlatformServices/Services/MessageLevel.cs @@ -4,7 +4,7 @@ using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; +namespace MSTest.PlatformServices; internal static class MessageLevelExtensions { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Services/ReflectionOperations.cs b/src/Adapter/MSTest.PlatformServices/Services/ReflectionOperations.cs similarity index 91% rename from src/Adapter/MSTestAdapter.PlatformServices/Services/ReflectionOperations.cs rename to src/Adapter/MSTest.PlatformServices/Services/ReflectionOperations.cs index 1214820f6a..7f9c1f46a0 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Services/ReflectionOperations.cs +++ b/src/Adapter/MSTest.PlatformServices/Services/ReflectionOperations.cs @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; +using MSTest.PlatformServices.Interface; #if NETFRAMEWORK -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; +using MSTest.PlatformServices.Utilities; #endif -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; +namespace MSTest.PlatformServices; /// /// This service is responsible for platform specific reflection operations. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Services/ReflectionOperations2.cs b/src/Adapter/MSTest.PlatformServices/Services/ReflectionOperations2.cs similarity index 95% rename from src/Adapter/MSTestAdapter.PlatformServices/Services/ReflectionOperations2.cs rename to src/Adapter/MSTest.PlatformServices/Services/ReflectionOperations2.cs index ececa18fa3..c9846a9d02 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Services/ReflectionOperations2.cs +++ b/src/Adapter/MSTest.PlatformServices/Services/ReflectionOperations2.cs @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; +using MSTest.PlatformServices.Interface; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; +namespace MSTest.PlatformServices; internal sealed class ReflectionOperations2 : ReflectionOperations, IReflectionOperations2 { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Services/SettingsProvider.cs b/src/Adapter/MSTest.PlatformServices/Services/SettingsProvider.cs similarity index 94% rename from src/Adapter/MSTestAdapter.PlatformServices/Services/SettingsProvider.cs rename to src/Adapter/MSTest.PlatformServices/Services/SettingsProvider.cs index b95d08a11a..1c81f4c936 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Services/SettingsProvider.cs +++ b/src/Adapter/MSTest.PlatformServices/Services/SettingsProvider.cs @@ -1,9 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; +#if !WINDOWS_UWP +using MSTest.PlatformServices.Utilities; +#endif + +using MSTest.PlatformServices.Interface; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; +namespace MSTest.PlatformServices; /// /// Class to read settings from the runsettings xml for the desktop. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs b/src/Adapter/MSTest.PlatformServices/Services/TestContextImplementation.cs similarity index 97% rename from src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs rename to src/Adapter/MSTest.PlatformServices/Services/TestContextImplementation.cs index b97f3a18a3..2b7715e3b8 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Services/TestContextImplementation.cs +++ b/src/Adapter/MSTest.PlatformServices/Services/TestContextImplementation.cs @@ -6,14 +6,15 @@ using System.Data.Common; #endif -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; -using ITestMethod = Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.ObjectModel.ITestMethod; +using MSTest.PlatformServices.Execution; +using MSTest.PlatformServices.Interface; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; +using ITestMethod = MSTest.PlatformServices.Interface.ObjectModel.ITestMethod; + +namespace MSTest.PlatformServices; /// /// Internal implementation of TestContext exposed to the user. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Services/TestDataSource.cs b/src/Adapter/MSTest.PlatformServices/Services/TestDataSource.cs similarity index 93% rename from src/Adapter/MSTestAdapter.PlatformServices/Services/TestDataSource.cs rename to src/Adapter/MSTest.PlatformServices/Services/TestDataSource.cs index 2fea97032a..dccb4a9932 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Services/TestDataSource.cs +++ b/src/Adapter/MSTest.PlatformServices/Services/TestDataSource.cs @@ -5,15 +5,15 @@ using System.Configuration; using System.Data; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Data; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Extensions; +using MSTest.PlatformServices.Extensions; #endif -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; using Microsoft.VisualStudio.TestTools.UnitTesting; -using ITestDataSource = Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.ITestDataSource; +using MSTest.PlatformServices.Interface; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; +using ITestDataSource = MSTest.PlatformServices.Interface.ITestDataSource; + +namespace MSTest.PlatformServices; /// /// The platform service that provides values from data source when data driven tests are run. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Services/TestDeployment.cs b/src/Adapter/MSTest.PlatformServices/Services/TestDeployment.cs similarity index 96% rename from src/Adapter/MSTestAdapter.PlatformServices/Services/TestDeployment.cs rename to src/Adapter/MSTest.PlatformServices/Services/TestDeployment.cs index 00184d5cb4..46a8444ea3 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Services/TestDeployment.cs +++ b/src/Adapter/MSTest.PlatformServices/Services/TestDeployment.cs @@ -2,11 +2,13 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. #if !WINDOWS_UWP -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Deployment; +using MSTest.PlatformServices.Deployment; #endif -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; +using MSTest.PlatformServices.Interface; + #if !WINDOWS_UWP -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; +using MSTest.PlatformServices.Utilities; + #endif using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; @@ -17,7 +19,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; #endif -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; +namespace MSTest.PlatformServices; /// /// The test deployment. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Services/TestSourceHandler.cs b/src/Adapter/MSTest.PlatformServices/Services/TestSourceHandler.cs similarity index 96% rename from src/Adapter/MSTestAdapter.PlatformServices/Services/TestSourceHandler.cs rename to src/Adapter/MSTest.PlatformServices/Services/TestSourceHandler.cs index 85697c54a2..7909d3da0e 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Services/TestSourceHandler.cs +++ b/src/Adapter/MSTest.PlatformServices/Services/TestSourceHandler.cs @@ -2,14 +2,15 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. #if WIN_UI -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.AppContainer; +using MSTest.PlatformServices.AppContainer; #endif -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; +using MSTest.PlatformServices.Interface; + #if NETFRAMEWORK using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities; #endif -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; +namespace MSTest.PlatformServices; /// /// This platform service is responsible for any data or operations to validate diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Services/TestSourceHost.cs b/src/Adapter/MSTest.PlatformServices/Services/TestSourceHost.cs similarity index 98% rename from src/Adapter/MSTestAdapter.PlatformServices/Services/TestSourceHost.cs rename to src/Adapter/MSTest.PlatformServices/Services/TestSourceHost.cs index ece3d402c6..712818fca5 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Services/TestSourceHost.cs +++ b/src/Adapter/MSTest.PlatformServices/Services/TestSourceHost.cs @@ -1,9 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; +using MSTest.PlatformServices.Interface; + #if NETFRAMEWORK -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; +using MSTest.PlatformServices.Utilities; + #endif #if !WINDOWS_UWP using Microsoft.VisualStudio.TestPlatform.ObjectModel; @@ -16,7 +18,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; #endif -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; +namespace MSTest.PlatformServices; /// /// A host that loads the test source. This can be in isolation for desktop using an AppDomain or just loading the source in the current context. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Services/ThreadOperations.cs b/src/Adapter/MSTest.PlatformServices/Services/ThreadOperations.cs similarity index 92% rename from src/Adapter/MSTestAdapter.PlatformServices/Services/ThreadOperations.cs rename to src/Adapter/MSTest.PlatformServices/Services/ThreadOperations.cs index 439aa5b379..510b3e8a94 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Services/ThreadOperations.cs +++ b/src/Adapter/MSTest.PlatformServices/Services/ThreadOperations.cs @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Extensions; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; +using MSTest.PlatformServices.Extensions; +using MSTest.PlatformServices.Interface; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; +namespace MSTest.PlatformServices; /// /// This service is responsible for any Async operations specific to a platform. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Services/TraceLogger.cs b/src/Adapter/MSTest.PlatformServices/Services/TraceLogger.cs similarity index 93% rename from src/Adapter/MSTestAdapter.PlatformServices/Services/TraceLogger.cs rename to src/Adapter/MSTest.PlatformServices/Services/TraceLogger.cs index 4f096e21f8..8feee2e080 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Services/TraceLogger.cs +++ b/src/Adapter/MSTest.PlatformServices/Services/TraceLogger.cs @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; using Microsoft.VisualStudio.TestPlatform.ObjectModel; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; +using MSTest.PlatformServices.Interface; + +namespace MSTest.PlatformServices; /// /// A service to log any trace messages from the adapter that would be shown in *.TpTrace files. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/TestMethodFilter.cs b/src/Adapter/MSTest.PlatformServices/TestMethodFilter.cs similarity index 97% rename from src/Adapter/MSTestAdapter.PlatformServices/TestMethodFilter.cs rename to src/Adapter/MSTest.PlatformServices/TestMethodFilter.cs index 33f554a96c..6720ef444c 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/TestMethodFilter.cs +++ b/src/Adapter/MSTest.PlatformServices/TestMethodFilter.cs @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; +namespace MSTest.PlatformServices; internal sealed class TestMethodFilter { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/AppDomainUtilities.cs b/src/Adapter/MSTest.PlatformServices/Utilities/AppDomainUtilities.cs similarity index 98% rename from src/Adapter/MSTestAdapter.PlatformServices/Utilities/AppDomainUtilities.cs rename to src/Adapter/MSTest.PlatformServices/Utilities/AppDomainUtilities.cs index a4151b99a3..b4b33ce544 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/AppDomainUtilities.cs +++ b/src/Adapter/MSTest.PlatformServices/Utilities/AppDomainUtilities.cs @@ -3,11 +3,10 @@ #if NETFRAMEWORK -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Deployment; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; +namespace MSTest.PlatformServices.Utilities; /// /// Utilities for AppDomain. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/AppDomainWrapper.cs b/src/Adapter/MSTest.PlatformServices/Utilities/AppDomainWrapper.cs similarity index 88% rename from src/Adapter/MSTestAdapter.PlatformServices/Utilities/AppDomainWrapper.cs rename to src/Adapter/MSTest.PlatformServices/Utilities/AppDomainWrapper.cs index 1fd4e53f75..7f441ac1fd 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/AppDomainWrapper.cs +++ b/src/Adapter/MSTest.PlatformServices/Utilities/AppDomainWrapper.cs @@ -5,7 +5,7 @@ using System.Security.Policy; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; +namespace MSTest.PlatformServices; /// /// Abstraction over the AppDomain APIs. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/ApplicationStateGuard.cs b/src/Adapter/MSTest.PlatformServices/Utilities/ApplicationStateGuard.cs similarity index 94% rename from src/Adapter/MSTestAdapter.PlatformServices/Utilities/ApplicationStateGuard.cs rename to src/Adapter/MSTest.PlatformServices/Utilities/ApplicationStateGuard.cs index 6e6c1f2bd7..e49aa07216 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/ApplicationStateGuard.cs +++ b/src/Adapter/MSTest.PlatformServices/Utilities/ApplicationStateGuard.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter; +namespace MSTest.PlatformServices.Utilities; internal static class ApplicationStateGuard { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/AssemblyUtility.cs b/src/Adapter/MSTest.PlatformServices/Utilities/AssemblyUtility.cs similarity index 98% rename from src/Adapter/MSTestAdapter.PlatformServices/Utilities/AssemblyUtility.cs rename to src/Adapter/MSTest.PlatformServices/Utilities/AssemblyUtility.cs index 18ddbf8cd5..ac0edfb533 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/AssemblyUtility.cs +++ b/src/Adapter/MSTest.PlatformServices/Utilities/AssemblyUtility.cs @@ -4,13 +4,11 @@ #if !WINDOWS_UWP #if NETFRAMEWORK - -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Deployment; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestTools.UnitTesting; #endif -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; +namespace MSTest.PlatformServices.Utilities; /// /// Utility for assembly specific functionality. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/DeploymentItemUtility.cs b/src/Adapter/MSTest.PlatformServices/Utilities/DeploymentItemUtility.cs similarity index 98% rename from src/Adapter/MSTestAdapter.PlatformServices/Utilities/DeploymentItemUtility.cs rename to src/Adapter/MSTest.PlatformServices/Utilities/DeploymentItemUtility.cs index 892345da66..ab40c4264b 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/DeploymentItemUtility.cs +++ b/src/Adapter/MSTest.PlatformServices/Utilities/DeploymentItemUtility.cs @@ -3,11 +3,10 @@ #if !WINDOWS_UWP -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Deployment; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; +namespace MSTest.PlatformServices.Utilities; /// /// The deployment utility. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/DeploymentUtility.cs b/src/Adapter/MSTest.PlatformServices/Utilities/DeploymentUtility.cs similarity index 97% rename from src/Adapter/MSTestAdapter.PlatformServices/Utilities/DeploymentUtility.cs rename to src/Adapter/MSTest.PlatformServices/Utilities/DeploymentUtility.cs index dd1a7a3d80..3f27a4b296 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/DeploymentUtility.cs +++ b/src/Adapter/MSTest.PlatformServices/Utilities/DeploymentUtility.cs @@ -5,16 +5,15 @@ #if NETFRAMEWORK using System.Security; -#endif -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Deployment; -#if NETFRAMEWORK -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Extensions; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestTools.UnitTesting; + +using MSTest.PlatformServices.Extensions; + #endif -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; +namespace MSTest.PlatformServices.Utilities; internal sealed class DeploymentUtility : DeploymentUtilityBase { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/DeploymentUtilityBase.cs b/src/Adapter/MSTest.PlatformServices/Utilities/DeploymentUtilityBase.cs similarity index 98% rename from src/Adapter/MSTestAdapter.PlatformServices/Utilities/DeploymentUtilityBase.cs rename to src/Adapter/MSTest.PlatformServices/Utilities/DeploymentUtilityBase.cs index 6390d960a5..d491fb341e 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/DeploymentUtilityBase.cs +++ b/src/Adapter/MSTest.PlatformServices/Utilities/DeploymentUtilityBase.cs @@ -3,15 +3,15 @@ #if !WINDOWS_UWP -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Deployment; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Extensions; - using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; +using MSTest.PlatformServices.Deployment; +using MSTest.PlatformServices.Extensions; + +namespace MSTest.PlatformServices.Utilities; internal abstract class DeploymentUtilityBase { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/FileUtility.cs b/src/Adapter/MSTest.PlatformServices/Utilities/FileUtility.cs similarity index 98% rename from src/Adapter/MSTestAdapter.PlatformServices/Utilities/FileUtility.cs rename to src/Adapter/MSTest.PlatformServices/Utilities/FileUtility.cs index 0d3b101591..45af1b5f18 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/FileUtility.cs +++ b/src/Adapter/MSTest.PlatformServices/Utilities/FileUtility.cs @@ -3,11 +3,12 @@ #if !WINDOWS_UWP -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Extensions; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; +using MSTest.PlatformServices.Extensions; + +namespace MSTest.PlatformServices.Utilities; [SuppressMessage("Performance", "CA1852: Seal internal types", Justification = "Overrides required for mocking")] internal class FileUtility diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/IAppDomain.cs b/src/Adapter/MSTest.PlatformServices/Utilities/IAppDomain.cs similarity index 94% rename from src/Adapter/MSTestAdapter.PlatformServices/Utilities/IAppDomain.cs rename to src/Adapter/MSTest.PlatformServices/Utilities/IAppDomain.cs index f5ed0b3350..81af61e422 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/IAppDomain.cs +++ b/src/Adapter/MSTest.PlatformServices/Utilities/IAppDomain.cs @@ -5,7 +5,7 @@ using System.Security.Policy; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; +namespace MSTest.PlatformServices; /// /// This interface is an abstraction over the AppDomain APIs. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/IAssemblyUtility.cs b/src/Adapter/MSTest.PlatformServices/Utilities/IAssemblyUtility.cs similarity index 91% rename from src/Adapter/MSTestAdapter.PlatformServices/Utilities/IAssemblyUtility.cs rename to src/Adapter/MSTest.PlatformServices/Utilities/IAssemblyUtility.cs index 1f923fb408..66ba511857 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/IAssemblyUtility.cs +++ b/src/Adapter/MSTest.PlatformServices/Utilities/IAssemblyUtility.cs @@ -3,7 +3,7 @@ #if NETFRAMEWORK -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; +namespace MSTest.PlatformServices.Utilities; internal interface IAssemblyUtility { diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/RandomIntPermutation.cs b/src/Adapter/MSTest.PlatformServices/Utilities/RandomIntPermutation.cs similarity index 95% rename from src/Adapter/MSTestAdapter.PlatformServices/Utilities/RandomIntPermutation.cs rename to src/Adapter/MSTest.PlatformServices/Utilities/RandomIntPermutation.cs index a18ca30068..657ab0bb7e 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/RandomIntPermutation.cs +++ b/src/Adapter/MSTest.PlatformServices/Utilities/RandomIntPermutation.cs @@ -2,7 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. #if NETFRAMEWORK -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; +namespace MSTest.PlatformServices; /// /// Permutation of integers from 0 to (numberOfObjects - 1), in random order and in the end all values are returned. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/ReflectionUtility.cs b/src/Adapter/MSTest.PlatformServices/Utilities/ReflectionUtility.cs similarity index 99% rename from src/Adapter/MSTestAdapter.PlatformServices/Utilities/ReflectionUtility.cs rename to src/Adapter/MSTest.PlatformServices/Utilities/ReflectionUtility.cs index fd3a04028c..d1b6be6dfc 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/ReflectionUtility.cs +++ b/src/Adapter/MSTest.PlatformServices/Utilities/ReflectionUtility.cs @@ -3,7 +3,7 @@ #if !WINDOWS_UWP -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; +namespace MSTest.PlatformServices.Utilities; /// /// Utility for reflection API's. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/SequentialIntPermutation.cs b/src/Adapter/MSTest.PlatformServices/Utilities/SequentialIntPermutation.cs similarity index 92% rename from src/Adapter/MSTestAdapter.PlatformServices/Utilities/SequentialIntPermutation.cs rename to src/Adapter/MSTest.PlatformServices/Utilities/SequentialIntPermutation.cs index 179aeb21f1..5e7d79cb50 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/SequentialIntPermutation.cs +++ b/src/Adapter/MSTest.PlatformServices/Utilities/SequentialIntPermutation.cs @@ -3,7 +3,7 @@ #if NETFRAMEWORK -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; +namespace MSTest.PlatformServices; /// /// Permutation of integers from 0 to (numberOfObjects - 1) returned by increment of 1. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/VSInstallationUtilities.cs b/src/Adapter/MSTest.PlatformServices/Utilities/VSInstallationUtilities.cs similarity index 99% rename from src/Adapter/MSTestAdapter.PlatformServices/Utilities/VSInstallationUtilities.cs rename to src/Adapter/MSTest.PlatformServices/Utilities/VSInstallationUtilities.cs index 297894da00..e963e2d09e 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/VSInstallationUtilities.cs +++ b/src/Adapter/MSTest.PlatformServices/Utilities/VSInstallationUtilities.cs @@ -5,7 +5,7 @@ using static System.String; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; +namespace MSTest.PlatformServices.Utilities; /// /// Utilities to get Visual Studio installation paths. diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/XmlUtilities.cs b/src/Adapter/MSTest.PlatformServices/Utilities/XmlUtilities.cs similarity index 98% rename from src/Adapter/MSTestAdapter.PlatformServices/Utilities/XmlUtilities.cs rename to src/Adapter/MSTest.PlatformServices/Utilities/XmlUtilities.cs index 6c23bce1db..5fc352fcbe 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Utilities/XmlUtilities.cs +++ b/src/Adapter/MSTest.PlatformServices/Utilities/XmlUtilities.cs @@ -5,7 +5,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; +namespace MSTest.PlatformServices.Utilities; [SuppressMessage("Performance", "CA1852: Seal internal types", Justification = "Overrides required for mocking")] internal class XmlUtilities diff --git a/src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.NonWindows.nuspec b/src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.NonWindows.nuspec index 1868705f98..3c9726f875 100644 --- a/src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.NonWindows.nuspec +++ b/src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.NonWindows.nuspec @@ -20,7 +20,7 @@ - + @@ -29,7 +29,7 @@ - + diff --git a/src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.csproj b/src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.csproj index d0582bd86a..6b924265ab 100644 --- a/src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.csproj +++ b/src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.csproj @@ -50,7 +50,7 @@ - + @@ -110,7 +110,7 @@ - + diff --git a/src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.nuspec b/src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.nuspec index 655a4aea7b..f150b92e1a 100644 --- a/src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.nuspec +++ b/src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.nuspec @@ -37,7 +37,7 @@ - + @@ -46,19 +46,19 @@ - + - + - - + + @@ -68,7 +68,7 @@ - + @@ -88,7 +88,7 @@ - + diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/MSTestDiscovererHelpers.cs b/src/Adapter/MSTest.TestAdapter/MSTestDiscovererHelpers.cs similarity index 89% rename from src/Adapter/MSTestAdapter.PlatformServices/Helpers/MSTestDiscovererHelpers.cs rename to src/Adapter/MSTest.TestAdapter/MSTestDiscovererHelpers.cs index 6f183af4d9..eb7ec742b6 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Helpers/MSTestDiscovererHelpers.cs +++ b/src/Adapter/MSTest.TestAdapter/MSTestDiscovererHelpers.cs @@ -1,12 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; +using MSTest.PlatformServices; +using MSTest.PlatformServices.Interface; +using MSTest.PlatformServices.ObjectModel; +using MSTest.PlatformServices.Resources; + +namespace MSTest.TestAdapter; internal static class MSTestDiscovererHelpers { diff --git a/src/Adapter/MSTest.TestAdapter/Properties/AssemblyInfo.cs b/src/Adapter/MSTest.TestAdapter/Properties/AssemblyInfo.cs index 93a4e7eb15..1134393c71 100644 --- a/src/Adapter/MSTest.TestAdapter/Properties/AssemblyInfo.cs +++ b/src/Adapter/MSTest.TestAdapter/Properties/AssemblyInfo.cs @@ -2,10 +2,12 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.VisualStudio.TestPlatform; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; + +using MSTest.PlatformServices; +using MSTest.PlatformServices.Execution; +using MSTest.PlatformServices.Extensions; +using MSTest.PlatformServices.ObjectModel; +using MSTest.TestAdapter; [assembly: TestExtensionTypes(typeof(MSTestDiscoverer), typeof(MSTestExecutor))] diff --git a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/BridgedConfiguration.cs b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/BridgedConfiguration.cs index 2deb1e6aa3..762aa816cc 100644 --- a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/BridgedConfiguration.cs +++ b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/BridgedConfiguration.cs @@ -4,9 +4,9 @@ #if !WINDOWS_UWP using Microsoft.Testing.Platform.Configurations; -using PlatformServicesConfiguration = Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.IConfiguration; +using PlatformServicesConfiguration = MSTest.PlatformServices.Interface.IConfiguration; -namespace Microsoft.VisualStudio.TestTools.UnitTesting; +namespace MSTest.TestAdapter; [SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "We can use MTP from this folder")] internal sealed class BridgedConfiguration : PlatformServicesConfiguration diff --git a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/BridgedTraceLogger.cs b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/BridgedTraceLogger.cs index 86cdf28df1..684e4e3392 100644 --- a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/BridgedTraceLogger.cs +++ b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/BridgedTraceLogger.cs @@ -3,9 +3,10 @@ #if !WINDOWS_UWP using Microsoft.Testing.Platform.Logging; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; -namespace Microsoft.VisualStudio.TestTools.UnitTesting; +using MSTest.PlatformServices.Interface; + +namespace MSTest.TestAdapter; [SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "MTP logger bridge")] internal sealed class BridgedTraceLogger : IAdapterTraceLogger diff --git a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestBannerCapability.cs b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestBannerCapability.cs index f00335287c..757c16f222 100644 --- a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestBannerCapability.cs +++ b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestBannerCapability.cs @@ -5,7 +5,7 @@ using Microsoft.Testing.Platform.Capabilities.TestFramework; using Microsoft.Testing.Platform.Services; -namespace Microsoft.VisualStudio.TestTools.UnitTesting; +namespace MSTest.TestAdapter; [SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "We can use MTP from this folder")] internal sealed class MSTestBannerCapability : IBannerMessageOwnerCapability diff --git a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestBridgedTestFramework.cs b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestBridgedTestFramework.cs index dc1fad26e1..e86aca8afb 100644 --- a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestBridgedTestFramework.cs +++ b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestBridgedTestFramework.cs @@ -8,9 +8,10 @@ using Microsoft.Testing.Platform.Logging; using Microsoft.Testing.Platform.Messages; using Microsoft.Testing.Platform.Services; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -namespace Microsoft.VisualStudio.TestTools.UnitTesting; +using MSTest.PlatformServices; + +namespace MSTest.TestAdapter; [SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "We can use MTP from this folder")] internal sealed class MSTestBridgedTestFramework : SynchronizedSingleSessionVSTestBridgedTestFramework diff --git a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestExtension.cs b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestExtension.cs index b331865f1a..3f3e059229 100644 --- a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestExtension.cs +++ b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestExtension.cs @@ -4,7 +4,7 @@ #if !WINDOWS_UWP using Microsoft.Testing.Platform.Extensions; -namespace Microsoft.VisualStudio.TestTools.UnitTesting; +namespace MSTest.TestAdapter; [SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "We can use MTP from this folder")] internal sealed class MSTestExtension : IExtension diff --git a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestGracefulStopTestExecutionCapability.cs b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestGracefulStopTestExecutionCapability.cs index 01bce0f496..dcff95b08e 100644 --- a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestGracefulStopTestExecutionCapability.cs +++ b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestGracefulStopTestExecutionCapability.cs @@ -3,9 +3,10 @@ #if !WINDOWS_UWP using Microsoft.Testing.Platform.Capabilities.TestFramework; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -namespace Microsoft.VisualStudio.TestTools.UnitTesting; +using MSTest.PlatformServices; + +namespace MSTest.TestAdapter; [SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "We can use MTP from this folder")] internal sealed class MSTestGracefulStopTestExecutionCapability : IGracefulStopTestExecutionCapability diff --git a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/TestApplicationBuilderExtensions.cs b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/TestApplicationBuilderExtensions.cs index 4166a55daa..b85744ff9a 100644 --- a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/TestApplicationBuilderExtensions.cs +++ b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/TestApplicationBuilderExtensions.cs @@ -9,6 +9,8 @@ using Microsoft.Testing.Platform.Helpers; using Microsoft.Testing.Platform.Services; +using MSTest.TestAdapter; + namespace Microsoft.VisualStudio.TestTools.UnitTesting; /// diff --git a/src/Adapter/MSTest.TestAdapter/VSTestAdapter/MSTestDiscoverer.cs b/src/Adapter/MSTest.TestAdapter/VSTestAdapter/MSTestDiscoverer.cs index f28f1d8e0a..7fcfdca307 100644 --- a/src/Adapter/MSTest.TestAdapter/VSTestAdapter/MSTestDiscoverer.cs +++ b/src/Adapter/MSTest.TestAdapter/VSTestAdapter/MSTestDiscoverer.cs @@ -1,18 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; +using MSTest.PlatformServices; +using MSTest.PlatformServices.Interface; + +namespace MSTest.TestAdapter; /// /// Contains the discovery logic for this adapter. /// -[DefaultExecutorUri(MSTestAdapter.PlatformServices.EngineConstants.ExecutorUriString)] +[DefaultExecutorUri(EngineConstants.ExecutorUriString)] [FileExtension(".xap")] [FileExtension(".appx")] [FileExtension(".dll")] diff --git a/src/Adapter/MSTest.TestAdapter/VSTestAdapter/MSTestExecutor.cs b/src/Adapter/MSTest.TestAdapter/VSTestAdapter/MSTestExecutor.cs index e7f6718ed0..bdfe6bb93a 100644 --- a/src/Adapter/MSTest.TestAdapter/VSTestAdapter/MSTestExecutor.cs +++ b/src/Adapter/MSTest.TestAdapter/VSTestAdapter/MSTestExecutor.cs @@ -1,16 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Resources; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; +using MSTest.PlatformServices; +using MSTest.PlatformServices.Execution; +using MSTest.PlatformServices.Interface; +using MSTest.PlatformServices.Resources; + +namespace MSTest.TestAdapter; /// /// Contains the execution logic for this adapter. diff --git a/src/Adapter/MSTest.TestAdapter/buildTransitive/common/MSTest.TestAdapter.targets b/src/Adapter/MSTest.TestAdapter/buildTransitive/common/MSTest.TestAdapter.targets index cb66c51a3e..8425f2451d 100644 --- a/src/Adapter/MSTest.TestAdapter/buildTransitive/common/MSTest.TestAdapter.targets +++ b/src/Adapter/MSTest.TestAdapter/buildTransitive/common/MSTest.TestAdapter.targets @@ -30,8 +30,8 @@ PreserveNewest False - - MSTestAdapter.PlatformServices.dll + + MSTest.PlatformServices.dll PreserveNewest False diff --git a/src/Adapter/MSTest.TestAdapter/buildTransitive/uwp/MSTest.TestAdapter.targets b/src/Adapter/MSTest.TestAdapter/buildTransitive/uwp/MSTest.TestAdapter.targets index fcccb2351d..da3e983855 100644 --- a/src/Adapter/MSTest.TestAdapter/buildTransitive/uwp/MSTest.TestAdapter.targets +++ b/src/Adapter/MSTest.TestAdapter/buildTransitive/uwp/MSTest.TestAdapter.targets @@ -6,8 +6,8 @@ PreserveNewest False - - MSTestAdapter.PlatformServices.dll + + MSTest.PlatformServices.dll PreserveNewest False diff --git a/src/Analyzers/MSTest.Analyzers/DuplicateDataRowAnalyzer.cs b/src/Analyzers/MSTest.Analyzers/DuplicateDataRowAnalyzer.cs index 6d560c76c1..fa3be2ad47 100644 --- a/src/Analyzers/MSTest.Analyzers/DuplicateDataRowAnalyzer.cs +++ b/src/Analyzers/MSTest.Analyzers/DuplicateDataRowAnalyzer.cs @@ -123,7 +123,7 @@ private static bool AreTypedConstantEquals(TypedConstant typedConstant1, TypedCo // we compare `Value` or `Values`. if (typedConstant1.Kind == TypedConstantKind.Array) { - return TypedConstantArrayComparer.Instance.Equals(typedConstant1.Values, typedConstant2.Values); + return Instance.Equals(typedConstant1.Values, typedConstant2.Values); } if (typedConstant1.Kind == TypedConstantKind.Primitive) @@ -143,7 +143,7 @@ private static bool AreTypedConstantEquals(TypedConstant typedConstant1, TypedCo } // At this point, the type is matching and the kind is matching and is not array. - return object.Equals(typedConstant1.Value, typedConstant2.Value); + return Equals(typedConstant1.Value, typedConstant2.Value); } public int GetHashCode(ImmutableArray obj) diff --git a/src/Analyzers/MSTest.Analyzers/RoslynAnalyzerHelpers/IMethodSymbolExtensions.cs b/src/Analyzers/MSTest.Analyzers/RoslynAnalyzerHelpers/IMethodSymbolExtensions.cs index 99cabd8dfb..095c4f4b8b 100644 --- a/src/Analyzers/MSTest.Analyzers/RoslynAnalyzerHelpers/IMethodSymbolExtensions.cs +++ b/src/Analyzers/MSTest.Analyzers/RoslynAnalyzerHelpers/IMethodSymbolExtensions.cs @@ -4,8 +4,6 @@ using Microsoft.CodeAnalysis; -using MSTest.Analyzers.Helpers; - namespace Analyzer.Utilities.Extensions; internal static class IMethodSymbolExtensions diff --git a/src/Analyzers/MSTest.Analyzers/RoslynAnalyzerHelpers/PooledHashSet.cs b/src/Analyzers/MSTest.Analyzers/RoslynAnalyzerHelpers/PooledHashSet.cs index 6bba0e554f..84f6e68f1c 100644 --- a/src/Analyzers/MSTest.Analyzers/RoslynAnalyzerHelpers/PooledHashSet.cs +++ b/src/Analyzers/MSTest.Analyzers/RoslynAnalyzerHelpers/PooledHashSet.cs @@ -1,7 +1,5 @@ // Copyright (c) Microsoft. All Rights Reserved. Licensed under the MIT license. See License.txt in the project root for license information. -using System.Collections.Immutable; - #pragma warning disable CA1000 // Do not declare static members on generic types namespace Analyzer.Utilities.PooledObjects; diff --git a/src/Platform/Microsoft.Testing.Platform/OutputDevice/TerminalOutputDevice.cs b/src/Platform/Microsoft.Testing.Platform/OutputDevice/TerminalOutputDevice.cs index da18b28374..195ad22c7c 100644 --- a/src/Platform/Microsoft.Testing.Platform/OutputDevice/TerminalOutputDevice.cs +++ b/src/Platform/Microsoft.Testing.Platform/OutputDevice/TerminalOutputDevice.cs @@ -89,7 +89,7 @@ public TerminalOutputDevice( #else // RID has the operating system, we want to see that in the banner, but not next to every dll. _longArchitecture = RuntimeInformation.RuntimeIdentifier; - _shortArchitecture = TerminalOutputDevice.GetShortArchitecture(RuntimeInformation.RuntimeIdentifier); + _shortArchitecture = GetShortArchitecture(RuntimeInformation.RuntimeIdentifier); #endif _runtimeFramework = TargetFrameworkParser.GetShortTargetFramework(RuntimeInformation.FrameworkDescription); _targetFramework = TargetFrameworkParser.GetShortTargetFramework(Assembly.GetEntryAssembly()?.GetCustomAttribute()?.FrameworkDisplayName) ?? _runtimeFramework; diff --git a/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/SerializerUtilities.cs b/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/SerializerUtilities.cs index 4454b98ba9..db75061391 100644 --- a/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/SerializerUtilities.cs +++ b/src/Platform/Microsoft.Testing.Platform/ServerMode/JsonRpc/SerializerUtilities.cs @@ -5,6 +5,7 @@ // As such, we have two separate implementations for the serialization code. #if !NETCOREAPP using Jsonite; + #endif using Microsoft.Testing.Platform.Extensions.Messages; using Microsoft.Testing.Platform.Helpers; diff --git a/src/TestFramework/TestFramework.Extensions/AppModel.cs b/src/TestFramework/TestFramework.Extensions/AppModel.cs index 9efd65874c..04932155d9 100644 --- a/src/TestFramework/TestFramework.Extensions/AppModel.cs +++ b/src/TestFramework/TestFramework.Extensions/AppModel.cs @@ -2,7 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. #if WIN_UI -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.AppContainer; +namespace MSTest.PlatformServices.AppContainer; /// /// Provides package information about the application. diff --git a/src/TestFramework/TestFramework.Extensions/TestFramework.Extensions.csproj b/src/TestFramework/TestFramework.Extensions/TestFramework.Extensions.csproj index de8adb773b..7b92fe5b84 100644 --- a/src/TestFramework/TestFramework.Extensions/TestFramework.Extensions.csproj +++ b/src/TestFramework/TestFramework.Extensions/TestFramework.Extensions.csproj @@ -91,8 +91,8 @@ - - + + diff --git a/src/TestFramework/TestFramework/TestFramework.csproj b/src/TestFramework/TestFramework/TestFramework.csproj index 3bb3e7339b..44eedcec5a 100644 --- a/src/TestFramework/TestFramework/TestFramework.csproj +++ b/src/TestFramework/TestFramework/TestFramework.csproj @@ -39,11 +39,11 @@ - - + + - - + + diff --git a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryWarningsTests.cs b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryWarningsTests.cs index 20be834361..ed8416c4e6 100644 --- a/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryWarningsTests.cs +++ b/test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryWarningsTests.cs @@ -117,7 +117,7 @@ public void Test1_1() // Ensure we run in appdomain, and not directly in host, because we want to ensure that warnings are correctly passed // outside of the appdomain to the rest of the engine. //\ - // We set this friendly appdomain name in src\Adapter\MSTestAdapter.PlatformServices\Services\TestSourceHost.cs:163 + // We set this friendly appdomain name in src\Adapter\MSTest.PlatformServices\Services\TestSourceHost.cs:163 StringAssert.StartsWith(AppDomain.CurrentDomain.FriendlyName, "TestSourceHost: Enumerating source"); #endif } diff --git a/test/IntegrationTests/MSTest.IntegrationTests/NoNamespaceTests.cs b/test/IntegrationTests/MSTest.IntegrationTests/NoNamespaceTests.cs index 2138a7b6c1..4305f852f5 100644 --- a/test/IntegrationTests/MSTest.IntegrationTests/NoNamespaceTests.cs +++ b/test/IntegrationTests/MSTest.IntegrationTests/NoNamespaceTests.cs @@ -2,10 +2,10 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Microsoft.MSTestV2.CLIAutomation; - -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions; using Microsoft.VisualStudio.TestPlatform.ObjectModel; +using MSTest.PlatformServices.Extensions; + namespace MSTest.IntegrationTests; [TestClass] diff --git a/test/IntegrationTests/MSTest.IntegrationTests/Utilities/CLITestBase.discovery.cs b/test/IntegrationTests/MSTest.IntegrationTests/Utilities/CLITestBase.discovery.cs index 21ef5add56..4ba18dbf8b 100644 --- a/test/IntegrationTests/MSTest.IntegrationTests/Utilities/CLITestBase.discovery.cs +++ b/test/IntegrationTests/MSTest.IntegrationTests/Utilities/CLITestBase.discovery.cs @@ -5,13 +5,14 @@ using DiscoveryAndExecutionTests.Utilities; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; +using MSTest.PlatformServices; + +using MSTest.PlatformServices.Execution; + using TestResult = Microsoft.VisualStudio.TestPlatform.ObjectModel.TestResult; namespace Microsoft.MSTestV2.CLIAutomation; diff --git a/test/IntegrationTests/PlatformServices.Desktop.IntegrationTests/DesktopTestSourceHostTests.cs b/test/IntegrationTests/MSTest.PlatformServices.IntegrationTests/DesktopTestSourceHostTests.cs similarity index 96% rename from test/IntegrationTests/PlatformServices.Desktop.IntegrationTests/DesktopTestSourceHostTests.cs rename to test/IntegrationTests/MSTest.PlatformServices.IntegrationTests/DesktopTestSourceHostTests.cs index 0580c62125..b1518dc805 100644 --- a/test/IntegrationTests/PlatformServices.Desktop.IntegrationTests/DesktopTestSourceHostTests.cs +++ b/test/IntegrationTests/MSTest.PlatformServices.IntegrationTests/DesktopTestSourceHostTests.cs @@ -3,16 +3,16 @@ using AwesomeAssertions; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities; using Moq; +using MSTest.PlatformServices.Utilities; + using TestFramework.ForTestingMSTest; -namespace PlatformServices.Desktop.ComponentTests; +namespace MSTest.PlatformServices.IntegrationTests; public class DesktopTestSourceHostTests : TestContainer { diff --git a/test/IntegrationTests/PlatformServices.Desktop.IntegrationTests/PlatformServices.Desktop.IntegrationTests.csproj b/test/IntegrationTests/MSTest.PlatformServices.IntegrationTests/MSTest.PlatformServices.IntegrationTests.csproj similarity index 82% rename from test/IntegrationTests/PlatformServices.Desktop.IntegrationTests/PlatformServices.Desktop.IntegrationTests.csproj rename to test/IntegrationTests/MSTest.PlatformServices.IntegrationTests/MSTest.PlatformServices.IntegrationTests.csproj index de991b9157..48bfdb70e9 100644 --- a/test/IntegrationTests/PlatformServices.Desktop.IntegrationTests/PlatformServices.Desktop.IntegrationTests.csproj +++ b/test/IntegrationTests/MSTest.PlatformServices.IntegrationTests/MSTest.PlatformServices.IntegrationTests.csproj @@ -7,7 +7,7 @@ - + diff --git a/test/IntegrationTests/PlatformServices.Desktop.IntegrationTests/Program.cs b/test/IntegrationTests/MSTest.PlatformServices.IntegrationTests/Program.cs similarity index 100% rename from test/IntegrationTests/PlatformServices.Desktop.IntegrationTests/Program.cs rename to test/IntegrationTests/MSTest.PlatformServices.IntegrationTests/Program.cs diff --git a/test/IntegrationTests/PlatformServices.Desktop.IntegrationTests/ReflectionUtilityTests.cs b/test/IntegrationTests/MSTest.PlatformServices.IntegrationTests/ReflectionUtilityTests.cs similarity index 98% rename from test/IntegrationTests/PlatformServices.Desktop.IntegrationTests/ReflectionUtilityTests.cs rename to test/IntegrationTests/MSTest.PlatformServices.IntegrationTests/ReflectionUtilityTests.cs index 6d65e28527..3a404eb738 100644 --- a/test/IntegrationTests/PlatformServices.Desktop.IntegrationTests/ReflectionUtilityTests.cs +++ b/test/IntegrationTests/MSTest.PlatformServices.IntegrationTests/ReflectionUtilityTests.cs @@ -3,13 +3,13 @@ using AwesomeAssertions; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; +using MSTest.PlatformServices.Utilities; using SampleFrameworkExtensions; using TestFramework.ForTestingMSTest; -namespace PlatformServices.Desktop.ComponentTests; +namespace MSTest.PlatformServices.IntegrationTests; public class ReflectionUtilityTests : TestContainer { diff --git a/test/UnitTests/MSTest.Analyzers.UnitTests/UseParallelizeAttributeAnalyzerTests.cs b/test/UnitTests/MSTest.Analyzers.UnitTests/UseParallelizeAttributeAnalyzerTests.cs index bb48573015..e88475585f 100644 --- a/test/UnitTests/MSTest.Analyzers.UnitTests/UseParallelizeAttributeAnalyzerTests.cs +++ b/test/UnitTests/MSTest.Analyzers.UnitTests/UseParallelizeAttributeAnalyzerTests.cs @@ -3,7 +3,8 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Testing; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; + +using MSTest.TestAdapter; using VerifyCS = MSTest.Analyzers.Test.CSharpCodeFixVerifier< MSTest.Analyzers.UseParallelizeAttributeAnalyzer, diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/AssemblyAttributes.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/AssemblyAttributes.cs similarity index 83% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/AssemblyAttributes.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/AssemblyAttributes.cs index 33e002f250..09cae9e91d 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/AssemblyAttributes.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/AssemblyAttributes.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using MSTestAdapter.PlatformServices.Tests.Services; +using MSTest.PlatformServices.Tests.Services; [assembly: ReflectionOperationsTests.DummyA("a1")] [assembly: ReflectionOperationsTests.DummyA("a2")] diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/AssemblyResolverTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/AssemblyResolverTests.cs similarity index 98% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/AssemblyResolverTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/AssemblyResolverTests.cs index a7fc128737..d9667118df 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/AssemblyResolverTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/AssemblyResolverTests.cs @@ -2,11 +2,9 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. #if NETFRAMEWORK -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; - using TestFramework.ForTestingMSTest; -namespace MSTestAdapter.PlatformServices.UnitTests; +namespace MSTest.PlatformServices.UnitTests; public class AssemblyResolverTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/DataTestSourceFile.xml b/test/UnitTests/MSTest.PlatformServices.UnitTests/DataTestSourceFile.xml similarity index 100% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/DataTestSourceFile.xml rename to test/UnitTests/MSTest.PlatformServices.UnitTests/DataTestSourceFile.xml diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Deployment/AssemblyLoadWorkerTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Deployment/AssemblyLoadWorkerTests.cs similarity index 95% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Deployment/AssemblyLoadWorkerTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Deployment/AssemblyLoadWorkerTests.cs index 96f7112734..f70f1e21c9 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Deployment/AssemblyLoadWorkerTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Deployment/AssemblyLoadWorkerTests.cs @@ -2,14 +2,13 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. #if NETFRAMEWORK -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Deployment; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; - using Moq; +using MSTest.PlatformServices.Utilities; + using TestFramework.ForTestingMSTest; -namespace MSTestAdapter.PlatformServices.UnitTests.Deployment; +namespace MSTest.PlatformServices.Deployment.UnitTests; public class AssemblyLoadWorkerTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Deployment/DeploymentItemTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Deployment/DeploymentItemTests.cs similarity index 92% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Deployment/DeploymentItemTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Deployment/DeploymentItemTests.cs index 4eb8834a36..ec2be9a56f 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Deployment/DeploymentItemTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Deployment/DeploymentItemTests.cs @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Deployment; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Resources; +using MSTest.PlatformServices.Resources; using TestFramework.ForTestingMSTest; -namespace MSTestAdapter.PlatformServices.Tests.Deployment; +namespace MSTest.PlatformServices.Deployment.UnitTests; public class DeploymentItemTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Deployment/TestRunDirectoriesTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Deployment/TestRunDirectoriesTests.cs similarity index 84% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Deployment/TestRunDirectoriesTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Deployment/TestRunDirectoriesTests.cs index 1352d0bbeb..d370820d6a 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Deployment/TestRunDirectoriesTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Deployment/TestRunDirectoriesTests.cs @@ -1,11 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Deployment; - using TestFramework.ForTestingMSTest; -namespace MSTestAdapter.PlatformServices.Tests.Deployment; +namespace MSTest.PlatformServices.Deployment.UnitTests; public class TestRunDirectoriesTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/AssemblyEnumeratorTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Discovery/AssemblyEnumeratorTests.cs similarity index 96% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/AssemblyEnumeratorTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Discovery/AssemblyEnumeratorTests.cs index cf6fd7d6d3..0a1e021436 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/AssemblyEnumeratorTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Discovery/AssemblyEnumeratorTests.cs @@ -3,19 +3,18 @@ using System.Collections.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Discovery; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Resources; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.TestableImplementations; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using Moq; +using MSTest.PlatformServices.Helpers; +using MSTest.PlatformServices.ObjectModel; +using MSTest.PlatformServices.Resources; +using MSTest.PlatformServices.UnitTests; + using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Discovery; +namespace MSTest.PlatformServices.Discovery.UnitTests; public class AssemblyEnumeratorTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/AssemblyEnumeratorWrapperTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Discovery/AssemblyEnumeratorWrapperTests.cs similarity index 89% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/AssemblyEnumeratorWrapperTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Discovery/AssemblyEnumeratorWrapperTests.cs index bcee1680f9..38b4048e88 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/AssemblyEnumeratorWrapperTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Discovery/AssemblyEnumeratorWrapperTests.cs @@ -1,17 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Discovery; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Resources; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.TestableImplementations; - using Moq; +using MSTest.PlatformServices.Interface; +using MSTest.PlatformServices.ObjectModel; +using MSTest.PlatformServices.Resources; +using MSTest.PlatformServices.UnitTests; + using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Discovery; +namespace MSTest.PlatformServices.Discovery.UnitTests; public class AssemblyEnumeratorWrapperTests : TestContainer { @@ -69,7 +68,7 @@ public void GetTestsShouldReturnTestElements() // Setup mocks. SetupMocks(assemblyName, doesFileExist: true, isAssemblyReferenced: true); - ICollection? tests = AssemblyEnumeratorWrapper.GetTests(assemblyName, null, _mockTestSourceHandler.Object, out _); + ICollection? tests = AssemblyEnumeratorWrapper.GetTests(assemblyName, null, _mockTestSourceHandler.Object, out _); Verify(tests is not null); diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/TestMethodValidatorTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Discovery/TestMethodValidatorTests.cs similarity index 97% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/TestMethodValidatorTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Discovery/TestMethodValidatorTests.cs index dce04bc894..cbc616dfc1 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/TestMethodValidatorTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Discovery/TestMethodValidatorTests.cs @@ -1,14 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Discovery; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; - using Moq; +using MSTest.PlatformServices.Helpers; + using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Discovery; +namespace MSTest.PlatformServices.Discovery.UnitTests; public class TestMethodValidatorTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/TypeEnumeratorTests.MockedMethodInfoWithExtraAttributes.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Discovery/TypeEnumeratorTests.MockedMethodInfoWithExtraAttributes.cs similarity index 98% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/TypeEnumeratorTests.MockedMethodInfoWithExtraAttributes.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Discovery/TypeEnumeratorTests.MockedMethodInfoWithExtraAttributes.cs index a351eada6d..d307545645 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/TypeEnumeratorTests.MockedMethodInfoWithExtraAttributes.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Discovery/TypeEnumeratorTests.MockedMethodInfoWithExtraAttributes.cs @@ -5,7 +5,7 @@ using Polyfills; #endif -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Discovery; +namespace MSTest.PlatformServices.Discovery.UnitTests; public partial class TypeEnumeratorTests { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/TypeEnumeratorTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Discovery/TypeEnumeratorTests.cs similarity index 87% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/TypeEnumeratorTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Discovery/TypeEnumeratorTests.cs index 6ca0f5fbdd..345922a9aa 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/TypeEnumeratorTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Discovery/TypeEnumeratorTests.cs @@ -1,18 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Discovery; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.TestableImplementations; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using Moq; +using MSTest.PlatformServices.Helpers; +using MSTest.PlatformServices.ObjectModel; +using MSTest.PlatformServices.UnitTests; + using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Discovery; +namespace MSTest.PlatformServices.Discovery.UnitTests; public partial class TypeEnumeratorTests : TestContainer { @@ -62,7 +62,7 @@ public void EnumerateShouldReturnEmptyCollectionWhenNoValidTestMethodsExist() SetupTestClassAndTestMethods(isValidTestClass: true, isValidTestMethod: false, isMethodFromSameAssembly: true); TypeEnumerator typeEnumerator = GetTypeEnumeratorInstance(typeof(DummyTestClass), string.Empty); - ICollection? tests = typeEnumerator.Enumerate(_warnings); + ICollection? tests = typeEnumerator.Enumerate(_warnings); Verify(tests is not null); Verify(tests.Count == 0); @@ -77,7 +77,7 @@ public void GetTestsShouldReturnDeclaredTestMethods() SetupTestClassAndTestMethods(isValidTestClass: true, isValidTestMethod: true, isMethodFromSameAssembly: true); TypeEnumerator typeEnumerator = GetTypeEnumeratorInstance(typeof(DummyBaseTestClass), Assembly.GetExecutingAssembly().FullName!); - ICollection? tests = typeEnumerator.Enumerate(_warnings); + ICollection? tests = typeEnumerator.Enumerate(_warnings); Verify(tests is not null); @@ -90,7 +90,7 @@ public void GetTestsShouldReturnBaseTestMethodsInSameAssembly() SetupTestClassAndTestMethods(isValidTestClass: true, isValidTestMethod: true, isMethodFromSameAssembly: true); TypeEnumerator typeEnumerator = GetTypeEnumeratorInstance(typeof(DummyDerivedTestClass), Assembly.GetExecutingAssembly().FullName!); - ICollection? tests = typeEnumerator.Enumerate(_warnings); + ICollection? tests = typeEnumerator.Enumerate(_warnings); Verify(tests is not null); @@ -121,7 +121,7 @@ public void GetTestsShouldReturnBaseTestMethodsFromAnotherAssemblyByDefault() TypeEnumerator typeEnumerator = GetTypeEnumeratorInstance(typeof(DummyDerivedTestClass), Assembly.GetExecutingAssembly().FullName!); - ICollection? tests = typeEnumerator.Enumerate(_warnings); + ICollection? tests = typeEnumerator.Enumerate(_warnings); Verify(tests is not null); @@ -151,7 +151,7 @@ public void GetTestsShouldReturnBaseTestMethodsFromAnotherAssemblyByConfiguratio SetupTestClassAndTestMethods(isValidTestClass: true, isValidTestMethod: true, isMethodFromSameAssembly: true); TypeEnumerator typeEnumerator = GetTypeEnumeratorInstance(typeof(DummyDerivedTestClass), Assembly.GetExecutingAssembly().FullName!); - ICollection? tests = typeEnumerator.Enumerate(_warnings); + ICollection? tests = typeEnumerator.Enumerate(_warnings); Verify(tests is not null); @@ -182,7 +182,7 @@ public void GetTestsShouldNotReturnBaseTestMethodsFromAnotherAssemblyByConfigura SetupTestClassAndTestMethods(isValidTestClass: true, isValidTestMethod: true, isMethodFromSameAssembly: false); TypeEnumerator typeEnumerator = GetTypeEnumeratorInstance(typeof(DummyDerivedTestClass), Assembly.GetExecutingAssembly().FullName!); - ICollection? tests = typeEnumerator.Enumerate(_warnings); + ICollection? tests = typeEnumerator.Enumerate(_warnings); Verify(tests is not null); @@ -196,7 +196,7 @@ public void GetTestsShouldNotReturnHiddenTestMethods() SetupTestClassAndTestMethods(isValidTestClass: true, isValidTestMethod: true, isMethodFromSameAssembly: true); TypeEnumerator typeEnumerator = GetTypeEnumeratorInstance(typeof(DummyHidingTestClass), Assembly.GetExecutingAssembly().FullName!); - ICollection? tests = typeEnumerator.Enumerate(_warnings); + ICollection? tests = typeEnumerator.Enumerate(_warnings); Verify(tests is not null); @@ -215,7 +215,7 @@ public void GetTestsShouldReturnOverriddenTestMethods() SetupTestClassAndTestMethods(isValidTestClass: true, isValidTestMethod: true, isMethodFromSameAssembly: true); TypeEnumerator typeEnumerator = GetTypeEnumeratorInstance(typeof(DummyOverridingTestClass), Assembly.GetExecutingAssembly().FullName!); - ICollection? tests = typeEnumerator.Enumerate(_warnings); + ICollection? tests = typeEnumerator.Enumerate(_warnings); Verify(tests is not null); @@ -238,7 +238,7 @@ public void GetTestsShouldNotReturnHiddenTestMethodsFromAnyLevel() SetupTestClassAndTestMethods(isValidTestClass: true, isValidTestMethod: true, isMethodFromSameAssembly: true); TypeEnumerator typeEnumerator = GetTypeEnumeratorInstance(typeof(DummySecondHidingTestClass), Assembly.GetExecutingAssembly().FullName!); - ICollection? tests = typeEnumerator.Enumerate(_warnings); + ICollection? tests = typeEnumerator.Enumerate(_warnings); Verify(tests is not null); @@ -267,7 +267,7 @@ public void GetTestFromMethodShouldInitiateTestMethodWithCorrectParameters() SetupTestClassAndTestMethods(isValidTestClass: true, isValidTestMethod: true, isMethodFromSameAssembly: true); TypeEnumerator typeEnumerator = GetTypeEnumeratorInstance(typeof(DummyTestClass), "DummyAssemblyName"); - MSTest.TestAdapter.ObjectModel.UnitTestElement testElement = typeEnumerator.GetTestFromMethod(typeof(DummyTestClass).GetMethod("MethodWithVoidReturnType")!, true, _warnings); + UnitTestElement testElement = typeEnumerator.GetTestFromMethod(typeof(DummyTestClass).GetMethod("MethodWithVoidReturnType")!, true, _warnings); Verify(testElement is not null); Verify(testElement.TestMethod.Name == "MethodWithVoidReturnType"); @@ -281,7 +281,7 @@ public void GetTestFromMethodShouldInitializeAsyncTypeNameCorrectly() TypeEnumerator typeEnumerator = GetTypeEnumeratorInstance(typeof(DummyTestClass), "DummyAssemblyName"); MethodInfo methodInfo = typeof(DummyTestClass).GetMethod("AsyncMethodWithTaskReturnType")!; - MSTest.TestAdapter.ObjectModel.UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); + UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); string? expectedAsyncTaskName = methodInfo.GetCustomAttribute()!.StateMachineType.FullName; @@ -297,7 +297,7 @@ public void GetTestFromMethodShouldSetTestCategory() methodInfo = new MockedMethodInfoWithExtraAttributes(methodInfo, new TestCategoryAttribute("foo"), new TestCategoryAttribute("bar")); string[] testCategories = ["foo", "bar"]; - MSTest.TestAdapter.ObjectModel.UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); + UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); Verify(testElement is not null); Verify(testCategories.SequenceEqual(testElement.TestCategory)); @@ -310,7 +310,7 @@ public void GetTestFromMethodShouldSetDoNotParallelize() MethodInfo methodInfo = typeof(DummyTestClass).GetMethod("MethodWithVoidReturnType")!; methodInfo = new MockedMethodInfoWithExtraAttributes(methodInfo, new DoNotParallelizeAttribute()); - MSTest.TestAdapter.ObjectModel.UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); + UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); Verify(testElement is not null); Verify(testElement.DoNotParallelize); @@ -327,7 +327,7 @@ public void GetTestFromMethodShouldFillTraitsWithTestProperties() new TestPropertyAttribute("foo", "bar"), new TestPropertyAttribute("fooprime", "barprime")); - MSTest.TestAdapter.ObjectModel.UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); + UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); Verify(testElement is not null); Verify(testElement.Traits!.Length == 2); @@ -349,7 +349,7 @@ public void GetTestFromMethodShouldFillTraitsWithTestOwnerPropertyIfPresent() new TestPropertyAttribute("fooprime", "barprime"), new OwnerAttribute("mike")); - MSTest.TestAdapter.ObjectModel.UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); + UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); Verify(testElement is not null); Verify(testElement.Traits!.Length == 3); @@ -368,7 +368,7 @@ public void GetTestFromMethodShouldFillTraitsWithTestPriorityPropertyIfPresent() MethodInfo methodInfo = typeof(DummyTestClass).GetMethod("MethodWithVoidReturnType")!; methodInfo = new MockedMethodInfoWithExtraAttributes(methodInfo, new TestPropertyAttribute("foo", "bar"), new TestPropertyAttribute("fooprime", "barprime"), new PriorityAttribute(1)); - MSTest.TestAdapter.ObjectModel.UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); + UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); Verify(testElement is not null); Verify(testElement.Traits!.Length == 3); @@ -387,7 +387,7 @@ public void GetTestFromMethodShouldSetPriority() MethodInfo methodInfo = typeof(DummyTestClass).GetMethod("MethodWithVoidReturnType")!; methodInfo = new MockedMethodInfoWithExtraAttributes(methodInfo, new PriorityAttribute(1)); - MSTest.TestAdapter.ObjectModel.UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); + UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); Verify(testElement is not null); Verify(testElement.Priority == 1); @@ -400,7 +400,7 @@ public void GetTestFromMethodShouldSetDescription() MethodInfo methodInfo = typeof(DummyTestClass).GetMethod("MethodWithVoidReturnType")!; methodInfo = new MockedMethodInfoWithExtraAttributes(methodInfo, new DescriptionAttribute("Dummy description")); - MSTest.TestAdapter.ObjectModel.UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); + UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); Verify(testElement.Traits is not null); Verify(testElement.Traits.Any(t => t.Name == "Description" && t.Value == "Dummy description")); @@ -413,7 +413,7 @@ public void GetTestFromMethodShouldSetWorkItemIds() MethodInfo methodInfo = typeof(DummyTestClass).GetMethod("MethodWithVoidReturnType")!; methodInfo = new MockedMethodInfoWithExtraAttributes(methodInfo, new WorkItemAttribute(123), new WorkItemAttribute(345)); - MSTest.TestAdapter.ObjectModel.UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); + UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); Verify(new string[] { "123", "345" }.SequenceEqual(testElement.WorkItemIds)); } @@ -424,7 +424,7 @@ public void GetTestFromMethodShouldSetWorkItemIdsToNullIfNotAny() TypeEnumerator typeEnumerator = GetTypeEnumeratorInstance(typeof(DummyTestClass), "DummyAssemblyName"); MethodInfo methodInfo = typeof(DummyTestClass).GetMethod("MethodWithVoidReturnType")!; - MSTest.TestAdapter.ObjectModel.UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); + UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); Verify(testElement.WorkItemIds is null); } @@ -440,7 +440,7 @@ public void GetTestFromMethodShouldSetDeploymentItemsToNullIfNotPresent() td => td.GetDeploymentItems(It.IsAny(), It.IsAny(), _warnings)) .Returns((KeyValuePair[])null!); - MSTest.TestAdapter.ObjectModel.UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); + UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); Verify(testElement is not null); Verify(testElement.DeploymentItems is null); @@ -457,7 +457,7 @@ public void GetTestFromMethodShouldSetDeploymentItems() _testablePlatformServiceProvider.MockTestDeployment.Setup( td => td.GetDeploymentItems(methodInfo, typeof(DummyTestClass), _warnings)).Returns(deploymentItems); - MSTest.TestAdapter.ObjectModel.UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); + UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); Verify(testElement is not null); Verify(testElement.DeploymentItems is not null); @@ -476,7 +476,7 @@ public void GetTestFromMethodShouldSetDeclaringAssemblyName() _testablePlatformServiceProvider.MockFileOperations.Setup(fo => fo.GetAssemblyPath(It.IsAny())) .Returns(otherAssemblyName); - MSTest.TestAdapter.ObjectModel.UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, isMethodFromSameAssembly, _warnings); + UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, isMethodFromSameAssembly, _warnings); Verify(testElement is not null); Verify(otherAssemblyName == testElement.TestMethod.DeclaringAssemblyName); @@ -489,7 +489,7 @@ public void GetTestFromMethodShouldSetDisplayNameToTestMethodNameIfDisplayNameIs MethodInfo methodInfo = typeof(DummyTestClass).GetMethod(nameof(DummyTestClass.MethodWithVoidReturnType))!; methodInfo = new MockedMethodInfoWithExtraAttributes(methodInfo, new TestMethodAttribute()); - MSTest.TestAdapter.ObjectModel.UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); + UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); Verify(testElement is not null); Verify(testElement.DisplayName == "MethodWithVoidReturnType"); @@ -502,7 +502,7 @@ public void GetTestFromMethodShouldSetDisplayNameFromTestMethodAttribute() MethodInfo methodInfo = typeof(DummyTestClass).GetMethod(nameof(DummyTestClass.MethodWithVoidReturnType))!; methodInfo = new MockedMethodInfoWithExtraAttributes(methodInfo, new TestMethodAttribute() { DisplayName = "Test method display name." }); - MSTest.TestAdapter.ObjectModel.UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); + UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); Verify(testElement is not null); Verify(testElement.DisplayName == "Test method display name."); @@ -515,7 +515,7 @@ public void GetTestFromMethodShouldSetDisplayNameFromDataTestMethodAttribute() MethodInfo methodInfo = typeof(DummyTestClass).GetMethod(nameof(DummyTestClass.MethodWithVoidReturnType))!; methodInfo = new MockedMethodInfoWithExtraAttributes(methodInfo, new DataTestMethodAttribute() { DisplayName = "Test method display name." }); - MSTest.TestAdapter.ObjectModel.UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); + UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, true, _warnings); Verify(testElement is not null); Verify(testElement.DisplayName == "Test method display name."); diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/TypeValidatorTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Discovery/TypeValidatorTests.cs similarity index 98% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/TypeValidatorTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Discovery/TypeValidatorTests.cs index 4699a14c7d..92b1873d6c 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/TypeValidatorTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Discovery/TypeValidatorTests.cs @@ -1,15 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Discovery; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Resources; - using Moq; +using MSTest.PlatformServices.Helpers; +using MSTest.PlatformServices.Resources; + using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Discovery; +namespace MSTest.PlatformServices.Discovery.UnitTests; public class TypeValidatorTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/UnitTestDiscovererTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Discovery/UnitTestDiscovererTests.cs similarity index 96% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/UnitTestDiscovererTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Discovery/UnitTestDiscovererTests.cs index 7d3163e924..72dabc9738 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/UnitTestDiscovererTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Discovery/UnitTestDiscovererTests.cs @@ -3,22 +3,20 @@ using AwesomeAssertions; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Discovery; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Resources; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.TestableImplementations; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using Moq; +using MSTest.PlatformServices.Interface; +using MSTest.PlatformServices.ObjectModel; +using MSTest.PlatformServices.Resources; +using MSTest.PlatformServices.UnitTests; + using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Discovery; +namespace MSTest.PlatformServices.Discovery.UnitTests; public class UnitTestDiscovererTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/ClassCleanupManagerTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/ClassCleanupManagerTests.cs similarity index 89% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/ClassCleanupManagerTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/ClassCleanupManagerTests.cs index 8c73c6340c..6854ebb19e 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/ClassCleanupManagerTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/ClassCleanupManagerTests.cs @@ -1,15 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; - using Moq; +using MSTest.PlatformServices.Helpers; +using MSTest.PlatformServices.ObjectModel; + using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution; +namespace MSTest.PlatformServices.Execution.UnitTests; public class ClassCleanupManagerTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TcmTestPropertiesProviderTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TcmTestPropertiesProviderTests.cs similarity index 97% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TcmTestPropertiesProviderTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TcmTestPropertiesProviderTests.cs index 320b2de9a5..9e805d13b7 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TcmTestPropertiesProviderTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TcmTestPropertiesProviderTests.cs @@ -1,13 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution; +namespace MSTest.PlatformServices.Execution.UnitTests; public class TcmTestPropertiesProviderTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestAssemblyInfoTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestAssemblyInfoTests.cs similarity index 82% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestAssemblyInfoTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestAssemblyInfoTests.cs index 09199f444c..05176ad9ea 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestAssemblyInfoTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestAssemblyInfoTests.cs @@ -1,17 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; - using Moq; +using MSTest.PlatformServices.ObjectModel; + using TestFramework.ForTestingMSTest; using UTF = Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution; +namespace MSTest.PlatformServices.Execution.UnitTests; public class TestAssemblyInfoTests : TestContainer { @@ -130,7 +128,7 @@ public void RunAssemblyInitializeShouldSetAssemblyInitializeExecutedFlag() public void RunAssemblyInitializeShouldSetAssemblyInitializationExceptionOnException() { - DummyTestClass.AssemblyInitializeMethodBody = _ => UTF.Assert.Inconclusive("Test Inconclusive"); + DummyTestClass.AssemblyInitializeMethodBody = _ => Assert.Inconclusive("Test Inconclusive"); _testAssemblyInfo.AssemblyInitializeMethod = typeof(DummyTestClass).GetMethod("AssemblyInitializeMethod")!; Exception exception = VerifyThrows(() => _testAssemblyInfo.RunAssemblyInitialize(_testContext)); @@ -140,34 +138,34 @@ public void RunAssemblyInitializeShouldSetAssemblyInitializationExceptionOnExcep public void RunAssemblyInitializeShouldThrowTestFailedExceptionOnAssertionFailure() { - DummyTestClass.AssemblyInitializeMethodBody = tc => UTF.Assert.Fail("Test failure"); + DummyTestClass.AssemblyInitializeMethodBody = tc => Assert.Fail("Test failure"); _testAssemblyInfo.AssemblyInitializeMethod = typeof(DummyTestClass).GetMethod("AssemblyInitializeMethod")!; TestFailedException exception = VerifyThrows(() => _testAssemblyInfo.RunAssemblyInitialize(_testContext)); Verify(exception.Outcome == UTF.UnitTestOutcome.Failed); Verify( exception.Message - == "Assembly Initialization method Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestAssemblyInfoTests+DummyTestClass.AssemblyInitializeMethod threw exception. Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException: Assert.Fail failed. Test failure. Aborting test execution."); + == "Assembly Initialization method MSTest.PlatformServices.Execution.UnitTests.TestAssemblyInfoTests+DummyTestClass.AssemblyInitializeMethod threw exception. Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException: Assert.Fail failed. Test failure. Aborting test execution."); #if DEBUG Verify(exception.StackTraceInformation!.ErrorStackTrace.Contains( - " at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestAssemblyInfoTests.<>c.", StringComparison.Ordinal)); + " at MSTest.PlatformServices.Execution.UnitTests.TestAssemblyInfoTests.<>c.", StringComparison.Ordinal)); #endif Verify(exception.InnerException!.GetType() == typeof(AssertFailedException)); } public void RunAssemblyInitializeShouldThrowTestFailedExceptionWithInconclusiveOnAssertInconclusive() { - DummyTestClass.AssemblyInitializeMethodBody = tc => UTF.Assert.Inconclusive("Test Inconclusive"); + DummyTestClass.AssemblyInitializeMethodBody = tc => Assert.Inconclusive("Test Inconclusive"); _testAssemblyInfo.AssemblyInitializeMethod = typeof(DummyTestClass).GetMethod("AssemblyInitializeMethod")!; TestFailedException exception = VerifyThrows(() => _testAssemblyInfo.RunAssemblyInitialize(_testContext)); Verify(exception.Outcome == UTF.UnitTestOutcome.Inconclusive); Verify( exception.Message - == "Assembly Initialization method Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestAssemblyInfoTests+DummyTestClass.AssemblyInitializeMethod threw exception. Microsoft.VisualStudio.TestTools.UnitTesting.AssertInconclusiveException: Assert.Inconclusive failed. Test Inconclusive. Aborting test execution."); + == "Assembly Initialization method MSTest.PlatformServices.Execution.UnitTests.TestAssemblyInfoTests+DummyTestClass.AssemblyInitializeMethod threw exception. Microsoft.VisualStudio.TestTools.UnitTesting.AssertInconclusiveException: Assert.Inconclusive failed. Test Inconclusive. Aborting test execution."); #if DEBUG Verify(exception.StackTraceInformation!.ErrorStackTrace.Contains( - " at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestAssemblyInfoTests.<>c.", StringComparison.Ordinal)); + " at MSTest.PlatformServices.Execution.UnitTests.TestAssemblyInfoTests.<>c.", StringComparison.Ordinal)); #endif Verify(exception.InnerException!.GetType() == typeof(AssertInconclusiveException)); } @@ -182,10 +180,10 @@ public void RunAssemblyInitializeShouldThrowTestFailedExceptionWithNonAssertExce Verify(exception.Outcome == UTF.UnitTestOutcome.Failed); Verify( exception.Message - == "Assembly Initialization method Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestAssemblyInfoTests+DummyTestClass.AssemblyInitializeMethod threw exception. System.ArgumentException: Some actualErrorMessage message. Aborting test execution."); + == "Assembly Initialization method MSTest.PlatformServices.Execution.UnitTests.TestAssemblyInfoTests+DummyTestClass.AssemblyInitializeMethod threw exception. System.ArgumentException: Some actualErrorMessage message. Aborting test execution."); #if DEBUG Verify(exception.StackTraceInformation!.ErrorStackTrace.StartsWith( - " at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestAssemblyInfoTests.<>c.", StringComparison.Ordinal)); + " at MSTest.PlatformServices.Execution.UnitTests.TestAssemblyInfoTests.<>c.", StringComparison.Ordinal)); #endif Verify(exception.InnerException!.GetType() == typeof(ArgumentException)); Verify(exception.InnerException.InnerException!.GetType() == typeof(InvalidOperationException)); @@ -205,10 +203,10 @@ public void RunAssemblyInitializeShouldThrowTheInnerMostExceptionWhenThereAreMul Verify(exception.Outcome == UTF.UnitTestOutcome.Failed); Verify( exception.Message - == "Assembly Initialization method Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestAssemblyInfoTests+DummyTestClass.AssemblyInitializeMethod threw exception. System.InvalidOperationException: I fail.. Aborting test execution."); + == "Assembly Initialization method MSTest.PlatformServices.Execution.UnitTests.TestAssemblyInfoTests+DummyTestClass.AssemblyInitializeMethod threw exception. System.InvalidOperationException: I fail.. Aborting test execution."); #if DEBUG Verify(exception.StackTraceInformation!.ErrorStackTrace.StartsWith( - " at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestAssemblyInfoTests.FailingStaticHelper..cctor()", StringComparison.Ordinal)); + " at MSTest.PlatformServices.Execution.UnitTests.TestAssemblyInfoTests.FailingStaticHelper..cctor()", StringComparison.Ordinal)); #endif Verify(exception.InnerException!.GetType() == typeof(InvalidOperationException)); } @@ -261,7 +259,7 @@ public void RunAssemblyCleanupShouldInvokeIfAssemblyCleanupMethod() public void RunAssemblyCleanupShouldReturnAssertFailureExceptionDetails() { - DummyTestClass.AssemblyCleanupMethodBody = () => UTF.Assert.Fail("Test Failure."); + DummyTestClass.AssemblyCleanupMethodBody = () => Assert.Fail("Test Failure."); _testAssemblyInfo.AssemblyCleanupMethod = typeof(DummyTestClass).GetMethod("AssemblyCleanupMethod")!; string? actualErrorMessage = _testAssemblyInfo.ExecuteAssemblyCleanup(GetTestContext())?.Message; @@ -273,7 +271,7 @@ public void RunAssemblyCleanupShouldReturnAssertFailureExceptionDetails() public void RunAssemblyCleanupShouldReturnAssertInconclusiveExceptionDetails() { - DummyTestClass.AssemblyCleanupMethodBody = () => UTF.Assert.Inconclusive("Test Inconclusive."); + DummyTestClass.AssemblyCleanupMethodBody = () => Assert.Inconclusive("Test Inconclusive."); _testAssemblyInfo.AssemblyCleanupMethod = typeof(DummyTestClass).GetMethod("AssemblyCleanupMethod")!; string? actualErrorMessage = _testAssemblyInfo.ExecuteAssemblyCleanup(GetTestContext())?.Message; @@ -306,7 +304,7 @@ public void RunAssemblyCleanupShouldThrowTheInnerMostExceptionWhenThereAreMultip string actualErrorMessage = _testAssemblyInfo.ExecuteAssemblyCleanup(GetTestContext())!.Message; Verify(actualErrorMessage.StartsWith("Assembly Cleanup method DummyTestClass.AssemblyCleanupMethod failed. Error Message: System.InvalidOperationException: I fail.. StackTrace:", StringComparison.Ordinal)); - Verify(actualErrorMessage.Contains("at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestAssemblyInfoTests.FailingStaticHelper..cctor()")); + Verify(actualErrorMessage.Contains("at MSTest.PlatformServices.Execution.UnitTests.TestAssemblyInfoTests.FailingStaticHelper..cctor()")); } private static TestContextImplementation GetTestContext() diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestAssemblySettingsProviderTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestAssemblySettingsProviderTests.cs similarity index 79% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestAssemblySettingsProviderTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestAssemblySettingsProviderTests.cs index 328091f21f..623b3bf299 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestAssemblySettingsProviderTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestAssemblySettingsProviderTests.cs @@ -1,17 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.TestableImplementations; - using Moq; +using MSTest.PlatformServices.ObjectModel; +using MSTest.PlatformServices.UnitTests; + using TestFramework.ForTestingMSTest; using ExecutionScope = Microsoft.VisualStudio.TestTools.UnitTesting.ExecutionScope; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution; +namespace MSTest.PlatformServices.Execution.UnitTests; public class TestAssemblySettingsProviderTests : TestContainer { @@ -43,7 +42,7 @@ public void GetSettingsShouldSetParallelWorkersToNegativeByDefault() .Returns(Assembly.GetExecutingAssembly()); // Act. - MSTest.TestAdapter.ObjectModel.TestAssemblySettings settings = new TestAssemblySettingsProvider().GetSettings("Foo"); + TestAssemblySettings settings = new TestAssemblySettingsProvider().GetSettings("Foo"); // Assert. Verify(settings.Workers == -1); @@ -62,7 +61,7 @@ public void GetSettingsShouldSetParallelWorkers() .Returns([new ParallelizeAttribute { Workers = 10 }]); // Act. - MSTest.TestAdapter.ObjectModel.TestAssemblySettings settings = new TestAssemblySettingsProvider().GetSettings("Foo"); + TestAssemblySettings settings = new TestAssemblySettingsProvider().GetSettings("Foo"); // Assert. Verify(settings.Workers == 10); @@ -81,7 +80,7 @@ public void GetSettingsShouldSetParallelWorkersToProcessorCountIfZero() .Returns([new ParallelizeAttribute { Workers = 0 }]); // Act. - MSTest.TestAdapter.ObjectModel.TestAssemblySettings settings = new TestAssemblySettingsProvider().GetSettings("Foo"); + TestAssemblySettings settings = new TestAssemblySettingsProvider().GetSettings("Foo"); // Assert. Verify(Environment.ProcessorCount == settings.Workers); @@ -96,7 +95,7 @@ public void GetSettingsShouldSetParallelScopeToClassLevelByDefault() .Returns(Assembly.GetExecutingAssembly()); // Act. - MSTest.TestAdapter.ObjectModel.TestAssemblySettings settings = new TestAssemblySettingsProvider().GetSettings("Foo"); + TestAssemblySettings settings = new TestAssemblySettingsProvider().GetSettings("Foo"); // Assert. Verify(settings.Scope == ExecutionScope.ClassLevel); @@ -115,7 +114,7 @@ public void GetSettingsShouldSetParallelScope() .Returns([new ParallelizeAttribute { Scope = ExecutionScope.MethodLevel }]); // Act. - MSTest.TestAdapter.ObjectModel.TestAssemblySettings settings = new TestAssemblySettingsProvider().GetSettings("Foo"); + TestAssemblySettings settings = new TestAssemblySettingsProvider().GetSettings("Foo"); // Assert. Verify(settings.Scope == ExecutionScope.MethodLevel); @@ -130,7 +129,7 @@ public void GetSettingsShouldSetCanParallelizeAssemblyToTrueByDefault() .Returns(Assembly.GetExecutingAssembly()); // Act. - MSTest.TestAdapter.ObjectModel.TestAssemblySettings settings = new TestAssemblySettingsProvider().GetSettings("Foo"); + TestAssemblySettings settings = new TestAssemblySettingsProvider().GetSettings("Foo"); // Assert. Verify(settings.CanParallelizeAssembly); @@ -149,7 +148,7 @@ public void GetSettingsShouldSetCanParallelizeAssemblyToFalseIfDoNotParallelizeI .Returns([new DoNotParallelizeAttribute()]); // Act. - MSTest.TestAdapter.ObjectModel.TestAssemblySettings settings = new TestAssemblySettingsProvider().GetSettings("Foo"); + TestAssemblySettings settings = new TestAssemblySettingsProvider().GetSettings("Foo"); // Assert. Verify(!settings.CanParallelizeAssembly); diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestCaseDiscoverySinkTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestCaseDiscoverySinkTests.cs similarity index 89% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestCaseDiscoverySinkTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestCaseDiscoverySinkTests.cs index 13575e5617..a719547517 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestCaseDiscoverySinkTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestCaseDiscoverySinkTests.cs @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution; +namespace MSTest.PlatformServices.Execution.UnitTests; public class TestCaseDiscoverySinkTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestClassInfoTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestClassInfoTests.cs similarity index 89% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestClassInfoTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestClassInfoTests.cs index 01e3514043..0fa5f0b4f1 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestClassInfoTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestClassInfoTests.cs @@ -1,18 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; - using Moq; +using MSTest.PlatformServices.Interface; +using MSTest.PlatformServices.ObjectModel; + using TestFramework.ForTestingMSTest; using UTF = Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution; +namespace MSTest.PlatformServices.Execution.UnitTests; public class TestClassInfoTests : TestContainer { @@ -262,7 +260,7 @@ public void RunClassInitializeShouldRunOnlyOnceIfThereIsNoDerivedClassInitialize public void RunClassInitializeShouldSetClassInitializationExceptionOnException() { - DummyTestClass.ClassInitializeMethodBody = tc => UTF.Assert.Inconclusive("Test Inconclusive"); + DummyTestClass.ClassInitializeMethodBody = tc => Assert.Inconclusive("Test Inconclusive"); _testClassInfo.ClassInitializeMethod = typeof(DummyTestClass).GetMethod("ClassInitializeMethod")!; var exception = GetResultOrRunClassInitialize().TestFailureException as TestFailedException; @@ -337,10 +335,10 @@ public void RunClassInitializeShouldThrowTestFailedExceptionOnBaseInitializeMeth Verify(exception.Outcome == UTF.UnitTestOutcome.Failed); Verify( exception.Message - == "Class Initialization method Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestClassInfoTests+DummyTestClass.InitBaseClassMethod threw exception. System.ArgumentException: Some exception message."); + == "Class Initialization method MSTest.PlatformServices.Execution.UnitTests.TestClassInfoTests+DummyTestClass.InitBaseClassMethod threw exception. System.ArgumentException: Some exception message."); #if DEBUG Verify(exception.StackTraceInformation!.ErrorStackTrace.StartsWith( - " at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestClassInfoTests.<>c.", StringComparison.Ordinal)); + " at MSTest.PlatformServices.Execution.UnitTests.TestClassInfoTests.<>c.", StringComparison.Ordinal)); #endif Verify(exception.InnerException!.GetType() == typeof(ArgumentException)); Verify(exception.InnerException.InnerException!.GetType() == typeof(InvalidOperationException)); @@ -348,7 +346,7 @@ public void RunClassInitializeShouldThrowTestFailedExceptionOnBaseInitializeMeth public void RunClassInitializeShouldThrowTestFailedExceptionOnAssertionFailure() { - DummyTestClass.ClassInitializeMethodBody = tc => UTF.Assert.Fail("Test failure"); + DummyTestClass.ClassInitializeMethodBody = tc => Assert.Fail("Test failure"); _testClassInfo.ClassInitializeMethod = typeof(DummyTestClass).GetMethod("ClassInitializeMethod")!; var exception = GetResultOrRunClassInitialize().TestFailureException as TestFailedException; @@ -357,17 +355,17 @@ public void RunClassInitializeShouldThrowTestFailedExceptionOnAssertionFailure() Verify(exception.Outcome == UTF.UnitTestOutcome.Failed); Verify( exception.Message - == "Class Initialization method Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestClassInfoTests+DummyTestClass.ClassInitializeMethod threw exception. Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException: Assert.Fail failed. Test failure."); + == "Class Initialization method MSTest.PlatformServices.Execution.UnitTests.TestClassInfoTests+DummyTestClass.ClassInitializeMethod threw exception. Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException: Assert.Fail failed. Test failure."); #if DEBUG Verify(exception.StackTraceInformation!.ErrorStackTrace.Contains( - " at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestClassInfoTests.<>c.", StringComparison.Ordinal)); + " at MSTest.PlatformServices.Execution.UnitTests.TestClassInfoTests.<>c.", StringComparison.Ordinal)); #endif Verify(exception.InnerException!.GetType() == typeof(AssertFailedException)); } public void RunClassInitializeShouldThrowTestFailedExceptionWithInconclusiveOnAssertInconclusive() { - DummyTestClass.ClassInitializeMethodBody = tc => UTF.Assert.Inconclusive("Test Inconclusive"); + DummyTestClass.ClassInitializeMethodBody = tc => Assert.Inconclusive("Test Inconclusive"); _testClassInfo.ClassInitializeMethod = typeof(DummyTestClass).GetMethod("ClassInitializeMethod")!; var exception = GetResultOrRunClassInitialize().TestFailureException as TestFailedException; @@ -376,10 +374,10 @@ public void RunClassInitializeShouldThrowTestFailedExceptionWithInconclusiveOnAs Verify(exception.Outcome == UTF.UnitTestOutcome.Inconclusive); Verify( exception.Message - == "Class Initialization method Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestClassInfoTests+DummyTestClass.ClassInitializeMethod threw exception. Microsoft.VisualStudio.TestTools.UnitTesting.AssertInconclusiveException: Assert.Inconclusive failed. Test Inconclusive."); + == "Class Initialization method MSTest.PlatformServices.Execution.UnitTests.TestClassInfoTests+DummyTestClass.ClassInitializeMethod threw exception. Microsoft.VisualStudio.TestTools.UnitTesting.AssertInconclusiveException: Assert.Inconclusive failed. Test Inconclusive."); #if DEBUG Verify(exception.StackTraceInformation!.ErrorStackTrace.Contains( - " at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestClassInfoTests.<>c.", StringComparison.Ordinal)); + " at MSTest.PlatformServices.Execution.UnitTests.TestClassInfoTests.<>c.", StringComparison.Ordinal)); #endif Verify(exception.InnerException!.GetType() == typeof(AssertInconclusiveException)); } @@ -395,10 +393,10 @@ public void RunClassInitializeShouldThrowTestFailedExceptionWithNonAssertExcepti Verify(exception.Outcome == UTF.UnitTestOutcome.Failed); Verify( exception.Message - == "Class Initialization method Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestClassInfoTests+DummyTestClass.ClassInitializeMethod threw exception. System.ArgumentException: Argument exception."); + == "Class Initialization method MSTest.PlatformServices.Execution.UnitTests.TestClassInfoTests+DummyTestClass.ClassInitializeMethod threw exception. System.ArgumentException: Argument exception."); #if DEBUG Verify(exception.StackTraceInformation!.ErrorStackTrace.StartsWith( - " at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestClassInfoTests.<>c.", StringComparison.Ordinal)); + " at MSTest.PlatformServices.Execution.UnitTests.TestClassInfoTests.<>c.", StringComparison.Ordinal)); #endif } @@ -437,11 +435,11 @@ public void RunClassInitializeShouldThrowTheInnerMostExceptionWhenThereAreMultip Verify(exception.Outcome == UTF.UnitTestOutcome.Failed); Verify( exception.Message - == "Class Initialization method Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestClassInfoTests+DummyTestClass.ClassInitializeMethod threw exception. System.InvalidOperationException: I fail.."); + == "Class Initialization method MSTest.PlatformServices.Execution.UnitTests.TestClassInfoTests+DummyTestClass.ClassInitializeMethod threw exception. System.InvalidOperationException: I fail.."); #if DEBUG Verify( exception.StackTraceInformation!.ErrorStackTrace.StartsWith( - " at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestClassInfoTests.FailingStaticHelper..cctor()", StringComparison.Ordinal)); + " at MSTest.PlatformServices.Execution.UnitTests.TestClassInfoTests.FailingStaticHelper..cctor()", StringComparison.Ordinal)); #endif Verify(exception.InnerException!.GetType() == typeof(InvalidOperationException)); } @@ -489,7 +487,7 @@ public void RunClassCleanupShouldNotInvokeIfClassCleanupIsNull() public void RunClassCleanupShouldReturnAssertFailureExceptionDetails() { // Arrange - DummyTestClass.ClassCleanupMethodBody = () => UTF.Assert.Fail("Test Failure"); + DummyTestClass.ClassCleanupMethodBody = () => Assert.Fail("Test Failure"); _testClassInfo.ClassCleanupMethod = typeof(DummyTestClass).GetMethod(nameof(DummyTestClass.ClassCleanupMethod)); // Act @@ -511,7 +509,7 @@ public void RunClassCleanupShouldReturnAssertFailureExceptionDetails() public void RunClassCleanupShouldReturnAssertInconclusiveExceptionDetails() { // Arrange - DummyTestClass.ClassCleanupMethodBody = () => UTF.Assert.Inconclusive("Test Inconclusive"); + DummyTestClass.ClassCleanupMethodBody = () => Assert.Inconclusive("Test Inconclusive"); _testClassInfo.ClassCleanupMethod = typeof(DummyTestClass).GetMethod(nameof(DummyTestClass.ClassCleanupMethod)); // Act @@ -614,7 +612,7 @@ public void RunClassCleanupShouldThrowTheInnerMostExceptionWhenThereAreMultipleN Verify(classCleanupException is not null); Verify(classCleanupException.Message.StartsWith("Class Cleanup method DummyTestClass.ClassCleanupMethod failed. Error Message: System.InvalidOperationException: I fail..", StringComparison.Ordinal)); - Verify(classCleanupException.Message.Contains("at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestClassInfoTests.FailingStaticHelper..cctor()")); + Verify(classCleanupException.Message.Contains("at MSTest.PlatformServices.Execution.UnitTests.TestClassInfoTests.FailingStaticHelper..cctor()")); } #endregion @@ -628,7 +626,7 @@ public class DummyGrandParentTestClass public TestContext BaseTestContext { get; set; } = null!; - [ClassInitialize(UTF.InheritanceBehavior.BeforeEachDerivedClass)] + [ClassInitialize(InheritanceBehavior.BeforeEachDerivedClass)] public static void InitClassMethod(TestContext testContext) => ClassInitMethodBody?.Invoke(testContext); public static void ClassCleanupMethod() => CleanupClassMethodBody?.Invoke(); @@ -643,7 +641,7 @@ public class DummyBaseTestClass : DummyGrandParentTestClass public TestContext TestContext { get; set; } = null!; - [ClassInitialize(UTF.InheritanceBehavior.BeforeEachDerivedClass)] + [ClassInitialize(InheritanceBehavior.BeforeEachDerivedClass)] public static void InitBaseClassMethod(TestContext testContext) => ClassInitializeMethodBody?.Invoke(testContext); public static void CleanupClassMethod() => ClassCleanupMethodBody?.Invoke(); diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestExecutionManagerTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestExecutionManagerTests.cs similarity index 98% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestExecutionManagerTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestExecutionManagerTests.cs index 42565e1582..a09e48dd1a 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestExecutionManagerTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestExecutionManagerTests.cs @@ -1,25 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Discovery; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.TestableImplementations; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using Moq; +using MSTest.PlatformServices.Discovery.UnitTests; +using MSTest.PlatformServices.Interface; +using MSTest.PlatformServices.ObjectModel; +using MSTest.PlatformServices.UnitTests; + using TestFramework.ForTestingMSTest; using ExecutionScope = Microsoft.VisualStudio.TestTools.UnitTesting.ExecutionScope; using TestResult = Microsoft.VisualStudio.TestPlatform.ObjectModel.TestResult; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution; +namespace MSTest.PlatformServices.Execution.UnitTests; public class TestExecutionManagerTests : TestContainer { @@ -419,8 +417,8 @@ public async Task RunTestsForMultipleSourcesShouldRunEachTestJustOnce() public void SendTestResultsShouldFillInDataRowIndexIfTestIsDataDriven() { var testCase = new TestCase("DummyTest", new Uri("executor://testExecutor"), Assembly.GetExecutingAssembly().Location); - TestTools.UnitTesting.TestResult unitTestResult1 = new() { DatarowIndex = 0, DisplayName = "DummyTest" }; - TestTools.UnitTesting.TestResult unitTestResult2 = new() { DatarowIndex = 1, DisplayName = "DummyTest" }; + Microsoft.VisualStudio.TestTools.UnitTesting.TestResult unitTestResult1 = new() { DatarowIndex = 0, DisplayName = "DummyTest" }; + Microsoft.VisualStudio.TestTools.UnitTesting.TestResult unitTestResult2 = new() { DatarowIndex = 1, DisplayName = "DummyTest" }; _testExecutionManager.SendTestResults(testCase, [unitTestResult1, unitTestResult2], default, default, _frameworkHandle); Verify(_frameworkHandle.TestDisplayNameList[0] == "DummyTest (Data Row 0)"); Verify(_frameworkHandle.TestDisplayNameList[1] == "DummyTest (Data Row 1)"); diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestMethodFilterTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestMethodFilterTests.cs similarity index 97% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestMethodFilterTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestMethodFilterTests.cs index 28f5710903..5de5404965 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestMethodFilterTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestMethodFilterTests.cs @@ -1,15 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution; +namespace MSTest.PlatformServices.Execution.UnitTests; public class TestMethodFilterTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestMethodInfoTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestMethodInfoTests.cs similarity index 95% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestMethodInfoTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestMethodInfoTests.cs index 9bc39d5494..9a662f3a63 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestMethodInfoTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestMethodInfoTests.cs @@ -1,21 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Resources; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.TestableImplementations; - using Moq; +using MSTest.PlatformServices.Interface; +using MSTest.PlatformServices.ObjectModel; +using MSTest.PlatformServices.Resources; +using MSTest.PlatformServices.UnitTests; + using TestFramework.ForTestingMSTest; using UTF = Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution; +namespace MSTest.PlatformServices.Execution.UnitTests; /// /// The test method info tests. @@ -119,7 +116,7 @@ public async Task TestMethodInfoInvokeAsyncShouldHandleThrowAssertInconclusive() public async Task TestMethodInfoInvokeAsyncShouldHandleAssertInconclusive() { - DummyTestClass.DummyAsyncTestMethodBody = () => Task.Run(() => UTF.Assert.Inconclusive()); + DummyTestClass.DummyAsyncTestMethodBody = () => Task.Run(() => Assert.Inconclusive()); MethodInfo asyncMethodInfo = typeof(DummyTestClass).GetMethod("DummyAsyncTestMethod")!; var method = new TestMethodInfo( @@ -157,7 +154,7 @@ public async Task TestMethodInfoInvokeShouldHandleThrowAssertInconclusive() public async Task TestMethodInfoInvokeShouldHandleAssertInconclusive() { - DummyTestClass.TestMethodBody = d => UTF.Assert.Inconclusive(); + DummyTestClass.TestMethodBody = d => Assert.Inconclusive(); MethodInfo dummyMethodInfo = typeof(DummyTestClass).GetMethod("DummyTestMethod")!; var method = new TestMethodInfo( @@ -315,7 +312,7 @@ public async Task TestMethodInfoInvokeShouldSetStackTraceInformationIfTestClassC Verify(exception.StackTraceInformation is not null); Verify( exception.StackTraceInformation.ErrorStackTrace.StartsWith( - " at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestMethodInfoTests.<>c.b__", StringComparison.Ordinal)); + " at MSTest.PlatformServices.Execution.UnitTests.TestMethodInfoTests.<>c.b__", StringComparison.Ordinal)); } public async Task TestMethodInfoInvokeShouldSetStackTraceInformationIfTestClassConstructorThrowsWithoutInnerException() @@ -456,7 +453,7 @@ public async Task TestMethodInfoInvokeShouldSetStackTraceInformationIfSetTestCon Verify(exception.StackTraceInformation is not null); Verify( exception.StackTraceInformation.ErrorStackTrace.StartsWith( - " at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestMethodInfoTests.<>c.b__", StringComparison.Ordinal)); + " at MSTest.PlatformServices.Execution.UnitTests.TestMethodInfoTests.<>c.b__", StringComparison.Ordinal)); } public async Task TestMethodInfoInvoke_WhenCtorHasOneParameterOfTypeTestContextAndTestContextProperty_InitializeBothTestContexts() @@ -577,7 +574,7 @@ public async Task TestMethodInfoInvokeWhenTestThrowsReturnsExpectedResult() Verify(exception.InnerException.InnerException!.GetType() == typeof(InvalidOperationException)); #if DEBUG Verify(exception.StackTraceInformation!.ErrorStackTrace.StartsWith( - " at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestMethodInfoTests.<>c.b__", StringComparison.Ordinal)); + " at MSTest.PlatformServices.Execution.UnitTests.TestMethodInfoTests.<>c.b__", StringComparison.Ordinal)); #endif } @@ -617,7 +614,7 @@ public async Task TestInitialize_WhenTestReturnsTaskFromException_DisplayProperE public async Task TestMethodInfoInvokeWhenTestThrowsAssertFailReturnsExpectedResult() { // Arrange. - DummyTestClass.TestInitializeMethodBody = classInstance => UTF.Assert.Fail("dummyFailMessage"); + DummyTestClass.TestInitializeMethodBody = classInstance => Assert.Fail("dummyFailMessage"); _testClassInfo.TestInitializeMethod = typeof(DummyTestClass).GetMethod("DummyTestInitializeMethod")!; string errorMessage = string.Format( CultureInfo.InvariantCulture, @@ -645,14 +642,14 @@ public async Task TestMethodInfoInvokeWhenTestThrowsAssertFailReturnsExpectedRes Verify(exception.InnerException!.GetType() == typeof(AssertFailedException)); #if DEBUG Verify(exception.StackTraceInformation!.ErrorStackTrace.Contains( - " at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestMethodInfoTests.<>c.b__", StringComparison.Ordinal)); + " at MSTest.PlatformServices.Execution.UnitTests.TestMethodInfoTests.<>c.b__", StringComparison.Ordinal)); #endif } public async Task TestMethodInfoInvokeWhenTestThrowsAssertInconclusiveReturnsExpectedResult() { // Arrange. - DummyTestClass.TestInitializeMethodBody = classInstance => UTF.Assert.Inconclusive("dummyFailMessage"); + DummyTestClass.TestInitializeMethodBody = classInstance => Assert.Inconclusive("dummyFailMessage"); _testClassInfo.TestInitializeMethod = typeof(DummyTestClass).GetMethod("DummyTestInitializeMethod")!; string errorMessage = string.Format( CultureInfo.InvariantCulture, @@ -680,7 +677,7 @@ public async Task TestMethodInfoInvokeWhenTestThrowsAssertInconclusiveReturnsExp Verify(exception.InnerException!.GetType() == typeof(AssertInconclusiveException)); #if DEBUG Verify(exception.StackTraceInformation!.ErrorStackTrace.Contains( - " at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestMethodInfoTests.<>c.b__", StringComparison.Ordinal)); + " at MSTest.PlatformServices.Execution.UnitTests.TestMethodInfoTests.<>c.b__", StringComparison.Ordinal)); #endif } @@ -830,13 +827,13 @@ public async Task TestMethodInfoInvokeWhenTestCleanupThrowsReturnsExpectedResult #if DEBUG Verify(exception.StackTraceInformation!.ErrorStackTrace.StartsWith( - " at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestMethodInfoTests.<>c.b__", StringComparison.Ordinal)); + " at MSTest.PlatformServices.Execution.UnitTests.TestMethodInfoTests.<>c.b__", StringComparison.Ordinal)); #endif } public async Task TestMethodInfoInvokeWhenTestCleanupThrowsAssertInconclusiveReturnsExpectedResult() { - DummyTestClass.TestCleanupMethodBody = classInstance => UTF.Assert.Inconclusive("Test inconclusive"); + DummyTestClass.TestCleanupMethodBody = classInstance => Assert.Inconclusive("Test inconclusive"); _testClassInfo.TestCleanupMethod = typeof(DummyTestClass).GetMethod("DummyTestCleanupMethod")!; string expectedErrorMessage = string.Format( @@ -857,13 +854,13 @@ public async Task TestMethodInfoInvokeWhenTestCleanupThrowsAssertInconclusiveRet Verify(exception.InnerException!.GetType() == typeof(AssertInconclusiveException)); #if DEBUG Verify(exception.StackTraceInformation!.ErrorStackTrace.Contains( - " at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestMethodInfoTests.<>c.b__", StringComparison.Ordinal)); + " at MSTest.PlatformServices.Execution.UnitTests.TestMethodInfoTests.<>c.b__", StringComparison.Ordinal)); #endif } public async Task TestMethodInfoInvokeWhenTestCleanupThrowsAssertFailedReturnsExpectedResult() { - DummyTestClass.TestCleanupMethodBody = classInstance => UTF.Assert.Fail("Test failed"); + DummyTestClass.TestCleanupMethodBody = classInstance => Assert.Fail("Test failed"); _testClassInfo.TestCleanupMethod = typeof(DummyTestClass).GetMethod("DummyTestCleanupMethod")!; string expectedErrorMessage = string.Format( @@ -884,7 +881,7 @@ public async Task TestMethodInfoInvokeWhenTestCleanupThrowsAssertFailedReturnsEx Verify(exception.InnerException!.GetType() == typeof(AssertFailedException)); #if DEBUG Verify(exception.StackTraceInformation!.ErrorStackTrace.Contains( - " at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestMethodInfoTests.<>c.b__", StringComparison.Ordinal)); + " at MSTest.PlatformServices.Execution.UnitTests.TestMethodInfoTests.<>c.b__", StringComparison.Ordinal)); #endif } @@ -927,8 +924,8 @@ public async Task TestMethodInfoInvokeShouldAppendStackTraceInformationIfBothTes Verify(result.Outcome == UTF.UnitTestOutcome.Failed); Verify(exception is not null); #if DEBUG - Verify(((TestFailedException)exception.InnerExceptions[0]).StackTraceInformation!.ErrorStackTrace.Contains("Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestMethodInfoTests.DummyTestClass.DummyTestMethod()")); - Verify(((TestFailedException)exception.InnerExceptions[1]).StackTraceInformation!.ErrorStackTrace.Contains("Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestMethodInfoTests.DummyTestClass.DummyTestCleanupMethod()")); + Verify(((TestFailedException)exception.InnerExceptions[0]).StackTraceInformation!.ErrorStackTrace.Contains("MSTest.PlatformServices.Execution.UnitTests.TestMethodInfoTests.DummyTestClass.DummyTestMethod()")); + Verify(((TestFailedException)exception.InnerExceptions[1]).StackTraceInformation!.ErrorStackTrace.Contains("MSTest.PlatformServices.Execution.UnitTests.TestMethodInfoTests.DummyTestClass.DummyTestCleanupMethod()")); #endif } diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestMethodRunnerTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestMethodRunnerTests.cs similarity index 96% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestMethodRunnerTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestMethodRunnerTests.cs index 20e554065c..c71a1328d8 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestMethodRunnerTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestMethodRunnerTests.cs @@ -1,22 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.TestableImplementations; using Microsoft.VisualStudio.TestTools.UnitTesting.Resources; using Moq; +using MSTest.PlatformServices.Helpers; +using MSTest.PlatformServices.Interface; +using MSTest.PlatformServices.ObjectModel; +using MSTest.PlatformServices.UnitTests; + using TestFramework.ForTestingMSTest; using UTF = Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution; +namespace MSTest.PlatformServices.Execution.UnitTests; public class TestMethodRunnerTests : TestContainer { @@ -104,7 +102,7 @@ public async Task ExecuteForPassingTestShouldReturnTestResultWithPassedOutcome() public async Task ExecuteShouldNotFillInDebugAndTraceLogsIfDebugTraceDisabled() { var testMethodInfo = new TestableTestMethodInfo(_methodInfo, _testClassInfo, _testMethodOptions, () => new TestResult { Outcome = UTF.UnitTestOutcome.Passed }); - var testMethodRunner = new TestMethodRunner(testMethodInfo, _testMethod, _testContextImplementation); + var testMethodRunner = new Execution.TestMethodRunner(testMethodInfo, _testMethod, _testContextImplementation); TestResult[] results = await testMethodRunner.ExecuteAsync(string.Empty, string.Empty, string.Empty, string.Empty); Verify(results[0].DebugTrace == string.Empty); @@ -322,7 +320,7 @@ public async Task RunTestMethodShouldFillInDisplayNameWithDataRowDisplayNameIfPr _testablePlatformServiceProvider.MockReflectionOperations.Setup(ro => ro.GetCustomAttributes(_methodInfo)).Returns(attributes); var testMethodInfo = new TestableTestMethodInfo(_methodInfo, _testClassInfo, _testMethodOptions, () => testResult); - var testMethodRunner = new TestMethodRunner(testMethodInfo, _testMethod, _testContextImplementation); + var testMethodRunner = new Execution.TestMethodRunner(testMethodInfo, _testMethod, _testContextImplementation); TestResult[] results = await testMethodRunner.RunTestMethodAsync(); diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestPropertyAttributeTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestPropertyAttributeTests.cs similarity index 88% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestPropertyAttributeTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestPropertyAttributeTests.cs index dfce4eac69..6046759324 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestPropertyAttributeTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TestPropertyAttributeTests.cs @@ -1,18 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.TestableImplementations; +using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Moq; +using MSTest.PlatformServices.Helpers; +using MSTest.PlatformServices.ObjectModel; +using MSTest.PlatformServices.UnitTests; + using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution; +namespace MSTest.PlatformServices.Execution.UnitTests; public class TestPropertyAttributeTests : TestContainer { @@ -60,7 +59,7 @@ public void GetTestMethodInfoShouldAddPropertiesFromContainingClassCorrectly() Assert.IsTrue(testContext.TryGetPropertyValue("DummyTestClassBaseKey2", out object? value3)); Assert.AreEqual("DummyTestClassBaseValue2", value3); - TestPlatform.ObjectModel.Trait[] traits = [.. ReflectHelper.Instance.GetTestPropertiesAsTraits(typeof(DummyTestClassBase).GetMethod(nameof(DummyTestClassBase.VirtualTestMethodInBaseAndDerived))!)]; + Trait[] traits = [.. ReflectHelper.Instance.GetTestPropertiesAsTraits(typeof(DummyTestClassBase).GetMethod(nameof(DummyTestClassBase.VirtualTestMethodInBaseAndDerived))!)]; Assert.AreEqual(3, traits.Length); Assert.AreEqual("TestMethodKeyFromBase", traits[0].Name); Assert.AreEqual("TestMethodValueFromBase", traits[0].Value); @@ -99,7 +98,7 @@ public void GetTestMethodInfoShouldAddPropertiesFromContainingClassAndBaseClasse Assert.IsTrue(testContext.TryGetPropertyValue("DummyTestClassBaseKey2", out object? value6)); Assert.AreEqual("DummyTestClassBaseValue2", value6); - TestPlatform.ObjectModel.Trait[] traits = [.. ReflectHelper.Instance.GetTestPropertiesAsTraits(typeof(DummyTestClassDerived).GetMethod(nameof(DummyTestClassDerived.VirtualTestMethodInBaseAndDerived))!)]; + Trait[] traits = [.. ReflectHelper.Instance.GetTestPropertiesAsTraits(typeof(DummyTestClassDerived).GetMethod(nameof(DummyTestClassDerived.VirtualTestMethodInBaseAndDerived))!)]; Assert.AreEqual(6, traits.Length); Assert.AreEqual("DerivedMethod1Key", traits[0].Name); Assert.AreEqual("DerivedMethod1Value", traits[0].Value); @@ -144,7 +143,7 @@ public void GetTestMethodInfoShouldAddPropertiesFromContainingClassAndBaseClasse Assert.IsTrue(testContext.TryGetPropertyValue("DummyTestClassBaseKey2", out object? value6)); Assert.AreEqual("DummyTestClassBaseValue2", value6); - TestPlatform.ObjectModel.Trait[] traits = [.. ReflectHelper.Instance.GetTestPropertiesAsTraits(typeof(DummyTestClassDerived).GetMethod(nameof(DummyTestClassDerived.VirtualTestMethodInDerivedButNotTestMethodInBase))!)]; + Trait[] traits = [.. ReflectHelper.Instance.GetTestPropertiesAsTraits(typeof(DummyTestClassDerived).GetMethod(nameof(DummyTestClassDerived.VirtualTestMethodInDerivedButNotTestMethodInBase))!)]; Assert.AreEqual(6, traits.Length); Assert.AreEqual("DerivedMethod2Key", traits[0].Name); Assert.AreEqual("DerivedMethod2Value", traits[0].Value); diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TypeCacheTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TypeCacheTests.cs similarity index 98% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TypeCacheTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TypeCacheTests.cs index a5613518d4..94d414a057 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TypeCacheTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/TypeCacheTests.cs @@ -1,21 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.TestableImplementations; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using Moq; -using TestFramework.ForTestingMSTest; +using MSTest.PlatformServices.Helpers; +using MSTest.PlatformServices.ObjectModel; +using MSTest.PlatformServices.UnitTests; -using static Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TestMethodInfoTests; +using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution; +namespace MSTest.PlatformServices.Execution.UnitTests; public class TypeCacheTests : TestContainer { @@ -114,7 +110,7 @@ void Action() => new TestContextImplementation(testMethod, null, new Dictionary())); TypeInspectionException exception = VerifyThrows(Action); - Verify(exception.Message.StartsWith("Cannot find a valid constructor for test class 'Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution.TypeCacheTests+DummyTestClassWithNoDefaultConstructor'. Valid constructors are 'public' and either parameterless or with one parameter of type 'TestContext'.", StringComparison.Ordinal)); + Verify(exception.Message.StartsWith("Cannot find a valid constructor for test class 'MSTest.PlatformServices.Execution.UnitTests.TypeCacheTests+DummyTestClassWithNoDefaultConstructor'. Valid constructors are 'public' and either parameterless or with one parameter of type 'TestContext'.", StringComparison.Ordinal)); } public void GetTestMethodInfoShouldThrowIfTestContextHasATypeMismatch() diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/UnitTestResultTest.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/UnitTestResultTest.cs similarity index 74% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/UnitTestResultTest.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/UnitTestResultTest.cs index 3242ccac01..5f7f0b15a2 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/UnitTestResultTest.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/UnitTestResultTest.cs @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; +using MSTest.PlatformServices.ObjectModel; using TestFramework.ForTestingMSTest; -using UnitTestOutcome = Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel.UnitTestOutcome; +using UnitTestOutcome = MSTest.PlatformServices.ObjectModel.UnitTestOutcome; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution; +namespace MSTest.PlatformServices.Execution.UnitTests; public class UnitTestResultTest : TestContainer { @@ -22,7 +22,7 @@ public void UnitTestResultConstructorWithOutcomeAndErrorMessageShouldSetRequired public void UnitTestResultConstructorWithTestFailedExceptionShouldSetRequiredFields() { var stackTrace = new StackTraceInformation("trace", "filePath", 2, 3); - TestFailedException ex = new(TestTools.UnitTesting.UnitTestOutcome.Error, "DummyMessage", stackTrace); + TestFailedException ex = new(Microsoft.VisualStudio.TestTools.UnitTesting.UnitTestOutcome.Error, "DummyMessage", stackTrace); UnitTestResult result = new(ex); diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/UnitTestRunnerTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/UnitTestRunnerTests.cs similarity index 97% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/UnitTestRunnerTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/UnitTestRunnerTests.cs index 2bcaf37c01..c0aba475da 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/UnitTestRunnerTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Execution/UnitTestRunnerTests.cs @@ -1,20 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.TestableImplementations; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using Moq; +using MSTest.PlatformServices.Helpers; +using MSTest.PlatformServices.ObjectModel; +using MSTest.PlatformServices.UnitTests; + using TestFramework.ForTestingMSTest; using UTF = Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Execution; +namespace MSTest.PlatformServices.Execution.UnitTests; public sealed class UnitTestRunnerTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Extensions/ExceptionExtensionsTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Extensions/ExceptionExtensionsTests.cs similarity index 96% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Extensions/ExceptionExtensionsTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Extensions/ExceptionExtensionsTests.cs index bf28034646..2c38535ddd 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Extensions/ExceptionExtensionsTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Extensions/ExceptionExtensionsTests.cs @@ -1,15 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Extensions; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Resources; +using MSTest.PlatformServices.ObjectModel; +using MSTest.PlatformServices.Resources; using TestFramework.ForTestingMSTest; using UTF = Microsoft.VisualStudio.TestTools.UnitTesting; -namespace MSTestAdapter.PlatformServices.Tests.Extensions; +namespace MSTest.PlatformServices.Extensions.UnitTests; public class ExceptionExtensionsTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Extensions/MethodInfoExtensionsTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Extensions/MethodInfoExtensionsTests.cs similarity index 92% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Extensions/MethodInfoExtensionsTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Extensions/MethodInfoExtensionsTests.cs index d330dc42e8..6cb79975c7 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Extensions/MethodInfoExtensionsTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Extensions/MethodInfoExtensionsTests.cs @@ -1,16 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Extensions; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Resources; +using MSTest.PlatformServices.ObjectModel; +using MSTest.PlatformServices.Resources; using TestFramework.ForTestingMSTest; using UTF = Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Extensions; +namespace MSTest.PlatformServices.Extensions.UnitTests; public class MethodInfoExtensionsTests : TestContainer { @@ -301,7 +299,7 @@ public void GetAsyncTypeNameShouldReturnNullForVoidMethods() public void GetAsyncTypeNameShouldReturnStateMachineTypeNameForAsyncMethods() { MethodInfo methodInfo = typeof(DummyTestClass).GetMethod("PublicAsyncVoidMethod")!; - Verify(methodInfo.GetAsyncTypeName()!.StartsWith("Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Extensions.MethodInfoExtensionsTests+DummyTestClass+", StringComparison.Ordinal)); + Verify(methodInfo.GetAsyncTypeName()!.StartsWith("MSTest.PlatformServices.Extensions.UnitTests.MethodInfoExtensionsTests+DummyTestClass+", StringComparison.Ordinal)); } #endregion @@ -358,7 +356,7 @@ public void InvokeAsSynchronousShouldThrowIfParametersWereExpectedButWereNotProv catch (TestFailedException ex) { Verify(ex.Outcome == UTF.UnitTestOutcome.Error); - Verify(ex.TryGetMessage() == string.Format(CultureInfo.InvariantCulture, Resource.CannotRunTestMethodNoDataError, "Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Extensions.MethodInfoExtensionsTests+DummyTestClass2", "PublicMethodWithParameters")); + Verify(ex.TryGetMessage() == string.Format(CultureInfo.InvariantCulture, Resource.CannotRunTestMethodNoDataError, "MSTest.PlatformServices.Extensions.UnitTests.MethodInfoExtensionsTests+DummyTestClass2", "PublicMethodWithParameters")); } } @@ -385,10 +383,10 @@ public void InvokeAsSynchronousShouldThrowIfParametersWereExpectedButIncorrectCo Verify(ex.Outcome == UTF.UnitTestOutcome.Error); // Error in English is: - // Cannot run test method 'Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Extensions.MethodInfoExtensionsTests+DummyTestClass2.PublicMethodWithParameters': Test data doesn't match method parameters. Either the count or types are different. + // Cannot run test method 'MSTest.PlatformServices.Extensions.UnitTests.MethodInfoExtensionsTests+DummyTestClass2.PublicMethodWithParameters': Test data doesn't match method parameters. Either the count or types are different. // Test expected 2 parameter(s), with types 'Int32, Int32', // but received 1 argument(s), with types 'Int32'. - Verify(ex.TryGetMessage() == string.Format(CultureInfo.InvariantCulture, Resource.CannotRunTestArgumentsMismatchError, "Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Extensions.MethodInfoExtensionsTests+DummyTestClass2", "PublicMethodWithParameters", + Verify(ex.TryGetMessage() == string.Format(CultureInfo.InvariantCulture, Resource.CannotRunTestArgumentsMismatchError, "MSTest.PlatformServices.Extensions.UnitTests.MethodInfoExtensionsTests+DummyTestClass2", "PublicMethodWithParameters", 2, "Int32, Int32", 1, "Int32")); } @@ -408,10 +406,10 @@ public void InvokeAsSynchronousShouldThrowIfParametersWereExpectedButIncorrectTy Verify(ex.Outcome == UTF.UnitTestOutcome.Error); // Error in English is: - // Cannot run test method 'Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Extensions.MethodInfoExtensionsTests+DummyTestClass2.PublicMethodWithParameters': Test data doesn't match method parameters. Either the count or types are different. + // Cannot run test method 'MSTest.PlatformServices.Extensions.UnitTests.MethodInfoExtensionsTests+DummyTestClass2.PublicMethodWithParameters': Test data doesn't match method parameters. Either the count or types are different. // Test expected 2 parameter(s), with types 'Int32, Int32', // but received 2 argument(s), with types 'String, String'. - Verify(ex.TryGetMessage() == string.Format(CultureInfo.InvariantCulture, Resource.CannotRunTestArgumentsMismatchError, "Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Extensions.MethodInfoExtensionsTests+DummyTestClass2", "PublicMethodWithParameters", + Verify(ex.TryGetMessage() == string.Format(CultureInfo.InvariantCulture, Resource.CannotRunTestArgumentsMismatchError, "MSTest.PlatformServices.Extensions.UnitTests.MethodInfoExtensionsTests+DummyTestClass2", "PublicMethodWithParameters", 2, "Int32, Int32", 2, "String, String")); } diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Extensions/TestCaseExtensionsTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Extensions/TestCaseExtensionsTests.cs similarity index 92% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Extensions/TestCaseExtensionsTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Extensions/TestCaseExtensionsTests.cs index 1c8ad83b56..223304774d 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Extensions/TestCaseExtensionsTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Extensions/TestCaseExtensionsTests.cs @@ -1,13 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Extensions; +namespace MSTest.PlatformServices.Extensions.UnitTests; public class TestCaseExtensionsTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Extensions/TestContextExtensionsTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Extensions/TestContextExtensionsTests.cs similarity index 82% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Extensions/TestContextExtensionsTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Extensions/TestContextExtensionsTests.cs index e91d40a89f..413e94f877 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Extensions/TestContextExtensionsTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Extensions/TestContextExtensionsTests.cs @@ -1,14 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; - using Moq; +using MSTest.PlatformServices.Interface; + using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Extensions; +namespace MSTest.PlatformServices.Extensions.UnitTests; public class TestContextExtensionsTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Extensions/TestResultExtensionsTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Extensions/TestResultExtensionsTests.cs similarity index 95% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Extensions/TestResultExtensionsTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Extensions/TestResultExtensionsTests.cs index 28f878600d..e70ed629b9 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Extensions/TestResultExtensionsTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Extensions/TestResultExtensionsTests.cs @@ -1,16 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; - using TestFramework.ForTestingMSTest; using UTF = Microsoft.VisualStudio.TestTools.UnitTesting; using VSTestTestOutcome = Microsoft.VisualStudio.TestPlatform.ObjectModel.TestOutcome; using VSTestTestResultMessage = Microsoft.VisualStudio.TestPlatform.ObjectModel.TestResultMessage; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Extensions; +namespace MSTest.PlatformServices.Extensions.UnitTests; public class TestResultExtensionsTests : TestContainer { @@ -24,7 +21,7 @@ public void ToUnitTestResultsForTestResultWithExceptionConvertsToUnitTestResults public void ToUnitTestResultsForTestResultWithExceptionConvertsToUnitTestResultsWithInconclusiveOutcome() { - var result = new TestResult { TestFailureException = new Exception(), Outcome = UTF.UnitTestOutcome.Inconclusive }; + var result = new TestResult { TestFailureException = new Exception(), Outcome = UnitTestOutcome.Inconclusive }; var convertedResult = result.ToTestResult(new(), default, default, string.Empty, new()); Verify(convertedResult.Outcome == VSTestTestOutcome.Skipped); diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Extensions/UnitTestOutcomeExtensionsTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Extensions/UnitTestOutcomeExtensionsTests.cs similarity index 60% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Extensions/UnitTestOutcomeExtensionsTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Extensions/UnitTestOutcomeExtensionsTests.cs index 86bc0fb6cb..2932b642ee 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Extensions/UnitTestOutcomeExtensionsTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Extensions/UnitTestOutcomeExtensionsTests.cs @@ -1,20 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions; - using TestFramework.ForTestingMSTest; -using AdapterTestOutcome = Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel.UnitTestOutcome; +using AdapterTestOutcome = MSTest.PlatformServices.ObjectModel.UnitTestOutcome; using UTF = Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Extensions; +namespace MSTest.PlatformServices.Extensions.UnitTests; public class UnitTestOutcomeExtensionsTests : TestContainer { public void ToUnitTestOutComeForPassedTestResultsConvertsToPassedUnitTestOutCome() { - UnitTestOutcome frameworkOutcome = UTF.UnitTestOutcome.Passed; + UnitTestOutcome frameworkOutcome = UnitTestOutcome.Passed; var convertedOutcome = frameworkOutcome.ToUnitTestOutcome(); Verify(convertedOutcome == AdapterTestOutcome.Passed); @@ -22,7 +20,7 @@ public void ToUnitTestOutComeForPassedTestResultsConvertsToPassedUnitTestOutCome public void ToUnitTestResultsForFailedTestResultsConvertsToFailedUnitTestResults() { - UnitTestOutcome frameworkOutcome = UTF.UnitTestOutcome.Failed; + UnitTestOutcome frameworkOutcome = UnitTestOutcome.Failed; var convertedOutcome = frameworkOutcome.ToUnitTestOutcome(); Verify(convertedOutcome == AdapterTestOutcome.Failed); @@ -30,7 +28,7 @@ public void ToUnitTestResultsForFailedTestResultsConvertsToFailedUnitTestResults public void ToUnitTestResultsForInProgressTestResultsConvertsToInProgressUnitTestResults() { - UnitTestOutcome frameworkOutcome = UTF.UnitTestOutcome.InProgress; + UnitTestOutcome frameworkOutcome = UnitTestOutcome.InProgress; var convertedOutcome = frameworkOutcome.ToUnitTestOutcome(); Verify(convertedOutcome == AdapterTestOutcome.InProgress); @@ -38,7 +36,7 @@ public void ToUnitTestResultsForInProgressTestResultsConvertsToInProgressUnitTes public void ToUnitTestResultsForInconclusiveTestResultsConvertsToInconclusiveUnitTestResults() { - UnitTestOutcome frameworkOutcome = UTF.UnitTestOutcome.Inconclusive; + UnitTestOutcome frameworkOutcome = UnitTestOutcome.Inconclusive; var convertedOutcome = frameworkOutcome.ToUnitTestOutcome(); Verify(convertedOutcome == AdapterTestOutcome.Inconclusive); @@ -46,7 +44,7 @@ public void ToUnitTestResultsForInconclusiveTestResultsConvertsToInconclusiveUni public void ToUnitTestResultsForTimeoutTestResultsConvertsToTimeoutUnitTestResults() { - UnitTestOutcome frameworkOutcome = UTF.UnitTestOutcome.Timeout; + UnitTestOutcome frameworkOutcome = UnitTestOutcome.Timeout; var convertedOutcome = frameworkOutcome.ToUnitTestOutcome(); Verify(convertedOutcome == AdapterTestOutcome.Timeout); @@ -54,7 +52,7 @@ public void ToUnitTestResultsForTimeoutTestResultsConvertsToTimeoutUnitTestResul public void ToUnitTestResultsForUnknownTestResultsConvertsToErrorUnitTestResults() { - UnitTestOutcome frameworkOutcome = UTF.UnitTestOutcome.Unknown; + UnitTestOutcome frameworkOutcome = UnitTestOutcome.Unknown; var convertedOutcome = frameworkOutcome.ToUnitTestOutcome(); Verify(convertedOutcome == AdapterTestOutcome.Error); @@ -62,25 +60,25 @@ public void ToUnitTestResultsForUnknownTestResultsConvertsToErrorUnitTestResults public void GetMoreImportantOutcomeShouldReturnFailIfTwoOutcomesAreFailedAndInconclusive() { - UnitTestOutcome resultOutcome = UTF.UnitTestOutcome.Failed.GetMoreImportantOutcome(UTF.UnitTestOutcome.Inconclusive); - Verify(resultOutcome == UTF.UnitTestOutcome.Failed); + UnitTestOutcome resultOutcome = UnitTestOutcome.Failed.GetMoreImportantOutcome(UnitTestOutcome.Inconclusive); + Verify(resultOutcome == UnitTestOutcome.Failed); } public void GetMoreImportantOutcomeShouldReturnInconclusiveIfTwoOutcomesArePassedAndInconclusive() { - UnitTestOutcome resultOutcome = UTF.UnitTestOutcome.Passed.GetMoreImportantOutcome(UTF.UnitTestOutcome.Inconclusive); - Verify(resultOutcome == UTF.UnitTestOutcome.Inconclusive); + UnitTestOutcome resultOutcome = UnitTestOutcome.Passed.GetMoreImportantOutcome(UnitTestOutcome.Inconclusive); + Verify(resultOutcome == UnitTestOutcome.Inconclusive); } public void GetMoreImportantOutcomeShouldReturnFailedIfTwoOutcomesArePassedAndFailed() { - UnitTestOutcome resultOutcome = UTF.UnitTestOutcome.Passed.GetMoreImportantOutcome(UTF.UnitTestOutcome.Failed); - Verify(resultOutcome == UTF.UnitTestOutcome.Failed); + UnitTestOutcome resultOutcome = UnitTestOutcome.Passed.GetMoreImportantOutcome(UnitTestOutcome.Failed); + Verify(resultOutcome == UnitTestOutcome.Failed); } public void GetMoreImportantOutcomeShouldReturnFailedIfBothOutcomesAreFailed() { - UnitTestOutcome resultOutcome = UTF.UnitTestOutcome.Failed.GetMoreImportantOutcome(UTF.UnitTestOutcome.Failed); - Verify(resultOutcome == UTF.UnitTestOutcome.Failed); + UnitTestOutcome resultOutcome = UnitTestOutcome.Failed.GetMoreImportantOutcome(UnitTestOutcome.Failed); + Verify(resultOutcome == UnitTestOutcome.Failed); } } diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/DataSerializationHelperTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Helpers/DataSerializationHelperTests.cs similarity index 95% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/DataSerializationHelperTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Helpers/DataSerializationHelperTests.cs index 1b7e4aa18e..0a36e4aa13 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/DataSerializationHelperTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Helpers/DataSerializationHelperTests.cs @@ -1,11 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; - using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests; +namespace MSTest.PlatformServices.Helpers.UnitTests; public class DataSerializationHelperTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/DictionaryHelperTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Helpers/DictionaryHelperTests.cs similarity index 95% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/DictionaryHelperTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Helpers/DictionaryHelperTests.cs index b358cf4fc6..558de499e7 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/DictionaryHelperTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Helpers/DictionaryHelperTests.cs @@ -1,11 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; - using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests; +namespace MSTest.PlatformServices.Helpers.UnitTests; public class DictionaryHelperTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/ReflectHelperTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Helpers/ReflectHelperTests.cs similarity index 97% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/ReflectHelperTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Helpers/ReflectHelperTests.cs index a511801a52..cca2e8a263 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/ReflectHelperTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Helpers/ReflectHelperTests.cs @@ -1,16 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.TestableImplementations; - using Moq; +using MSTest.PlatformServices.Interface; +using MSTest.PlatformServices.UnitTests; + using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests; +namespace MSTest.PlatformServices.Helpers.UnitTests; public class ReflectHelperTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/RunSettingsUtilitiesTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Helpers/RunSettingsUtilitiesTests.cs similarity index 97% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/RunSettingsUtilitiesTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Helpers/RunSettingsUtilitiesTests.cs index 3507db1027..531f7ef09c 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/RunSettingsUtilitiesTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Helpers/RunSettingsUtilitiesTests.cs @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Helpers; +namespace MSTest.PlatformServices.Helpers.UnitTests; public class RunSettingsUtilitiesTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/TestDataSourceHelpersTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Helpers/TestDataSourceHelpersTests.cs similarity index 95% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/TestDataSourceHelpersTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Helpers/TestDataSourceHelpersTests.cs index c470744a70..5d212ca625 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/TestDataSourceHelpersTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Helpers/TestDataSourceHelpersTests.cs @@ -1,11 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; - using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.UnitTests.Helpers; +namespace MSTest.PlatformServices.Helpers.UnitTests; public class TestDataSourceHelpersTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/UnitTestOutcomeHelperTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Helpers/UnitTestOutcomeHelperTests.cs similarity index 94% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/UnitTestOutcomeHelperTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Helpers/UnitTestOutcomeHelperTests.cs index a4600fe44a..b3152687e5 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/UnitTestOutcomeHelperTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Helpers/UnitTestOutcomeHelperTests.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; @@ -10,7 +8,7 @@ using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.Helpers; +namespace MSTest.PlatformServices.Helpers.UnitTests; public class UnitTestOutcomeHelperTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/MSTestAdapter.PlatformServices.UnitTests.csproj b/test/UnitTests/MSTest.PlatformServices.UnitTests/MSTest.PlatformServices.UnitTests.csproj similarity index 93% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/MSTestAdapter.PlatformServices.UnitTests.csproj rename to test/UnitTests/MSTest.PlatformServices.UnitTests/MSTest.PlatformServices.UnitTests.csproj index 07e0524722..d9554859bb 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/MSTestAdapter.PlatformServices.UnitTests.csproj +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/MSTest.PlatformServices.UnitTests.csproj @@ -24,7 +24,7 @@ - + diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/MSTestSettingsTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/MSTestSettingsTests.cs similarity index 99% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/MSTestSettingsTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/MSTestSettingsTests.cs index 263abf4ef3..d963dfd4f5 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/MSTestSettingsTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/MSTestSettingsTests.cs @@ -1,22 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Resources; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.TestableImplementations; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using Moq; +using MSTest.PlatformServices.Interface; +using MSTest.PlatformServices.ObjectModel; +using MSTest.PlatformServices.Resources; + using TestFramework.ForTestingMSTest; using ExecutionScope = Microsoft.VisualStudio.TestTools.UnitTesting.ExecutionScope; #pragma warning disable CS0618 // Type or member is obsolete -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests; +namespace MSTest.PlatformServices.UnitTests; public class MSTestSettingsTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/ObjectModel/UnitTestElementTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/ObjectModel/UnitTestElementTests.cs similarity index 97% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/ObjectModel/UnitTestElementTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/ObjectModel/UnitTestElementTests.cs index a29caf0c37..02fa176e1e 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/ObjectModel/UnitTestElementTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/ObjectModel/UnitTestElementTests.cs @@ -1,15 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Polyfills; using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.ObjectModel; +namespace MSTest.PlatformServices.ObjectModel.UnitTests; public class UnitTestElementTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/ObjectModel/UnitTestResultTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/ObjectModel/UnitTestResultTests.cs similarity index 94% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/ObjectModel/UnitTestResultTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/ObjectModel/UnitTestResultTests.cs index 5087c66a1b..f26490b774 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/ObjectModel/UnitTestResultTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/ObjectModel/UnitTestResultTests.cs @@ -1,20 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using Moq; +using MSTest.PlatformServices.Helpers; + using TestFramework.ForTestingMSTest; -using UnitTestOutcome = Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel.UnitTestOutcome; using UTF = Microsoft.VisualStudio.TestTools.UnitTesting; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.ObjectModel; +namespace MSTest.PlatformServices.ObjectModel.UnitTests; public class UnitTestResultTests : TestContainer { @@ -31,7 +29,7 @@ public void UnitTestResultConstructorWithOutcomeAndErrorMessageShouldSetRequired public void UnitTestResultConstructorWithTestFailedExceptionShouldSetRequiredFields() { var stackTrace = new StackTraceInformation("trace", "filePath", 2, 3); - TestFailedException ex = new(TestTools.UnitTesting.UnitTestOutcome.Error, "DummyMessage", stackTrace); + TestFailedException ex = new(UTF.UnitTestOutcome.Error, "DummyMessage", stackTrace); UnitTestResult result = new(ex); diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/PlatformServiceProviderTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/PlatformServiceProviderTests.cs similarity index 74% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/PlatformServiceProviderTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/PlatformServiceProviderTests.cs index fe76d118b5..610c7cd9f5 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/PlatformServiceProviderTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/PlatformServiceProviderTests.cs @@ -1,15 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.TestableImplementations; - using Moq; +using MSTest.PlatformServices.Interface; + using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests; +namespace MSTest.PlatformServices.UnitTests; public class PlatformServiceProviderTests : TestContainer { @@ -38,7 +36,7 @@ public void ProviderServiceInstanceShouldReturnTheInstanceSet() public void ReflectionOperationsShouldBeCached() { - PlatformServices.Interface.IReflectionOperations reflectionOperationsInstance = PlatformServiceProvider.Instance.ReflectionOperations; + IReflectionOperations reflectionOperationsInstance = PlatformServiceProvider.Instance.ReflectionOperations; Verify(reflectionOperationsInstance is not null); Verify(reflectionOperationsInstance == PlatformServiceProvider.Instance.ReflectionOperations); @@ -47,13 +45,13 @@ public void ReflectionOperationsShouldBeCached() public void GetTestContextShouldReturnAValidTestContext() { // Arrange. - var testMethod = new Mock(); + var testMethod = new Mock(); var properties = new Dictionary { { "prop", "value" } }; testMethod.Setup(tm => tm.FullClassName).Returns("A.C.M"); testMethod.Setup(tm => tm.Name).Returns("M"); // Act. - PlatformServices.Interface.ITestContext testContext = PlatformServiceProvider.Instance.GetTestContext(testMethod.Object, null, properties, null!, default); + ITestContext testContext = PlatformServiceProvider.Instance.GetTestContext(testMethod.Object, null, properties, null!, default); // Assert. Verify(testContext.Context.FullyQualifiedTestClassName == "A.C.M"); diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Program.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Program.cs similarity index 100% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Program.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Program.cs diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Properties/AssemblyInfo.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Properties/AssemblyInfo.cs similarity index 90% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Properties/AssemblyInfo.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Properties/AssemblyInfo.cs index e18b7f7fbe..19b3d8396e 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Properties/AssemblyInfo.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Properties/AssemblyInfo.cs @@ -2,7 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. #if NETFRAMEWORK -using MSTestAdapter.PlatformServices.UnitTests.Utilities; +using MSTest.PlatformServices.Utilities.UnitTests; // Custom attributes for tests. [assembly: ReflectionUtilityTests.DummyA("a1")] @@ -10,8 +10,8 @@ #endif #if NETCOREAPP -using MSTestAdapter.PlatformServices.Tests.Services; -using MSTestAdapter.PlatformServices.Tests.Utilities; +using MSTest.PlatformServices.Tests.Services; +using MSTest.PlatformServices.Utilities.UnitTests; [assembly: ReflectionUtilityTests.DummyA("a1")] [assembly: ReflectionUtilityTests.DummyA("a2")] diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/RunConfigurationSettingsTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/RunConfigurationSettingsTests.cs similarity index 94% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/RunConfigurationSettingsTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/RunConfigurationSettingsTests.cs index c8b8aa60a2..9c25d87311 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/RunConfigurationSettingsTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/RunConfigurationSettingsTests.cs @@ -1,17 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.TestableImplementations; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using Moq; +using MSTest.PlatformServices.Interface; + using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests; +namespace MSTest.PlatformServices.UnitTests; public class RunConfigurationSettingsTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/DesktopReflectionOperationsTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/DesktopReflectionOperationsTests.cs similarity index 91% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/DesktopReflectionOperationsTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Services/DesktopReflectionOperationsTests.cs index 0b867956a9..7fcacefac8 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/DesktopReflectionOperationsTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/DesktopReflectionOperationsTests.cs @@ -2,13 +2,11 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. #if NETFRAMEWORK -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; - -using MSTestAdapter.PlatformServices.UnitTests.Utilities; +using MSTest.PlatformServices.Utilities.UnitTests; using TestFramework.ForTestingMSTest; -namespace MSTestAdapter.PlatformServices.UnitTests.Services; +namespace MSTest.PlatformServices.Services.UnitTests; public class DesktopReflectionOperationsTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/DesktopTestDataSourceTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/DesktopTestDataSourceTests.cs similarity index 93% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/DesktopTestDataSourceTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Services/DesktopTestDataSourceTests.cs index 4b7ebe5ae1..5b84e10c0f 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/DesktopTestDataSourceTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/DesktopTestDataSourceTests.cs @@ -4,16 +4,15 @@ #if NETFRAMEWORK using System.Data; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; - using Moq; +using MSTest.PlatformServices.Interface; + using TestFramework.ForTestingMSTest; using ITestMethod = Microsoft.VisualStudio.TestTools.UnitTesting.ITestMethod; -namespace MSTestAdapter.PlatformServices.UnitTests.Services; +namespace MSTest.PlatformServices.Services.UnitTests; public class DesktopTestDataSourceTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/DesktopTestDeploymentTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/DesktopTestDeploymentTests.cs similarity index 95% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/DesktopTestDeploymentTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Services/DesktopTestDeploymentTests.cs index 16830cce27..a5c7610acb 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/DesktopTestDeploymentTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/DesktopTestDeploymentTests.cs @@ -2,19 +2,19 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. #if NETFRAMEWORK -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Deployment; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Moq; -using MSTestAdapter.PlatformServices.Tests.Utilities; +using MSTest.PlatformServices; +using MSTest.PlatformServices.Deployment; +using MSTest.PlatformServices.Utilities; +using MSTest.PlatformServices.Utilities.UnitTests; using TestFramework.ForTestingMSTest; -namespace MSTestAdapter.PlatformServices.UnitTests.Services; +namespace MSTest.PlatformServices.UnitTests; public class DesktopTestDeploymentTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/DesktopTestSourceHostTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/DesktopTestSourceHostTests.cs similarity index 97% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/DesktopTestSourceHostTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Services/DesktopTestSourceHostTests.cs index a80aefe8f9..1a01023037 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/DesktopTestSourceHostTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/DesktopTestSourceHostTests.cs @@ -4,16 +4,16 @@ #if NETFRAMEWORK using System.Security.Policy; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities; using Moq; +using MSTest.PlatformServices.Utilities; + using TestFramework.ForTestingMSTest; -namespace MSTestAdapter.PlatformServices.UnitTests; +namespace MSTest.PlatformServices.UnitTests; public class DesktopTestSourceHostTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/DesktopTestSourceTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/DesktopTestSourceTests.cs similarity index 92% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/DesktopTestSourceTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Services/DesktopTestSourceTests.cs index 84f72290ca..e2833b4600 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/DesktopTestSourceTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/DesktopTestSourceTests.cs @@ -2,11 +2,9 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. #if NETFRAMEWORK -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; - using TestFramework.ForTestingMSTest; -namespace MSTestAdapter.PlatformServices.UnitTests; +namespace MSTest.PlatformServices.UnitTests; public class DesktopTestSourceTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/DesktopThreadOperationsTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/DesktopThreadOperationsTests.cs similarity index 92% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/DesktopThreadOperationsTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Services/DesktopThreadOperationsTests.cs index 50142b5856..53a339c249 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/DesktopThreadOperationsTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/DesktopThreadOperationsTests.cs @@ -2,12 +2,9 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. #if NETFRAMEWORK - -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; - using TestFramework.ForTestingMSTest; -namespace MSTestAdapter.PlatformServices.UnitTests.Services; +namespace MSTest.PlatformServices.Services.UnitTests; public class DesktopThreadOperationsTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/FileOperationsTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/FileOperationsTests.cs similarity index 95% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/FileOperationsTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Services/FileOperationsTests.cs index e217a12bcf..5869895496 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/FileOperationsTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/FileOperationsTests.cs @@ -2,11 +2,9 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. #if !NETFRAMEWORK -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; - using TestFramework.ForTestingMSTest; -namespace MSTestAdapter.PlatformServices.Tests.Services; +namespace MSTest.PlatformServices.Tests.Services; public class FileOperationsTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/MSTestAdapterSettingsTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/MSTestAdapterSettingsTests.cs similarity index 98% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/MSTestAdapterSettingsTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Services/MSTestAdapterSettingsTests.cs index 74b6be51e0..c9c6c5c069 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/MSTestAdapterSettingsTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/MSTestAdapterSettingsTests.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities; using Moq; +using MSTest.PlatformServices.Interface; + using TestFramework.ForTestingMSTest; -namespace MSTestAdapter.PlatformServices.UnitTests; +namespace MSTest.PlatformServices.UnitTests; #pragma warning disable SA1649 // File name must match first type name public class MSTestAdapterSettingsTests : TestContainer diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/MSTestSettingsProviderTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/MSTestSettingsProviderTests.cs similarity index 93% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/MSTestSettingsProviderTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Services/MSTestSettingsProviderTests.cs index 874367ce73..1aa56e3626 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/MSTestSettingsProviderTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/MSTestSettingsProviderTests.cs @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities; +using MSTest.PlatformServices.Interface; + using TestFramework.ForTestingMSTest; -namespace MSTestAdapter.PlatformServices.UnitTests.Services; +namespace MSTest.PlatformServices.UnitTests; #pragma warning disable SA1649 // File name must match first type name public class DesktopSettingsProviderTests : TestContainer diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/ReflectionOperationsTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/ReflectionOperationsTests.cs similarity index 98% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/ReflectionOperationsTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Services/ReflectionOperationsTests.cs index d5d58ad8bb..b5bf029045 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/ReflectionOperationsTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/ReflectionOperationsTests.cs @@ -1,11 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; - using TestFramework.ForTestingMSTest; -namespace MSTestAdapter.PlatformServices.Tests.Services; +namespace MSTest.PlatformServices.Tests.Services; public class ReflectionOperationsTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/TestContextImplementationTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/TestContextImplementationTests.cs similarity index 97% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/TestContextImplementationTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Services/TestContextImplementationTests.cs index 75c6176650..3cd5ecd63e 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/TestContextImplementationTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/TestContextImplementationTests.cs @@ -6,18 +6,18 @@ using System.Data.Common; #endif -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Resources; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using Moq; +using MSTest.PlatformServices.Resources; + using TestFramework.ForTestingMSTest; -using ITestMethod = Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.ObjectModel.ITestMethod; +using ITestMethod = MSTest.PlatformServices.Interface.ObjectModel.ITestMethod; using UnitTestOutcome = Microsoft.VisualStudio.TestTools.UnitTesting.UnitTestOutcome; -namespace MSTestAdapter.PlatformServices.UnitTests.Services; +namespace MSTest.PlatformServices.Services.UnitTests; public class TestContextImplementationTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/TestDeploymentTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/TestDeploymentTests.cs similarity index 97% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/TestDeploymentTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Services/TestDeploymentTests.cs index 8f29f84e33..da8bd9a9a1 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/TestDeploymentTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/TestDeploymentTests.cs @@ -1,21 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Deployment; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities; using Moq; -using MSTestAdapter.PlatformServices.Tests.Utilities; -using MSTestAdapter.PlatformServices.UnitTests.Utilities; +using MSTest.PlatformServices.Deployment; +using MSTest.PlatformServices.Utilities; +using MSTest.PlatformServices.Utilities.UnitTests; using TestFramework.ForTestingMSTest; -namespace MSTestAdapter.PlatformServices.Tests.Services; +namespace MSTest.PlatformServices.Tests.Services; public class TestDeploymentTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/TestSourceHostTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/TestSourceHostTests.cs similarity index 88% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/TestSourceHostTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Services/TestSourceHostTests.cs index ee2fce2c4c..0c015ae209 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/TestSourceHostTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/TestSourceHostTests.cs @@ -2,11 +2,9 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. #if !NETFRAMEWORK -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; - using TestFramework.ForTestingMSTest; -namespace MSTestAdapter.PlatformServices.Tests.Services; +namespace MSTest.PlatformServices.Tests.Services; #pragma warning disable SA1649 // SA1649FileNameMustMatchTypeName public class TestSourceHostTests : TestContainer diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/ThreadOperationsTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/ThreadOperationsTests.cs similarity index 90% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/ThreadOperationsTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Services/ThreadOperationsTests.cs index 89456b1846..cec909300e 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Services/ThreadOperationsTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Services/ThreadOperationsTests.cs @@ -1,11 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; - using TestFramework.ForTestingMSTest; -namespace MSTestAdapter.PlatformServices.Tests.Services; +namespace MSTest.PlatformServices.Tests.Services; #pragma warning disable SA1649 // SA1649FileNameMustMatchTypeName public class ThreadOperationsTests : TestContainer diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/TestableImplementations/TestablePlatformServiceProvider.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/TestableImplementations/TestablePlatformServiceProvider.cs similarity index 69% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/TestableImplementations/TestablePlatformServiceProvider.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/TestableImplementations/TestablePlatformServiceProvider.cs index 7d1ce131b5..a6ea565c3b 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/TestableImplementations/TestablePlatformServiceProvider.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/TestableImplementations/TestablePlatformServiceProvider.cs @@ -1,17 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; +using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using Moq; -using ITestDataSource = Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.ITestDataSource; -using ITestMethod = Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.ObjectModel.ITestMethod; +using MSTest.PlatformServices.Execution; +using MSTest.PlatformServices.Interface; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.TestableImplementations; +using ISettingsProvider = MSTest.PlatformServices.Interface.ISettingsProvider; +using ITestDataSource = MSTest.PlatformServices.Interface.ITestDataSource; + +namespace MSTest.PlatformServices.UnitTests; internal class TestablePlatformServiceProvider : IPlatformServiceProvider { @@ -61,14 +62,14 @@ public IReflectionOperations2 ReflectionOperations public bool IsGracefulStopRequested { get; set; } - public ITestContext GetTestContext(ITestMethod? testMethod, string? testClassFullName, IDictionary properties, IMessageLogger messageLogger, UnitTestOutcome outcome) + public ITestContext GetTestContext(Interface.ObjectModel.ITestMethod? testMethod, string? testClassFullName, IDictionary properties, IMessageLogger messageLogger, UnitTestOutcome outcome) { var testContextImpl = new TestContextImplementation(testMethod, testClassFullName, properties, messageLogger, testRunCancellationToken: null); testContextImpl.SetOutcome(outcome); return testContextImpl; } - public ITestSourceHost CreateTestSourceHost(string source, TestPlatform.ObjectModel.Adapter.IRunSettings? runSettings, TestPlatform.ObjectModel.Adapter.IFrameworkHandle? frameworkHandle) => MockTestSourceHost.Object; + public ITestSourceHost CreateTestSourceHost(string source, IRunSettings? runSettings, IFrameworkHandle? frameworkHandle) => MockTestSourceHost.Object; public void SetupMockReflectionOperations() => MockReflectionOperations = new Mock(); } diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/AppDomainUtilitiesTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Utilities/AppDomainUtilitiesTests.cs similarity index 96% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/AppDomainUtilitiesTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Utilities/AppDomainUtilitiesTests.cs index e74e3cd51d..264d5ef680 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/AppDomainUtilitiesTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Utilities/AppDomainUtilitiesTests.cs @@ -2,11 +2,10 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. #if NETFRAMEWORK -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; using TestFramework.ForTestingMSTest; -namespace MSTestAdapter.PlatformServices.UnitTests.Utilities; +namespace MSTest.PlatformServices.Utilities.UnitTests; public class AppDomainUtilitiesTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/ns13DeploymentItemUtilityTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Utilities/DeploymentItemUtilityTests.cs similarity index 98% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/ns13DeploymentItemUtilityTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Utilities/DeploymentItemUtilityTests.cs index 539c42f503..eafdcdedfa 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/ns13DeploymentItemUtilityTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Utilities/DeploymentItemUtilityTests.cs @@ -1,16 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Deployment; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Resources; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Moq; +using MSTest.PlatformServices.Resources; + using TestFramework.ForTestingMSTest; -namespace MSTestAdapter.PlatformServices.Tests.Utilities; +namespace MSTest.PlatformServices.Utilities.UnitTests; #pragma warning disable SA1649 // File name must match first type name public class DeploymentItemUtilityTests : TestContainer diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/DeploymentUtilityTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Utilities/DeploymentUtilityTests.cs similarity index 98% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/DeploymentUtilityTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Utilities/DeploymentUtilityTests.cs index 1a925109e6..4c3e08d114 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/DeploymentUtilityTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Utilities/DeploymentUtilityTests.cs @@ -1,20 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Deployment; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Resources; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using Moq; -using MSTestAdapter.PlatformServices.Tests.Utilities; +using MSTest.PlatformServices.Deployment; +using MSTest.PlatformServices.Resources; using TestFramework.ForTestingMSTest; -namespace MSTestAdapter.PlatformServices.UnitTests.Utilities; +namespace MSTest.PlatformServices.Utilities.UnitTests; public class DeploymentUtilityTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/ns10FileUtilityTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Utilities/FileUtilityTests.cs similarity index 98% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/ns10FileUtilityTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Utilities/FileUtilityTests.cs index 5f83427888..cdfeaf95f1 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/ns10FileUtilityTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Utilities/FileUtilityTests.cs @@ -1,13 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; - using Moq; using TestFramework.ForTestingMSTest; -namespace MSTestAdapter.PlatformServices.Tests.Utilities; +namespace MSTest.PlatformServices.Utilities.UnitTests; public class FileUtilityTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/ns13ReflectionUtilityTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Utilities/ReflectionUtilityTests.cs similarity index 84% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/ns13ReflectionUtilityTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Utilities/ReflectionUtilityTests.cs index c22a003840..5944e6720b 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/ns13ReflectionUtilityTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Utilities/ReflectionUtilityTests.cs @@ -1,11 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; - using TestFramework.ForTestingMSTest; -namespace MSTestAdapter.PlatformServices.Tests.Utilities; +namespace MSTest.PlatformServices.Utilities.UnitTests; #pragma warning disable SA1649 // File name must match first type name public class ReflectionUtilityTests : TestContainer @@ -116,22 +114,37 @@ public void GetSpecificCustomAttributesOnTypeShouldReturnAllAttributesWithBaseIn Verify(expectedAttributes.SequenceEqual(GetAttributeValuePairs(attributes))); } - internal static List GetAttributeValuePairs(IEnumerable attributes) +#if NETFRAMEWORK + public void GetSpecificCustomAttributesOnAssemblyShouldReturnAllAttributes() + { + Assembly asm = typeof(DummyTestClass).Assembly; + + List attributes = ReflectionUtility.GetCustomAttributes(asm, typeof(DummyAAttribute)); + + Verify(attributes is not null); + Verify(attributes.Count == 2); + + string[] expectedAttributes = ["DummyA : a1", "DummyA : a2"]; + Verify(expectedAttributes.SequenceEqual(GetAttributeValuePairs(attributes))); + } +#endif + + internal static string[] GetAttributeValuePairs(IEnumerable attributes) { var attribValuePairs = new List(); - foreach (object? attrib in attributes) + foreach (object attrib in attributes) { - if (attrib is DummySingleAAttribute dummySingleAAttribute) + if (attrib is DummySingleAAttribute a) { - attribValuePairs.Add("DummySingleA : " + dummySingleAAttribute.Value); + attribValuePairs.Add("DummySingleA : " + a.Value); } - else if (attrib is DummyAAttribute dummyAAttribute) + else if (attrib is DummyAAttribute aa) { - attribValuePairs.Add("DummyA : " + dummyAAttribute.Value); + attribValuePairs.Add("DummyA : " + aa.Value); } } - return attribValuePairs; + return [.. attribValuePairs]; } [DummyA("ba")] @@ -171,7 +184,7 @@ public sealed class DummyAAttribute : Attribute public string Value { get; set; } } - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly, AllowMultiple = false)] public class DummySingleAAttribute : Attribute { public DummySingleAAttribute(string foo) => Value = foo; diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/VSInstallationUtilitiesTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Utilities/VSInstallationUtilitiesTests.cs similarity index 84% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/VSInstallationUtilitiesTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Utilities/VSInstallationUtilitiesTests.cs index 8d00f9b4fb..60c650d8ce 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/VSInstallationUtilitiesTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Utilities/VSInstallationUtilitiesTests.cs @@ -2,11 +2,9 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. #if NETFRAMEWORK -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; - using TestFramework.ForTestingMSTest; -namespace MSTestAdapter.PlatformServices.UnitTests; +namespace MSTest.PlatformServices.UnitTests; public class VSInstallationUtilitiesTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/XmlUtilitiesTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/Utilities/XmlUtilitiesTests.cs similarity index 90% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/XmlUtilitiesTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/Utilities/XmlUtilitiesTests.cs index 6f35bd4894..6c4d29981d 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/XmlUtilitiesTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/Utilities/XmlUtilitiesTests.cs @@ -5,9 +5,9 @@ using TestFramework.ForTestingMSTest; -using static MSTestAdapter.PlatformServices.UnitTests.Utilities.AppDomainUtilitiesTests; +using static MSTest.PlatformServices.Utilities.UnitTests.AppDomainUtilitiesTests; -namespace MSTestAdapter.PlatformServices.UnitTests.Utilities; +namespace MSTest.PlatformServices.Utilities.UnitTests; public class XmlUtilitiesTests : TestContainer { @@ -31,7 +31,7 @@ public void AddAssemblyRedirectionShouldAddRedirectionToAnEmptyXml() - + @@ -71,7 +71,7 @@ public void AddAssemblyRedirectionShouldAddRedirectionToAnEmptyConfig() - + @@ -113,7 +113,7 @@ public void AddAssemblyRedirectionShouldAddRedirectionToAConfigWithARuntimeSecti - + @@ -169,7 +169,7 @@ public void AddAssemblyRedirectionShouldAddRedirectionToAConfigWithRedirections( - + diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/XxHash128Tests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/XxHash128Tests.cs similarity index 100% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/XxHash128Tests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/XxHash128Tests.cs diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/ns10TestSourceTests.cs b/test/UnitTests/MSTest.PlatformServices.UnitTests/ns10TestSourceTests.cs similarity index 91% rename from test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/ns10TestSourceTests.cs rename to test/UnitTests/MSTest.PlatformServices.UnitTests/ns10TestSourceTests.cs index 9421b7dacd..83df027b9a 100644 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/ns10TestSourceTests.cs +++ b/test/UnitTests/MSTest.PlatformServices.UnitTests/ns10TestSourceTests.cs @@ -1,11 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; - using TestFramework.ForTestingMSTest; -namespace MSTestAdapter.PlatformServices.Tests.Services; +namespace MSTest.PlatformServices.Tests.Services; public class TestSourceTests : TestContainer { diff --git a/test/UnitTests/MSTest.SelfRealExamples.UnitTests/Program.cs b/test/UnitTests/MSTest.SelfRealExamples.UnitTests/Program.cs index 0eaa65fdb5..ebfe6790da 100644 --- a/test/UnitTests/MSTest.SelfRealExamples.UnitTests/Program.cs +++ b/test/UnitTests/MSTest.SelfRealExamples.UnitTests/Program.cs @@ -6,7 +6,9 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -[assembly: Parallelize(Scope = Microsoft.VisualStudio.TestTools.UnitTesting.ExecutionScope.ClassLevel, Workers = 0)] +using ExecutionScope = Microsoft.VisualStudio.TestTools.UnitTesting.ExecutionScope; + +[assembly: Parallelize(Scope = ExecutionScope.ClassLevel, Workers = 0)] ITestApplicationBuilder testApplicationBuilder = await TestApplication.CreateBuilderAsync(args); diff --git a/test/UnitTests/MSTestAdapter.UnitTests/MSTestAdapter.UnitTests.csproj b/test/UnitTests/MSTest.TestAdapter.UnitTests/MSTest.TestAdapter.UnitTests.csproj similarity index 80% rename from test/UnitTests/MSTestAdapter.UnitTests/MSTestAdapter.UnitTests.csproj rename to test/UnitTests/MSTest.TestAdapter.UnitTests/MSTest.TestAdapter.UnitTests.csproj index 911e8cb44d..09a283f6d0 100644 --- a/test/UnitTests/MSTestAdapter.UnitTests/MSTestAdapter.UnitTests.csproj +++ b/test/UnitTests/MSTest.TestAdapter.UnitTests/MSTest.TestAdapter.UnitTests.csproj @@ -4,8 +4,6 @@ net462;net48;net8.0;net9.0 $(TargetFrameworks);$(WinUiMinimum) true - Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests - Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests true Exe true @@ -17,7 +15,7 @@ - + diff --git a/test/UnitTests/MSTestAdapter.UnitTests/MSTestDiscovererTests.cs b/test/UnitTests/MSTest.TestAdapter.UnitTests/MSTestDiscovererTests.cs similarity index 96% rename from test/UnitTests/MSTestAdapter.UnitTests/MSTestDiscovererTests.cs rename to test/UnitTests/MSTest.TestAdapter.UnitTests/MSTestDiscovererTests.cs index 6aaa281508..330d512ed0 100644 --- a/test/UnitTests/MSTestAdapter.UnitTests/MSTestDiscovererTests.cs +++ b/test/UnitTests/MSTest.TestAdapter.UnitTests/MSTestDiscovererTests.cs @@ -1,19 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Discovery; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests.TestableImplementations; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using Moq; +using MSTest.PlatformServices; + +using MSTest.PlatformServices.Discovery; +using MSTest.PlatformServices.Interface; +using MSTest.PlatformServices.UnitTests; + using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests; +namespace MSTest.TestAdapter.UnitTests; public class MSTestDiscovererTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.UnitTests/MSTestExecutorTests.cs b/test/UnitTests/MSTest.TestAdapter.UnitTests/MSTestExecutorTests.cs similarity index 88% rename from test/UnitTests/MSTestAdapter.UnitTests/MSTestExecutorTests.cs rename to test/UnitTests/MSTest.TestAdapter.UnitTests/MSTestExecutorTests.cs index 9e339c4e15..13c71197f6 100644 --- a/test/UnitTests/MSTestAdapter.UnitTests/MSTestExecutorTests.cs +++ b/test/UnitTests/MSTest.TestAdapter.UnitTests/MSTestExecutorTests.cs @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Moq; +using MSTest.PlatformServices; + using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests; +namespace MSTest.TestAdapter.UnitTests; public class MSTestExecutorTests : TestContainer { @@ -80,7 +80,7 @@ public async Task RunTestsShouldReportErrorAndBailOutOnSettingsException() // Assert. _mockFrameworkHandle.Verify(fh => fh.RecordStart(tests[0]), Times.Never); - _mockFrameworkHandle.Verify(fh => fh.SendMessage(TestPlatform.ObjectModel.Logging.TestMessageLevel.Error, "Invalid value 'Pond' specified for 'Scope'. Supported scopes are ClassLevel, MethodLevel."), Times.Once); + _mockFrameworkHandle.Verify(fh => fh.SendMessage(Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging.TestMessageLevel.Error, "Invalid value 'Pond' specified for 'Scope'. Supported scopes are ClassLevel, MethodLevel."), Times.Once); } public async Task RunTestsWithSourcesShouldNotExecuteTestsIfTestSettingsIsGiven() @@ -125,6 +125,6 @@ public async Task RunTestsWithSourcesShouldReportErrorAndBailOutOnSettingsExcept // Assert. _mockFrameworkHandle.Verify(fh => fh.RecordStart(It.IsAny()), Times.Never); - _mockFrameworkHandle.Verify(fh => fh.SendMessage(TestPlatform.ObjectModel.Logging.TestMessageLevel.Error, "Invalid value 'Pond' specified for 'Scope'. Supported scopes are ClassLevel, MethodLevel."), Times.Once); + _mockFrameworkHandle.Verify(fh => fh.SendMessage(Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging.TestMessageLevel.Error, "Invalid value 'Pond' specified for 'Scope'. Supported scopes are ClassLevel, MethodLevel."), Times.Once); } } diff --git a/test/UnitTests/MSTestAdapter.UnitTests/Program.cs b/test/UnitTests/MSTest.TestAdapter.UnitTests/Program.cs similarity index 100% rename from test/UnitTests/MSTestAdapter.UnitTests/Program.cs rename to test/UnitTests/MSTest.TestAdapter.UnitTests/Program.cs diff --git a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreEqualTests.cs b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.AreEqualTests.cs similarity index 99% rename from test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreEqualTests.cs rename to test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.AreEqualTests.cs index 34138bf436..baab9a6c84 100644 --- a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreEqualTests.cs +++ b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.AreEqualTests.cs @@ -5,7 +5,7 @@ using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests; +namespace MSTest.TestFramework.UnitTests; public partial class AssertTests : TestContainer { diff --git a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreSame.cs b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.AreSame.cs similarity index 98% rename from test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreSame.cs rename to test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.AreSame.cs index 297a7909b6..537dc642c6 100644 --- a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreSame.cs +++ b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.AreSame.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests; +namespace MSTest.TestFramework.UnitTests; public partial class AssertTests { diff --git a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.Contains.cs b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.Contains.cs similarity index 100% rename from test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.Contains.cs rename to test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.Contains.cs diff --git a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.IComparableTests.cs b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.IComparableTests.cs similarity index 99% rename from test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.IComparableTests.cs rename to test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.IComparableTests.cs index a574b23c53..dc8970042c 100644 --- a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.IComparableTests.cs +++ b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.IComparableTests.cs @@ -5,7 +5,7 @@ using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests; +namespace MSTest.TestFramework.UnitTests; public partial class AssertTests : TestContainer { diff --git a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.InconclusiveTests.cs b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.InconclusiveTests.cs similarity index 88% rename from test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.InconclusiveTests.cs rename to test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.InconclusiveTests.cs index 98b1a2f4de..3600d1d92e 100644 --- a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.InconclusiveTests.cs +++ b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.InconclusiveTests.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests; +namespace MSTest.TestFramework.UnitTests; public partial class AssertTests { diff --git a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.IsInRange.cs b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.IsInRange.cs similarity index 100% rename from test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.IsInRange.cs rename to test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.IsInRange.cs diff --git a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.IsInstanceOfTypeTests.cs b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.IsInstanceOfTypeTests.cs similarity index 99% rename from test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.IsInstanceOfTypeTests.cs rename to test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.IsInstanceOfTypeTests.cs index 3a054637e0..e6a32e8c20 100644 --- a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.IsInstanceOfTypeTests.cs +++ b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.IsInstanceOfTypeTests.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests; +namespace MSTest.TestFramework.UnitTests; [SuppressMessage("Usage", "CA2263:Prefer generic overload when type is known", Justification = "We want to test also the non-generic API")] public partial class AssertTests diff --git a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.IsNull.cs b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.IsNull.cs similarity index 98% rename from test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.IsNull.cs rename to test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.IsNull.cs index 853f52d802..04a8ab3a70 100644 --- a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.IsNull.cs +++ b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.IsNull.cs @@ -3,7 +3,7 @@ using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests; +namespace MSTest.TestFramework.UnitTests; public partial class AssertTests : TestContainer { diff --git a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.IsTrueTests.cs b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.IsTrueTests.cs similarity index 99% rename from test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.IsTrueTests.cs rename to test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.IsTrueTests.cs index 308efee83b..938296323b 100644 --- a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.IsTrueTests.cs +++ b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.IsTrueTests.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests; +namespace MSTest.TestFramework.UnitTests; public partial class AssertTests { diff --git a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.Items.cs b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.Items.cs similarity index 99% rename from test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.Items.cs rename to test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.Items.cs index 1be66335d2..7933c1b457 100644 --- a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.Items.cs +++ b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.Items.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests; +namespace MSTest.TestFramework.UnitTests; public partial class AssertTests { diff --git a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.That.cs b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.That.cs similarity index 100% rename from test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.That.cs rename to test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.That.cs diff --git a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.ThrowsExceptionTests.cs b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.ThrowsExceptionTests.cs similarity index 99% rename from test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.ThrowsExceptionTests.cs rename to test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.ThrowsExceptionTests.cs index 1d1e9518e4..28b8845075 100644 --- a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.ThrowsExceptionTests.cs +++ b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.ThrowsExceptionTests.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests; +namespace MSTest.TestFramework.UnitTests; public partial class AssertTests { diff --git a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.cs b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.cs similarity index 97% rename from test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.cs rename to test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.cs index 44b85fef02..b8ce0051e4 100644 --- a/test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.cs +++ b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/AssertTests.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests; +namespace MSTest.TestFramework.UnitTests; public partial class AssertTests { diff --git a/test/UnitTests/TestFramework.UnitTests/Assertions/CollectionAssertTests.cs b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/CollectionAssertTests.cs similarity index 99% rename from test/UnitTests/TestFramework.UnitTests/Assertions/CollectionAssertTests.cs rename to test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/CollectionAssertTests.cs index 5f452b0296..40beffe0c7 100644 --- a/test/UnitTests/TestFramework.UnitTests/Assertions/CollectionAssertTests.cs +++ b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/CollectionAssertTests.cs @@ -5,7 +5,7 @@ using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests.Assertions; +namespace MSTest.TestFramework.UnitTests.Assertions; public class CollectionAssertTests : TestContainer { diff --git a/test/UnitTests/TestFramework.UnitTests/Assertions/StringAssertTests.cs b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/StringAssertTests.cs similarity index 99% rename from test/UnitTests/TestFramework.UnitTests/Assertions/StringAssertTests.cs rename to test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/StringAssertTests.cs index cce82cd93b..44d7f8005b 100644 --- a/test/UnitTests/TestFramework.UnitTests/Assertions/StringAssertTests.cs +++ b/test/UnitTests/MSTest.TestFramework.UnitTests/Assertions/StringAssertTests.cs @@ -3,7 +3,7 @@ using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests.Assertions; +namespace MSTest.TestFramework.UnitTests.Assertions; public class StringAssertTests : TestContainer { diff --git a/test/UnitTests/TestFramework.UnitTests/Attributes/CIConditionAttributeTests.cs b/test/UnitTests/MSTest.TestFramework.UnitTests/Attributes/CIConditionAttributeTests.cs similarity index 100% rename from test/UnitTests/TestFramework.UnitTests/Attributes/CIConditionAttributeTests.cs rename to test/UnitTests/MSTest.TestFramework.UnitTests/Attributes/CIConditionAttributeTests.cs diff --git a/test/UnitTests/TestFramework.UnitTests/Attributes/DataRowAttributeTests.cs b/test/UnitTests/MSTest.TestFramework.UnitTests/Attributes/DataRowAttributeTests.cs similarity index 98% rename from test/UnitTests/TestFramework.UnitTests/Attributes/DataRowAttributeTests.cs rename to test/UnitTests/MSTest.TestFramework.UnitTests/Attributes/DataRowAttributeTests.cs index 34452a4dba..e22d30002d 100644 --- a/test/UnitTests/TestFramework.UnitTests/Attributes/DataRowAttributeTests.cs +++ b/test/UnitTests/MSTest.TestFramework.UnitTests/Attributes/DataRowAttributeTests.cs @@ -5,7 +5,7 @@ using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests.Attributes; +namespace MSTest.TestFramework.UnitTests.Attributes; public class DataRowAttributeTests : TestContainer { diff --git a/test/UnitTests/TestFramework.UnitTests/Attributes/DynamicDataAttributeTests.cs b/test/UnitTests/MSTest.TestFramework.UnitTests/Attributes/DynamicDataAttributeTests.cs similarity index 99% rename from test/UnitTests/TestFramework.UnitTests/Attributes/DynamicDataAttributeTests.cs rename to test/UnitTests/MSTest.TestFramework.UnitTests/Attributes/DynamicDataAttributeTests.cs index c16ad9643c..41c227a0c0 100644 --- a/test/UnitTests/TestFramework.UnitTests/Attributes/DynamicDataAttributeTests.cs +++ b/test/UnitTests/MSTest.TestFramework.UnitTests/Attributes/DynamicDataAttributeTests.cs @@ -5,7 +5,7 @@ using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests.Attributes; +namespace MSTest.TestFramework.UnitTests.Attributes; public class DynamicDataAttributeTests : TestContainer { diff --git a/test/UnitTests/TestFramework.UnitTests/GitHubWorkItemTests.cs b/test/UnitTests/MSTest.TestFramework.UnitTests/GitHubWorkItemTests.cs similarity index 97% rename from test/UnitTests/TestFramework.UnitTests/GitHubWorkItemTests.cs rename to test/UnitTests/MSTest.TestFramework.UnitTests/GitHubWorkItemTests.cs index 35d607797c..1762688981 100644 --- a/test/UnitTests/TestFramework.UnitTests/GitHubWorkItemTests.cs +++ b/test/UnitTests/MSTest.TestFramework.UnitTests/GitHubWorkItemTests.cs @@ -3,7 +3,7 @@ using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests; +namespace MSTest.TestFramework.UnitTests; public class GitHubWorkItemTests : TestContainer { diff --git a/test/UnitTests/TestFramework.UnitTests/LoggerTests.cs b/test/UnitTests/MSTest.TestFramework.UnitTests/LoggerTests.cs similarity index 95% rename from test/UnitTests/TestFramework.UnitTests/LoggerTests.cs rename to test/UnitTests/MSTest.TestFramework.UnitTests/LoggerTests.cs index b0e62e3c04..aba1632975 100644 --- a/test/UnitTests/TestFramework.UnitTests/LoggerTests.cs +++ b/test/UnitTests/MSTest.TestFramework.UnitTests/LoggerTests.cs @@ -5,7 +5,7 @@ using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests; +namespace MSTest.TestFramework.UnitTests; public sealed class LoggerTests : TestContainer { diff --git a/test/UnitTests/TestFramework.UnitTests/TestFramework.UnitTests.csproj b/test/UnitTests/MSTest.TestFramework.UnitTests/MSTest.TestFramework.UnitTests.csproj similarity index 85% rename from test/UnitTests/TestFramework.UnitTests/TestFramework.UnitTests.csproj rename to test/UnitTests/MSTest.TestFramework.UnitTests/MSTest.TestFramework.UnitTests.csproj index e5266ccc69..ed17e90adf 100644 --- a/test/UnitTests/TestFramework.UnitTests/TestFramework.UnitTests.csproj +++ b/test/UnitTests/MSTest.TestFramework.UnitTests/MSTest.TestFramework.UnitTests.csproj @@ -5,8 +5,6 @@ $(NetStandardNetFrameworkHolder);net8.0;net9.0 $(TargetFrameworks);$(WinUiMinimum) true - Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests - Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests true Exe true diff --git a/test/UnitTests/TestFramework.UnitTests/Program.cs b/test/UnitTests/MSTest.TestFramework.UnitTests/Program.cs similarity index 100% rename from test/UnitTests/TestFramework.UnitTests/Program.cs rename to test/UnitTests/MSTest.TestFramework.UnitTests/Program.cs diff --git a/test/UnitTests/TestFramework.UnitTests/TestDataRowTests.cs b/test/UnitTests/MSTest.TestFramework.UnitTests/TestDataRowTests.cs similarity index 97% rename from test/UnitTests/TestFramework.UnitTests/TestDataRowTests.cs rename to test/UnitTests/MSTest.TestFramework.UnitTests/TestDataRowTests.cs index 44f6138dec..7cd09e2494 100644 --- a/test/UnitTests/TestFramework.UnitTests/TestDataRowTests.cs +++ b/test/UnitTests/MSTest.TestFramework.UnitTests/TestDataRowTests.cs @@ -3,7 +3,7 @@ using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests; +namespace MSTest.TestFramework.UnitTests; public class TestDataRowTests : TestContainer { diff --git a/test/UnitTests/TestFramework.UnitTests/TestResultTests.cs b/test/UnitTests/MSTest.TestFramework.UnitTests/TestResultTests.cs similarity index 96% rename from test/UnitTests/TestFramework.UnitTests/TestResultTests.cs rename to test/UnitTests/MSTest.TestFramework.UnitTests/TestResultTests.cs index 99a9c47079..b5a4f2f910 100644 --- a/test/UnitTests/TestFramework.UnitTests/TestResultTests.cs +++ b/test/UnitTests/MSTest.TestFramework.UnitTests/TestResultTests.cs @@ -3,7 +3,7 @@ using TestFramework.ForTestingMSTest; -namespace Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests; +namespace MSTest.TestFramework.UnitTests; public sealed class TestResultTests : TestContainer { diff --git a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/DesktopReflectionUtilityTests.cs b/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/DesktopReflectionUtilityTests.cs deleted file mode 100644 index 0996e422a2..0000000000 --- a/test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Utilities/DesktopReflectionUtilityTests.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -#if NETFRAMEWORK -using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities; - -using TestFramework.ForTestingMSTest; - -namespace MSTestAdapter.PlatformServices.UnitTests.Utilities; - -#pragma warning disable SA1649 // File name must match first type name -public class ReflectionUtilityTests : TestContainer -#pragma warning restore SA1649 // File name must match first type name -{ - public void GetSpecificCustomAttributesOnAssemblyShouldReturnAllAttributes() - { - Assembly asm = typeof(DummyTestClass).Assembly; - - List attributes = ReflectionUtility.GetCustomAttributes(asm, typeof(DummyAAttribute)); - - Verify(attributes is not null); - Verify(attributes.Count == 2); - - string[] expectedAttributes = ["DummyA : a1", "DummyA : a2"]; - Verify(expectedAttributes.SequenceEqual(GetAttributeValuePairs(attributes))); - } - - internal static string[] GetAttributeValuePairs(IEnumerable attributes) - { - var attribValuePairs = new List(); - foreach (object attrib in attributes) - { - if (attrib is DummySingleAAttribute a) - { - attribValuePairs.Add("DummySingleA : " + a.Value); - } - else if (attrib is DummyAAttribute aa) - { - attribValuePairs.Add("DummyA : " + aa.Value); - } - } - - return [.. attribValuePairs]; - } - - [DummyA("ba")] - public class DummyBaseTestClass - { - [DummyA("base")] - [DummySingleA("base")] - public virtual void DummyVTestMethod1() - { - } - - public void DummyBTestMethod2() - { - } - } - - [DummyA("a")] - public class DummyTestClass : DummyBaseTestClass - { - [DummyA("derived")] - [DummySingleA("derived")] - public override void DummyVTestMethod1() - { - } - - [DummySingleA("derived")] - public void DummyTestMethod2() - { - } - } - - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly, AllowMultiple = true)] - public sealed class DummyAAttribute : Attribute - { - public DummyAAttribute(string foo) => Value = foo; - - public string Value { get; set; } - } - - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly, AllowMultiple = false)] - public class DummySingleAAttribute : Attribute - { - public DummySingleAAttribute(string foo) => Value = foo; - - public string Value { get; set; } - } -} -#endif diff --git a/test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/Program.cs b/test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/Program.cs index ea6f07edb4..3a692e8f01 100644 --- a/test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/Program.cs +++ b/test/UnitTests/Microsoft.Testing.Extensions.VSTestBridge.UnitTests/Program.cs @@ -9,7 +9,7 @@ [assembly: ClassCleanupExecution(ClassCleanupBehavior.EndOfClass)] #if NETCOREAPP -Console.WriteLine("Dynamic code supported: " + System.Runtime.CompilerServices.RuntimeFeature.IsDynamicCodeSupported); +Console.WriteLine("Dynamic code supported: " + RuntimeFeature.IsDynamicCodeSupported); #endif ITestApplicationBuilder builder = await TestApplication.CreateBuilderAsync(args);