diff --git a/.gitignore b/.gitignore index 21ad03fd2577..3f0661881fe4 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ cmake/ # Test results **/*.trx /TestResults +**/TestResults /test/dotnet.Tests/CompletionTests/snapshots/**/**.received.* # Live Unit Testing diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Solution/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Solution/.template.config/template.json index a4e584a02541..d6f4dca9c976 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Solution/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Solution/.template.config/template.json @@ -20,7 +20,7 @@ "type": "parameter", "displayName": "Solution file format", "description": "Choose the format for the solution file: sln or slnx.", - "defaultValue": "sln", + "defaultValue": "slnx", "datatype": "choice", "choices": [ { diff --git a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildALibrary.cs b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildALibrary.cs index a7a460ab70cc..ee23eef9dec6 100644 --- a/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildALibrary.cs +++ b/test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildALibrary.cs @@ -686,7 +686,7 @@ private void TestInvalidTargetFramework(string testName, string targetFramework, new DotnetNewCommand(Log) .WithVirtualHive() .WithWorkingDirectory(testAsset.TestRoot) - .Execute("sln") + .Execute("sln", "--format", "sln") .Should() .Pass(); diff --git a/test/Microsoft.NET.TestFramework/TestAssetsManager.cs b/test/Microsoft.NET.TestFramework/TestAssetsManager.cs index 3f397d133a81..479a6b57254e 100644 --- a/test/Microsoft.NET.TestFramework/TestAssetsManager.cs +++ b/test/Microsoft.NET.TestFramework/TestAssetsManager.cs @@ -95,7 +95,7 @@ public TestAsset CreateTestProjects( var testAsset = CreateTestProjectsInDirectory(testProjects, testDestinationDirectory); - var slnCreationResult = new DotnetNewCommand(Log, "sln") + var slnCreationResult = new DotnetNewCommand(Log, "sln", "--format", "sln") .WithVirtualHive() .WithWorkingDirectory(testDestinationDirectory) .Execute(); diff --git a/test/dotnet-new.IntegrationTests/Approvals/AllCommonItemsCreate.-o#Solution-File#-n#item.verified/Solution-File/item.sln b/test/dotnet-new.IntegrationTests/Approvals/AllCommonItemsCreate.-o#Solution-File#-n#item#--format#sln.verified/Solution-File/item.sln similarity index 100% rename from test/dotnet-new.IntegrationTests/Approvals/AllCommonItemsCreate.-o#Solution-File#-n#item.verified/Solution-File/item.sln rename to test/dotnet-new.IntegrationTests/Approvals/AllCommonItemsCreate.-o#Solution-File#-n#item#--format#sln.verified/Solution-File/item.sln diff --git a/test/dotnet-new.IntegrationTests/Approvals/AllCommonItemsCreate.-o#Solution-File#-n#item#--format#sln.verified/std-streams/stdout.txt b/test/dotnet-new.IntegrationTests/Approvals/AllCommonItemsCreate.-o#Solution-File#-n#item#--format#sln.verified/std-streams/stdout.txt new file mode 100644 index 000000000000..70cab17a4b13 --- /dev/null +++ b/test/dotnet-new.IntegrationTests/Approvals/AllCommonItemsCreate.-o#Solution-File#-n#item#--format#sln.verified/std-streams/stdout.txt @@ -0,0 +1 @@ +The template "%TEMPLATE_NAME%" was created successfully. \ No newline at end of file diff --git a/test/dotnet-new.IntegrationTests/Approvals/AllCommonItemsCreate.-o#Solution-File#-n#item#--format#slnx.verified/Solution-File/item.slnx b/test/dotnet-new.IntegrationTests/Approvals/AllCommonItemsCreate.-o#Solution-File#-n#item#--format#slnx.verified/Solution-File/item.slnx new file mode 100644 index 000000000000..ba788ff0d17d --- /dev/null +++ b/test/dotnet-new.IntegrationTests/Approvals/AllCommonItemsCreate.-o#Solution-File#-n#item#--format#slnx.verified/Solution-File/item.slnx @@ -0,0 +1,2 @@ + + diff --git a/test/dotnet-new.IntegrationTests/Approvals/AllCommonItemsCreate.-o#Solution-File#-n#item#--format#slnx.verified/std-streams/stdout.txt b/test/dotnet-new.IntegrationTests/Approvals/AllCommonItemsCreate.-o#Solution-File#-n#item#--format#slnx.verified/std-streams/stdout.txt new file mode 100644 index 000000000000..70cab17a4b13 --- /dev/null +++ b/test/dotnet-new.IntegrationTests/Approvals/AllCommonItemsCreate.-o#Solution-File#-n#item#--format#slnx.verified/std-streams/stdout.txt @@ -0,0 +1 @@ +The template "%TEMPLATE_NAME%" was created successfully. \ No newline at end of file diff --git a/test/dotnet-new.IntegrationTests/Approvals/AllCommonItemsCreate.-o#Solution-File#-n#item.verified/Solution-File/item.slnx b/test/dotnet-new.IntegrationTests/Approvals/AllCommonItemsCreate.-o#Solution-File#-n#item.verified/Solution-File/item.slnx new file mode 100644 index 000000000000..ba788ff0d17d --- /dev/null +++ b/test/dotnet-new.IntegrationTests/Approvals/AllCommonItemsCreate.-o#Solution-File#-n#item.verified/Solution-File/item.slnx @@ -0,0 +1,2 @@ + + diff --git a/test/dotnet-new.IntegrationTests/Approvals/PostActionTests.AddProjectToSolution_Basic_Approval.Linux.verified.txt b/test/dotnet-new.IntegrationTests/Approvals/PostActionTests.AddProjectToSolution_Basic_Approval.Linux.verified.txt index 2e38e42367e5..799ac7d3a9dc 100644 --- a/test/dotnet-new.IntegrationTests/Approvals/PostActionTests.AddProjectToSolution_Basic_Approval.Linux.verified.txt +++ b/test/dotnet-new.IntegrationTests/Approvals/PostActionTests.AddProjectToSolution_Basic_Approval.Linux.verified.txt @@ -3,7 +3,7 @@ Processing post-creation actions... Adding project(s): %working directory%/MyProject.csproj - to solution file: %working directory%/MySolution.sln + to solution file: %working directory%/MySolution.slnx solution folder: src %CALLBACK OUTPUT% Successfully added project(s) to a solution file. \ No newline at end of file diff --git a/test/dotnet-new.IntegrationTests/Approvals/PostActionTests.AddProjectToSolution_Basic_Approval.OSX.verified.txt b/test/dotnet-new.IntegrationTests/Approvals/PostActionTests.AddProjectToSolution_Basic_Approval.OSX.verified.txt index 2e38e42367e5..799ac7d3a9dc 100644 --- a/test/dotnet-new.IntegrationTests/Approvals/PostActionTests.AddProjectToSolution_Basic_Approval.OSX.verified.txt +++ b/test/dotnet-new.IntegrationTests/Approvals/PostActionTests.AddProjectToSolution_Basic_Approval.OSX.verified.txt @@ -3,7 +3,7 @@ Processing post-creation actions... Adding project(s): %working directory%/MyProject.csproj - to solution file: %working directory%/MySolution.sln + to solution file: %working directory%/MySolution.slnx solution folder: src %CALLBACK OUTPUT% Successfully added project(s) to a solution file. \ No newline at end of file diff --git a/test/dotnet-new.IntegrationTests/Approvals/PostActionTests.AddProjectToSolution_Basic_Approval.Windows.verified.txt b/test/dotnet-new.IntegrationTests/Approvals/PostActionTests.AddProjectToSolution_Basic_Approval.Windows.verified.txt index e6b887af4bf2..951a5359e54d 100644 --- a/test/dotnet-new.IntegrationTests/Approvals/PostActionTests.AddProjectToSolution_Basic_Approval.Windows.verified.txt +++ b/test/dotnet-new.IntegrationTests/Approvals/PostActionTests.AddProjectToSolution_Basic_Approval.Windows.verified.txt @@ -3,7 +3,7 @@ Processing post-creation actions... Adding project(s): %working directory%\MyProject.csproj - to solution file: %working directory%\MySolution.sln + to solution file: %working directory%\MySolution.slnx solution folder: src %CALLBACK OUTPUT% Successfully added project(s) to a solution file. \ No newline at end of file diff --git a/test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs b/test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs index ad1499294f64..3a373345ff59 100644 --- a/test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs +++ b/test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs @@ -37,6 +37,8 @@ public CommonTemplatesTests(SharedHomeDirectory fixture, ITestOutputHelper log) [InlineData("dotnet gitignore file", "gitignore", null)] [InlineData("dotnet gitignore file", ".gitignore", null)] [InlineData("Solution File", "sln", null)] + [InlineData("Solution File", "sln", new[] { "--format", "sln" })] + [InlineData("Solution File", "sln", new[] { "--format", "slnx" })] [InlineData("Solution File", "solution", null)] [InlineData("Dotnet local tool manifest file", "tool-manifest", null)] [InlineData("Web Config", "webconfig", null)] diff --git a/test/dotnet-new.IntegrationTests/PostActionTests.cs b/test/dotnet-new.IntegrationTests/PostActionTests.cs index 5067e8bba7dd..3e9c6a391914 100644 --- a/test/dotnet-new.IntegrationTests/PostActionTests.cs +++ b/test/dotnet-new.IntegrationTests/PostActionTests.cs @@ -775,7 +775,7 @@ public void AddProjectToSolution_Basic(string templatePartLocation, string templ .And.HaveStdOutContaining("solution folder: src") .And.NotHaveStdOutContaining("Manual instructions: Add the generated files to solution manually."); - Assert.Contains("MyProject.csproj", File.ReadAllText(Path.Combine(workingDirectory, "MySolution.sln"))); + Assert.Contains("MyProject.csproj", File.ReadAllText(Path.Combine(workingDirectory, "MySolution.slnx"))); } [Fact] @@ -811,7 +811,7 @@ public void AddProjectToSolution_BasicInSolutionRoot() .And.HaveStdOutContaining(Path.Combine(outputDirectory, "MySolution.sln")) .And.HaveStdOutContaining(Path.Combine(outputDirectory, "MyProject.csproj")); - Assert.Contains("MyProject.csproj", File.ReadAllText(Path.Combine(outputDirectory, "MySolution.sln"))); + Assert.Contains("MyProject.csproj", File.ReadAllText(Path.Combine(outputDirectory, "MySolution.slnx"))); } [Fact] @@ -847,7 +847,7 @@ public void AddProjectToSolution_WithOutputAbsolutePath() .And.HaveStdOutContaining(Path.Combine(outputDirectory, "MySolution.sln")) .And.HaveStdOutContaining(Path.Combine(outputDirectory, "MyProject.csproj")); - Assert.Contains("MyProject.csproj", File.ReadAllText(Path.Combine(outputDirectory, "MySolution.sln"))); + Assert.Contains("MyProject.csproj", File.ReadAllText(Path.Combine(outputDirectory, "MySolution.slnx"))); } [Fact] @@ -883,7 +883,7 @@ public void AddProjectToSolution_WithOutputRelativePath() .And.HaveStdOutContaining(Path.Combine(workingDirectory, outputDirectory, "MySolution.sln")) .And.HaveStdOutContaining(Path.Combine(workingDirectory, outputDirectory, "MyProject.csproj")); - Assert.Contains("MyProject.csproj", File.ReadAllText(Path.Combine(workingDirectory, outputDirectory, "MySolution.sln"))); + Assert.Contains("MyProject.csproj", File.ReadAllText(Path.Combine(workingDirectory, outputDirectory, "MySolution.slnx"))); } [Fact] @@ -916,11 +916,11 @@ public void AddProjectToSolution_PrimaryOutputIndexes() .And.HaveStdOutContaining("solution folder: Server") .And.NotHaveStdOutContaining("Manual instructions: Add generated Server project to solution manually to folder 'Server'."); - Assert.True(File.Exists(Path.Combine(workingDirectory, "MySolution.sln"))); + Assert.True(File.Exists(Path.Combine(workingDirectory, "MySolution.slnx"))); Assert.True(File.Exists(Path.Combine(workingDirectory, "Server/Server.csproj"))); Assert.True(File.Exists(Path.Combine(workingDirectory, "Client/Client.csproj"))); - string solutionFileContents = File.ReadAllText(Path.Combine(workingDirectory, "MySolution.sln")); + string solutionFileContents = File.ReadAllText(Path.Combine(workingDirectory, "MySolution.slnx")); Assert.Contains("Server.csproj", solutionFileContents); Assert.DoesNotContain("Client.csproj", solutionFileContents); }