diff --git a/Directory.Packages.props b/Directory.Packages.props
index 2be713e468..6bd3d0c5d4 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -22,6 +22,7 @@
4.3.1
4.3.1
4.5.4
+ 4.5.0
1.1.3-beta1.24423.1
@@ -53,7 +54,7 @@
-
+
diff --git a/samples/Playground/DebuggerUtility.cs b/samples/Playground/DebuggerUtility.cs
index 6b58a2a58d..55fb8c75eb 100644
--- a/samples/Playground/DebuggerUtility.cs
+++ b/samples/Playground/DebuggerUtility.cs
@@ -1,6 +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.
+#if NETCOREAPP
#pragma warning disable CA1837 // Use 'Environment.ProcessId'
#pragma warning disable CA1416 // Validate platform compatibility
@@ -356,3 +357,5 @@ private static extern int NtQueryInformationProcess(
[DllImport("ole32.dll")]
private static extern int CreateBindCtx(uint reserved, out IBindCtx ppbc);
}
+
+#endif
diff --git a/samples/Playground/Playground.csproj b/samples/Playground/Playground.csproj
index f60b5e923c..f83ced76c8 100644
--- a/samples/Playground/Playground.csproj
+++ b/samples/Playground/Playground.csproj
@@ -8,6 +8,10 @@
$(NoWarn);NETSDK1023
+
+
+
+
diff --git a/samples/Playground/Program.cs b/samples/Playground/Program.cs
index dfa263bd6e..82315191c2 100644
--- a/samples/Playground/Program.cs
+++ b/samples/Playground/Program.cs
@@ -8,12 +8,13 @@
using Microsoft.Testing.Platform.Extensions.TestFramework;
using Microsoft.Testing.Platform.Extensions.TestHostControllers;
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;
-using MSTest.Acceptance.IntegrationTests.Messages.V100;
-
namespace Playground;
public class Program
@@ -25,8 +26,10 @@ public static async Task Main(string[] args)
if (Environment.GetEnvironmentVariable("TESTSERVERMODE") != "1")
{
+#if NETCOREAPP
// To attach to the children
Microsoft.Testing.TestInfrastructure.DebuggerUtility.AttachCurrentProcessToParentVSProcess();
+#endif
ITestApplicationBuilder testApplicationBuilder = await TestApplication.CreateBuilderAsync(args);
@@ -49,6 +52,9 @@ public static async Task Main(string[] args)
}
else
{
+#if NETFRAMEWORK
+ throw new NotSupportedException("Server mode is not supported on .NET Framework");
+#else
Environment.SetEnvironmentVariable("TESTSERVERMODE", "0");
using TestingPlatformClient client = await TestingPlatformClientFactory.StartAsServerAndConnectToTheClientAsync(Environment.ProcessPath!);
@@ -67,6 +73,7 @@ public static async Task Main(string[] args)
await client.ExitAsync();
return 0;
+#endif
}
}
}
diff --git a/samples/Playground/Tests.cs b/samples/Playground/Tests.cs
index eb480d750f..ffd007f386 100644
--- a/samples/Playground/Tests.cs
+++ b/samples/Playground/Tests.cs
@@ -15,13 +15,16 @@ public class TestClass
public TestContext TestContext { get; set; }
[TestMethod]
- public void Test() => TestContext.AddResultFile(@"c:\hello2");
+ [DynamicData(nameof(Data))]
+ public void Test3(int a, int b)
+ => Assert.AreNotEqual(a, b);
- [TestMethod]
- public void Test2() => Assert.AreEqual(1, 0, "few");
-
- [TestMethod]
- public void Test3()
+ public static IEnumerable<(int A, int B)> Data
{
+ get
+ {
+ yield return (1, 2);
+ yield return (3, 4);
+ }
}
}
diff --git a/src/Adapter/MSTest.TestAdapter/DynamicDataOperations.cs b/src/Adapter/MSTest.TestAdapter/DynamicDataOperations.cs
index a666067292..10485ab7c3 100644
--- a/src/Adapter/MSTest.TestAdapter/DynamicDataOperations.cs
+++ b/src/Adapter/MSTest.TestAdapter/DynamicDataOperations.cs
@@ -1,15 +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.TestTools.UnitTesting;
-
-#if NET471_OR_GREATER || NETCOREAPP
using System.Collections;
-using System.Runtime.CompilerServices;
-#endif
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Reflection;
+#if NET471_OR_GREATER || NETCOREAPP
+using System.Runtime.CompilerServices;
+#endif
+
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter;
@@ -129,12 +129,12 @@ private static bool TryGetData(object dataSource, [NotNullWhen(true)] out IEnume
return true;
}
-#if NETCOREAPP || NET471_OR_GREATER
if (dataSource is IEnumerable enumerable)
{
List