@@ -33,18 +33,23 @@ $exerciseName = (Get-Culture).TextInfo.ToTitleCase($Exercise).Replace("-", "")
3333$exerciseDir = " exercises/practice/${Exercise} "
3434$projectFile = " ${exerciseDir} /${ExerciseName} .csproj"
3535& dotnet new install xunit.v3.templates
36- & dotnet new xunit3 -- force -- output $exerciseDir -- name $ExerciseName
36+ & dotnet new xunit3 -- force -- framework net9. 0 -- output $exerciseDir -- name $ExerciseName
3737& dotnet sln exercises/ Exercises.sln add $projectFile
3838
3939[xml ]$project = Get-Content $projectFile
4040$project.Project.PropertyGroup.RemoveChild ($project.Project.PropertyGroup.SelectSingleNode (" //comment()" ))
4141$project.Project.PropertyGroup.RemoveChild ($project.Project.PropertyGroup.SelectSingleNode (" //RootNamespace" ))
42+ $restorePackagesWithLockFileElement = $project.CreateElement (" RestorePackagesWithLockFile" );
43+ $restorePackagesWithLockFileElement.InnerText = " true"
44+ $project.Project.PropertyGroup.AppendChild ($restorePackagesWithLockFileElement )
4245$project.Project.RemoveChild ($project.Project.ItemGroup [0 ])
4346$project.Project.ItemGroup [1 ].SelectSingleNode(" PackageReference[@Include='Microsoft.NET.Test.Sdk']" ).SetAttribute(" Version" , " 17.12.0" )
4447$project.Project.ItemGroup [1 ].SelectSingleNode(" PackageReference[@Include='xunit.v3']" ).SetAttribute(" Version" , " 1.1.0" )
45- $project.Project.ItemGroup [1 ].SelectSingleNode(" PackageReference[@Include='xunit.runner.visualstudio']" ).SetAttribute(" Version" , " 3.0.2 " )
48+ $project.Project.ItemGroup [1 ].SelectSingleNode(" PackageReference[@Include='xunit.runner.visualstudio']" ).SetAttribute(" Version" , " 3.0.1 " )
4649$project.Save ($projectFile )
4750
51+ dotnet add $projectFile package Exercism.Tests.xunit.v3 -- version 0.1 .0 - beta1
52+
4853# Remove and update files
4954Remove-Item - Path " ${exerciseDir} /xunit.runner.json"
5055Remove-Item - Path " ${exerciseDir} /UnitTest1.cs"
0 commit comments