diff --git a/TestPlatform.sln b/TestPlatform.sln
index cd278af64a..b53343e569 100644
--- a/TestPlatform.sln
+++ b/TestPlatform.sln
@@ -159,6 +159,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.Exte
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "coverlet.collector", "test\coverlet.collector\coverlet.collector.csproj", "{074F5BD6-DC05-460B-B78F-044D125FD787}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.ObjectModel.FullyQualifiedNameUtilities.UnitTests", "test\Microsoft.TestPlatform.ObjectModel.FullyQualifiedNameUtilities.UnitTests\Microsoft.TestPlatform.ObjectModel.FullyQualifiedNameUtilities.UnitTests.csproj", "{DCD0C39E-C78C-4A44-B0BD-7325254A2E97}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -781,6 +783,18 @@ Global
{074F5BD6-DC05-460B-B78F-044D125FD787}.Release|x64.Build.0 = Release|Any CPU
{074F5BD6-DC05-460B-B78F-044D125FD787}.Release|x86.ActiveCfg = Release|Any CPU
{074F5BD6-DC05-460B-B78F-044D125FD787}.Release|x86.Build.0 = Release|Any CPU
+ {DCD0C39E-C78C-4A44-B0BD-7325254A2E97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DCD0C39E-C78C-4A44-B0BD-7325254A2E97}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DCD0C39E-C78C-4A44-B0BD-7325254A2E97}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {DCD0C39E-C78C-4A44-B0BD-7325254A2E97}.Debug|x64.Build.0 = Debug|Any CPU
+ {DCD0C39E-C78C-4A44-B0BD-7325254A2E97}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {DCD0C39E-C78C-4A44-B0BD-7325254A2E97}.Debug|x86.Build.0 = Debug|Any CPU
+ {DCD0C39E-C78C-4A44-B0BD-7325254A2E97}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DCD0C39E-C78C-4A44-B0BD-7325254A2E97}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DCD0C39E-C78C-4A44-B0BD-7325254A2E97}.Release|x64.ActiveCfg = Release|Any CPU
+ {DCD0C39E-C78C-4A44-B0BD-7325254A2E97}.Release|x64.Build.0 = Release|Any CPU
+ {DCD0C39E-C78C-4A44-B0BD-7325254A2E97}.Release|x86.ActiveCfg = Release|Any CPU
+ {DCD0C39E-C78C-4A44-B0BD-7325254A2E97}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -849,6 +863,7 @@ Global
{236A71E3-01DA-4679-9DFF-16A8E079ACFF} = {5E7F18A8-F843-4C8A-AB02-4C7D9205C6CF}
{41248B96-6E15-4E5E-A78F-859897676814} = {020E15EA-731F-4667-95AF-226671E0C3AE}
{074F5BD6-DC05-460B-B78F-044D125FD787} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6}
+ {DCD0C39E-C78C-4A44-B0BD-7325254A2E97} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0541B30C-FF51-4E28-B172-83F5F3934BCD}
diff --git a/eng/Versions.props b/eng/Versions.props
index 2091e6983a..2db97894ff 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -75,5 +75,11 @@
1.0.0-beta2-19554-01
1.0.0-beta.20509.7
1.0.0-beta.20055.1
+
+
+
+ 3.8.0-3.20427.2
diff --git a/scripts/build.ps1 b/scripts/build.ps1
index 7fc073d38c..9ae18a49c5 100644
--- a/scripts/build.ps1
+++ b/scripts/build.ps1
@@ -119,7 +119,7 @@ $language = @("cs", "de", "es", "fr", "it", "ja", "ko", "pl", "pt-BR", "ru", "tr
# Capture error state in any step globally to modify return code
$Script:ScriptFailed = $false
-Import-Module "$($CurrentScriptDir.FullName)\verify-nupkgs.ps1"
+Import-Module -Name "$($CurrentScriptDir.FullName)\verify-nupkgs.ps1" -Scope Local
# Update the version in the dependencies props to be the TPB_version version, this is not ideal but because changing how this is resolved would
# mean that we need to change the whole build process this is a solution with the least amount of impact, that does not require us to keep track of
@@ -253,7 +253,6 @@ function Invoke-TestAssetsBuild
Write-Log "Invoke-TestAssetsBuild: Start test assets build."
$dotnetExe = Get-DotNetPath
-
Write-Log ".. .. Build: Source: $TPB_TestAssets_Solution"
Write-Verbose "$dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:Version=$TPB_Version -p:CIBuild=$TPB_CIBuild"
& $dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:CIBuild=$TPB_CIBuild -p:LocalizedBuild=$TPB_LocalizedBuild -bl:"$($env:TP_ROOT_DIR)\TestAssets.binlog"
diff --git a/scripts/verify-nupkgs.ps1 b/scripts/verify-nupkgs.ps1
index 3e34a790a0..0b3878e422 100644
--- a/scripts/verify-nupkgs.ps1
+++ b/scripts/verify-nupkgs.ps1
@@ -8,7 +8,6 @@ function Unzip
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $outpath)
}
-
function Verify-Nuget-Packages($packageDirectory)
{
Write-Log "Starting Verify-Nuget-Packages."
@@ -59,4 +58,4 @@ function Verify-Nuget-Packages($packageDirectory)
}
Write-Log "Completed Verify-Nuget-Packages."
-}
+}
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Extensions/ReflectionExtensions.MethodBase.cs b/src/Microsoft.TestPlatform.CoreUtilities/Extensions/ReflectionExtensions.MethodBase.cs
new file mode 100644
index 0000000000..5e20bad1bd
--- /dev/null
+++ b/src/Microsoft.TestPlatform.CoreUtilities/Extensions/ReflectionExtensions.MethodBase.cs
@@ -0,0 +1,56 @@
+// 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.PlatformAbstractions.Extensions
+{
+ using System;
+ using System.Reflection;
+
+ public static partial class ReflectionExtensions
+ {
+#if NETSTANDARD1_0 || NETSTANDARD1_3 || WINDOWS_UWP
+ private static readonly Type methodBase = typeof(MethodBase);
+
+ private const string MemberTypePropertyName = "MemberType";
+ private const string ReflectedTypePropertyName = "ReflectedType";
+ private const string MethodHandlePropertyName = "MethodHandle";
+
+ private static readonly PropertyInfo memberTypeProperty = methodBase.GetRuntimeProperty(MemberTypePropertyName);
+ private static readonly PropertyInfo reflectedTypeProperty = methodBase.GetRuntimeProperty(ReflectedTypePropertyName);
+ private static readonly PropertyInfo methodHandleProperty = methodBase.GetRuntimeProperty(MethodHandlePropertyName);
+#endif
+
+ public static bool IsMethod(this MethodBase method)
+ {
+#if !NETSTANDARD1_0 && !NETSTANDARD1_3 && !WINDOWS_UWP
+ return method.MemberType == MemberTypes.Method;
+#else
+ AssertSupport(memberTypeProperty, MemberTypePropertyName, methodBase.FullName);
+
+ return (int)memberTypeProperty.GetValue(method) == 8;
+#endif
+ }
+
+ public static Type GetReflectedType(this MethodBase method)
+ {
+#if !NETSTANDARD1_0 && !NETSTANDARD1_3 && !WINDOWS_UWP
+ return method.ReflectedType;
+#else
+ AssertSupport(memberTypeProperty, ReflectedTypePropertyName, methodBase.FullName);
+
+ return reflectedTypeProperty.GetValue(method) as Type;
+#endif
+ }
+
+ public static RuntimeMethodHandle GetMethodHandle(this MethodBase method)
+ {
+#if !NETSTANDARD1_0 && !NETSTANDARD1_3 && !WINDOWS_UWP
+ return method.MethodHandle;
+#else
+ AssertSupport(memberTypeProperty, MethodHandlePropertyName, methodBase.FullName);
+
+ return (RuntimeMethodHandle)methodHandleProperty.GetValue(method);
+#endif
+ }
+ }
+}
diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Extensions/ReflectionExtensions.Type.cs b/src/Microsoft.TestPlatform.CoreUtilities/Extensions/ReflectionExtensions.Type.cs
new file mode 100644
index 0000000000..65670afd06
--- /dev/null
+++ b/src/Microsoft.TestPlatform.CoreUtilities/Extensions/ReflectionExtensions.Type.cs
@@ -0,0 +1,29 @@
+// 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.PlatformAbstractions.Extensions
+{
+ using System;
+ using System.Reflection;
+
+ public static partial class ReflectionExtensions
+ {
+ public static bool IsGenericType(this Type type)
+ {
+#if !NETSTANDARD1_0 && !NETSTANDARD1_3 && !WINDOWS_UWP
+ return type.IsGenericType;
+#else
+ return type.GetTypeInfo().IsGenericType;
+#endif
+ }
+
+ public static MethodBase GetDeclaringMethod(this Type type)
+ {
+#if !NETSTANDARD1_0 && !NETSTANDARD1_3 && !WINDOWS_UWP
+ return type.DeclaringMethod;
+#else
+ return type.GetTypeInfo().DeclaringMethod;
+#endif
+ }
+ }
+}
diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Extensions/ReflectionExtensions.cs b/src/Microsoft.TestPlatform.CoreUtilities/Extensions/ReflectionExtensions.cs
new file mode 100644
index 0000000000..010567f0eb
--- /dev/null
+++ b/src/Microsoft.TestPlatform.CoreUtilities/Extensions/ReflectionExtensions.cs
@@ -0,0 +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.
+
+namespace Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.Extensions
+{
+ using Microsoft.VisualStudio.TestPlatform.CoreUtilities.Resources;
+
+ using System;
+
+ public static partial class ReflectionExtensions
+ {
+ private static void AssertSupport(T obj, string methodName, string className)
+ where T : class
+ {
+ if (obj == null)
+ {
+ throw new NotImplementedException(string.Format(Resources.MethodNotImplementedOnPlatform, className, methodName));
+ }
+ }
+ }
+}
diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Utilities/StringBuilderExtensions.cs b/src/Microsoft.TestPlatform.CoreUtilities/Extensions/StringBuilderExtensions.cs
similarity index 100%
rename from src/Microsoft.TestPlatform.CoreUtilities/Utilities/StringBuilderExtensions.cs
rename to src/Microsoft.TestPlatform.CoreUtilities/Extensions/StringBuilderExtensions.cs
diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Utilities/StringExtensions.cs b/src/Microsoft.TestPlatform.CoreUtilities/Extensions/StringExtensions.cs
similarity index 100%
rename from src/Microsoft.TestPlatform.CoreUtilities/Utilities/StringExtensions.cs
rename to src/Microsoft.TestPlatform.CoreUtilities/Extensions/StringExtensions.cs
diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Resources/Resources.Designer.cs b/src/Microsoft.TestPlatform.CoreUtilities/Resources/Resources.Designer.cs
index 6a615e84d7..2f96768586 100644
--- a/src/Microsoft.TestPlatform.CoreUtilities/Resources/Resources.Designer.cs
+++ b/src/Microsoft.TestPlatform.CoreUtilities/Resources/Resources.Designer.cs
@@ -206,5 +206,16 @@ internal static string NoDotnetExeFound
return ResourceManager.GetString("NoDotnetExeFound", resourceCulture);
}
}
+
+ ///
+ /// Looks up a localized string similar to '{0}.{1}' is not implemented on this platform!.
+ ///
+ internal static string MethodNotImplementedOnPlatform
+ {
+ get
+ {
+ return ResourceManager.GetString("MethodNotImplementedOnPlatform", resourceCulture);
+ }
+ }
}
}
diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Resources/Resources.resx b/src/Microsoft.TestPlatform.CoreUtilities/Resources/Resources.resx
index ba520ac0b1..27a397f0d5 100644
--- a/src/Microsoft.TestPlatform.CoreUtilities/Resources/Resources.resx
+++ b/src/Microsoft.TestPlatform.CoreUtilities/Resources/Resources.resx
@@ -165,4 +165,10 @@
Error getting process name.
+
+ '{0}.{1}' is not implemented on this platform!
+ '{className}.{methodName}' is not implemented on this platform!
+
+Example: 'System.Reflection.MethodBase' is not implemented on this platform!
+
\ No newline at end of file
diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Resources/xlf/Resources.cs.xlf b/src/Microsoft.TestPlatform.CoreUtilities/Resources/xlf/Resources.cs.xlf
index d3fcf4893f..47832fc031 100644
--- a/src/Microsoft.TestPlatform.CoreUtilities/Resources/xlf/Resources.cs.xlf
+++ b/src/Microsoft.TestPlatform.CoreUtilities/Resources/xlf/Resources.cs.xlf
@@ -160,6 +160,13 @@
Hostitele {0} nešlo najít. Ujistěte se, jestli je {0} nainstalovaný na počítači a dostupný v cestě určené proměnnou prostředí PATH.
+
+ '{0}.{1}' is not implemented on this platform!
+ '{0}.{1}' is not implemented on this platform!
+ '{className}.{methodName}' is not implemented on this platform!
+
+Example: 'System.Reflection.MethodBase' is not implemented on this platform!
+