diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-CSharp/Company.TestProject1.csproj b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-CSharp/Company.TestProject1.csproj index a5f03948f9d8..ddeed0523427 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-CSharp/Company.TestProject1.csproj +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-CSharp/Company.TestProject1.csproj @@ -1,5 +1,5 @@  - + net11.0 @@ -49,7 +49,7 @@ - + diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-FSharp/Company.TestProject1.fsproj b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-FSharp/Company.TestProject1.fsproj index cd4208fc826e..bc20f323731d 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-FSharp/Company.TestProject1.fsproj +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-FSharp/Company.TestProject1.fsproj @@ -1,5 +1,5 @@ - + net11.0 @@ -65,7 +65,7 @@ - + diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-VisualBasic/Company.TestProject1.vbproj b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-VisualBasic/Company.TestProject1.vbproj index d756cb7b9e0c..53f8d83c332c 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-VisualBasic/Company.TestProject1.vbproj +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/MSTest-VisualBasic/Company.TestProject1.vbproj @@ -1,5 +1,5 @@  - + net11.0 @@ -45,7 +45,7 @@ - + diff --git a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/Playwright-MSTest-CSharp/Company.TestProject1.csproj b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/Playwright-MSTest-CSharp/Company.TestProject1.csproj index 4bce00147736..a719e2a900a4 100644 --- a/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/Playwright-MSTest-CSharp/Company.TestProject1.csproj +++ b/template_feed/Microsoft.DotNet.Common.ProjectTemplates.11.0/content/Playwright-MSTest-CSharp/Company.TestProject1.csproj @@ -1,5 +1,5 @@  - + net11.0 @@ -9,6 +9,7 @@ enable enable true + 1.64.1 true @@ -23,6 +24,12 @@ + + + + + + @@ -44,8 +51,8 @@ - - + + diff --git a/test/TestPackages/cgmanifest.json b/test/TestPackages/cgmanifest.json index cfd88d5b4165..d6c84c5dd4cc 100644 --- a/test/TestPackages/cgmanifest.json +++ b/test/TestPackages/cgmanifest.json @@ -52,7 +52,7 @@ "type": "nuget", "nuget": { "name": "MSTest", - "version": "4.0.2" + "version": "4.5.2" } } }, @@ -97,7 +97,7 @@ "type": "nuget", "nuget": { "name": "Microsoft.Playwright.MSTest.v4", - "version": "1.55.0" + "version": "1.64.1" } } } diff --git a/test/dotnet-new.IntegrationTests/DotnetNewInstantiateTests.cs b/test/dotnet-new.IntegrationTests/DotnetNewInstantiateTests.cs index 6336d64daa16..bd8110581688 100644 --- a/test/dotnet-new.IntegrationTests/DotnetNewInstantiateTests.cs +++ b/test/dotnet-new.IntegrationTests/DotnetNewInstantiateTests.cs @@ -69,7 +69,8 @@ public void MSTestTemplate_SelectsCurrentTemplateForEverySupportedTargetFramewor string templateName, string targetFramework, string language, - string projectExtension) + string projectExtension, + bool useMSTestSdk) { const string projectName = "MSTestProject"; string workingDirectory = CreateTemporaryFolder(); @@ -83,6 +84,8 @@ public void MSTestTemplate_SelectsCurrentTemplateForEverySupportedTargetFramewor targetFramework, "--language", language, + "--sdk", + useMSTestSdk ? "true" : "false", "--name", projectName, "--output", @@ -98,7 +101,21 @@ public void MSTestTemplate_SelectsCurrentTemplateForEverySupportedTargetFramewor string projectContents = File.ReadAllText(Path.Combine(outputDirectory, $"{projectName}.{projectExtension}")); projectContents.Should().Contain($"{targetFramework}"); - projectContents.Should().Contain(""""""); + projectContents.Should().Contain(useMSTestSdk + ? """""" + : """"""); + + if (templateName == "mstest-playwright") + { + projectContents.Should().Contain(useMSTestSdk + ? "1.64.1" + : """"""); + + if (useMSTestSdk) + { + projectContents.Should().Contain(""""""); + } + } } public static IEnumerable MSTestTemplateSelectionData() @@ -123,13 +140,13 @@ public static IEnumerable MSTestTemplateSelectionData() foreach (string targetFramework in mstestTargetFrameworks) { - yield return ["mstest", targetFramework, "C#", "csproj"]; + yield return ["mstest", targetFramework, "C#", "csproj", false]; } // Cover the language-specific template groups at the framework where the // Microsoft.DotNet.Common.ProjectTemplates.10.0 package can otherwise win. - yield return ["mstest", "net10.0", "F#", "fsproj"]; - yield return ["mstest", "net10.0", "VB", "vbproj"]; + yield return ["mstest", "net10.0", "F#", "fsproj", false]; + yield return ["mstest", "net10.0", "VB", "vbproj", false]; string[] additionalPlaywrightTargetFrameworks = [ @@ -142,8 +159,13 @@ public static IEnumerable MSTestTemplateSelectionData() foreach (string targetFramework in mstestTargetFrameworks.Concat(additionalPlaywrightTargetFrameworks)) { - yield return ["mstest-playwright", targetFramework, "C#", "csproj"]; + yield return ["mstest-playwright", targetFramework, "C#", "csproj", false]; } + + yield return ["mstest", "net11.0", "C#", "csproj", true]; + yield return ["mstest", "net11.0", "F#", "fsproj", true]; + yield return ["mstest", "net11.0", "VB", "vbproj", true]; + yield return ["mstest-playwright", "net11.0", "C#", "csproj", true]; } #pragma warning disable xUnit1004 // Test methods should not be skipped