File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,18 @@ $PSNativeCommandUseErrorActionPreference = $true
3131# Create project
3232$exerciseName = (Get-Culture ).TextInfo.ToTitleCase($Exercise ).Replace(" -" , " " )
3333$exerciseDir = " exercises/practice/${Exercise} "
34- $project = " ${exerciseDir} /${ExerciseName} .csproj"
35- & dotnet new xunit -- force - lang " C#" -- target- framework- override net9.0 - o $exerciseDir - n $ExerciseName
34+ $projectFile = " ${exerciseDir} /${ExerciseName} .csproj"
35+ & dotnet new install xunit.v3.templates
36+ & dotnet new xunit3 -- force -- output $exerciseDir -- name $ExerciseName
37+
38+ [xml ]$project = Get-Content $projectFile
39+ $project.Project.PropertyGroup.RemoveChild ($project.Project.PropertyGroup.SelectSingleNode (" //comment()" ))
40+ $project.Project.RemoveChild ($project.Project.ItemGroup [0 ])
41+ $project.Project.ItemGroup [1 ].SelectSingleNode(" PackageReference[@Include='Microsoft.NET.Test.Sdk']" ).SetAttribute(" Version" , " 17.12.0" )
42+ $project.Project.ItemGroup [1 ].SelectSingleNode(" PackageReference[@Include='xunit.v3']" ).SetAttribute(" Version" , " 1.1.0" )
43+ $project.Project.ItemGroup [1 ].SelectSingleNode(" PackageReference[@Include='xunit.runner.visualstudio']" ).SetAttribute(" Version" , " 3.0.2" )
44+ $project.Save ($projectFile )
45+
3646& dotnet sln exercises/ Exercises.sln add $project
3747
3848# Update project packages
You can’t perform that action at this time.
0 commit comments