Skip to content

Commit 48985a8

Browse files
Upgrade to xunit 3 (#2396)
* Make exercise projects executables * Upgrade packages * Update lock files * Fixup project file * Minor fix * diamond: fix fscheck * hyperia-forex: fix fscheck * Fix lock files [no important files changed]
1 parent 850da01 commit 48985a8

File tree

363 files changed

+16573
-8209
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

363 files changed

+16573
-8209
lines changed

bin/add-practice-exercise.ps1

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +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
3637
& dotnet sln exercises/Exercises.sln add $project
3738

38-
# Update project packages
39-
& dotnet remove $project package coverlet.collector
40-
& dotnet add $project package Exercism.Tests --version 0.1.0-beta1
41-
& dotnet add $project package xunit.runner.visualstudio --version 3.0.1
42-
& dotnet add $project package xunit --version 2.8.1
43-
& dotnet add $project package Microsoft.NET.Test.Sdk --version 17.12.0
39+
[xml]$project = Get-Content $projectFile
40+
$project.Project.PropertyGroup.RemoveChild($project.Project.PropertyGroup.SelectSingleNode("//comment()"))
41+
$project.Project.RemoveChild($project.Project.ItemGroup[0])
42+
$project.Project.ItemGroup[1].SelectSingleNode("PackageReference[@Include='Microsoft.NET.Test.Sdk']").SetAttribute("Version", "17.12.0")
43+
$project.Project.ItemGroup[1].SelectSingleNode("PackageReference[@Include='xunit.v3']").SetAttribute("Version", "1.1.0")
44+
$project.Project.ItemGroup[1].SelectSingleNode("PackageReference[@Include='xunit.runner.visualstudio']").SetAttribute("Version", "3.0.2")
45+
$project.Save($projectFile)
4446

4547
# Remove and update files
4648
Remove-Item -Path "${exerciseDir}/UnitTest1.cs"

exercises/concept/annalyns-infiltration/AnnalynsInfiltration.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net9.0</TargetFramework>
5+
<OutputType>Exe</OutputType>
56
<Nullable>enable</Nullable>
67
<ImplicitUsings>enable</ImplicitUsings>
78
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
@@ -13,9 +14,9 @@
1314

1415
<ItemGroup>
1516
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
16-
<PackageReference Include="xunit" Version="2.8.1" />
17+
<PackageReference Include="xunit.v3" Version="1.1.0" />
1718
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1" />
18-
<PackageReference Include="Exercism.Tests" Version="0.1.0-beta1" />
19+
<PackageReference Include="Exercism.Tests.xunit.v3" Version="0.1.0-beta1" />
1920
</ItemGroup>
2021

2122
</Project>

exercises/concept/annalyns-infiltration/packages.lock.json

Lines changed: 91 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
"version": 1,
33
"dependencies": {
44
"net9.0": {
5-
"Exercism.Tests": {
5+
"Exercism.Tests.xunit.v3": {
66
"type": "Direct",
77
"requested": "[0.1.0-beta1, )",
88
"resolved": "0.1.0-beta1",
9-
"contentHash": "g+ZEvkReJ/ghRMpSw2qrSzICQDygKcR2nokvigiQXZTUxFplii8ZSFFKrGKEn6jIHuIeMeBFUFpk4CkyVw+6wA==",
9+
"contentHash": "XjVtQWWxmHDDj7UMdkPKpBFFKnsW0tkBhlyJSfFFh+fWwGemyyJwJYhdsvWhiKKCY7zItB+mI/o0OQtOKQxUhA==",
1010
"dependencies": {
11-
"xunit.extensibility.core": "2.4.1"
11+
"xunit.v3.extensibility.core": "1.1.0"
1212
}
1313
},
1414
"Microsoft.NET.Test.Sdk": {
@@ -21,28 +21,54 @@
2121
"Microsoft.TestPlatform.TestHost": "17.12.0"
2222
}
2323
},
24-
"xunit": {
25-
"type": "Direct",
26-
"requested": "[2.8.1, )",
27-
"resolved": "2.8.1",
28-
"contentHash": "MLBz2NQp3rtSIoJdjj3DBEr/EeOFlQYF3oCCljat3DY9GQ7yYmtjIAv8Zyfm5BcwYso5sjvIe5scuHaJPVCGIQ==",
29-
"dependencies": {
30-
"xunit.analyzers": "1.14.0",
31-
"xunit.assert": "2.8.1",
32-
"xunit.core": "[2.8.1]"
33-
}
34-
},
3524
"xunit.runner.visualstudio": {
3625
"type": "Direct",
3726
"requested": "[3.0.1, )",
3827
"resolved": "3.0.1",
3928
"contentHash": "lbyYtsBxA8Pz8kaf5Xn/Mj1mL9z2nlBWdZhqFaj66nxXBa4JwiTDm4eGcpSMet6du9TOWI6bfha+gQR6+IHawg=="
4029
},
30+
"xunit.v3": {
31+
"type": "Direct",
32+
"requested": "[1.1.0, )",
33+
"resolved": "1.1.0",
34+
"contentHash": "1ckSz5GVswlM9TCk5bGdHOjnYwqAWjkeqxckoHawQIA8sTeuN+RCBUypCi5A/Um0XlczRx5TjAK5W6BbN0HLcQ==",
35+
"dependencies": {
36+
"xunit.analyzers": "1.20.0",
37+
"xunit.v3.assert": "[1.1.0]",
38+
"xunit.v3.core": "[1.1.0]"
39+
}
40+
},
41+
"Microsoft.Bcl.AsyncInterfaces": {
42+
"type": "Transitive",
43+
"resolved": "6.0.0",
44+
"contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg=="
45+
},
4146
"Microsoft.CodeCoverage": {
4247
"type": "Transitive",
4348
"resolved": "17.12.0",
4449
"contentHash": "4svMznBd5JM21JIG2xZKGNanAHNXplxf/kQDFfLHXQ3OnpJkayRK/TjacFjA+EYmoyuNXHo/sOETEfcYtAzIrA=="
4550
},
51+
"Microsoft.Testing.Extensions.TrxReport.Abstractions": {
52+
"type": "Transitive",
53+
"resolved": "1.5.3",
54+
"contentHash": "h34zKNpGyni66VH738mRHeXSnf3klSShUdavUWNhSfWICUUi5aXeI0LBvoX/ad93N0+9xBDU3Fyi6WfxrwKQGw==",
55+
"dependencies": {
56+
"Microsoft.Testing.Platform": "1.5.3"
57+
}
58+
},
59+
"Microsoft.Testing.Platform": {
60+
"type": "Transitive",
61+
"resolved": "1.5.3",
62+
"contentHash": "WqJydnJ99dEKtquR9HwINz104ehWJKTXbQQrydGatlLRw14bmsx0pa8+E6KUXMYXZAimN0swWlDmcJGjjW4TIg=="
63+
},
64+
"Microsoft.Testing.Platform.MSBuild": {
65+
"type": "Transitive",
66+
"resolved": "1.5.3",
67+
"contentHash": "bOtpRMSPeT5YLQo+NNY8EtdNTphAUcmALjW4ABU7P0rb6yR2XAZau3TzNieLmR3lRuwudguWzzBhgcLRXwZh0A==",
68+
"dependencies": {
69+
"Microsoft.Testing.Platform": "1.5.3"
70+
}
71+
},
4672
"Microsoft.TestPlatform.ObjectModel": {
4773
"type": "Transitive",
4874
"resolved": "17.12.0",
@@ -65,49 +91,78 @@
6591
"resolved": "13.0.1",
6692
"contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A=="
6793
},
94+
"System.Collections.Immutable": {
95+
"type": "Transitive",
96+
"resolved": "8.0.0",
97+
"contentHash": "AurL6Y5BA1WotzlEvVaIDpqzpIPvYnnldxru8oXJU2yFxFUy3+pNXjXd1ymO+RA0rq0+590Q8gaz2l3Sr7fmqg=="
98+
},
99+
"System.Memory": {
100+
"type": "Transitive",
101+
"resolved": "4.6.0",
102+
"contentHash": "OEkbBQoklHngJ8UD8ez2AERSk2g+/qpAaSWWCBFbpH727HxDq5ydVkuncBaKcKfwRqXGWx64dS6G1SUScMsitg=="
103+
},
68104
"System.Reflection.Metadata": {
69105
"type": "Transitive",
70106
"resolved": "1.6.0",
71107
"contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ=="
72108
},
73-
"xunit.abstractions": {
109+
"xunit.analyzers": {
74110
"type": "Transitive",
75-
"resolved": "2.0.3",
76-
"contentHash": "pot1I4YOxlWjIb5jmwvvQNbTrZ3lJQ+jUGkGjWE3hEFM0l5gOnBWS+H3qsex68s5cO52g+44vpGzhAt+42vwKg=="
111+
"resolved": "1.20.0",
112+
"contentHash": "HElev2E9vFbPxwKRQtpCSSzLOu8M/N9EWBCB37v7SRx6z4Lbj19FxfLEig3v9jiI6s4b0l2uena91nEsTWl9jA=="
77113
},
78-
"xunit.analyzers": {
114+
"xunit.v3.assert": {
79115
"type": "Transitive",
80-
"resolved": "1.14.0",
81-
"contentHash": "KcFBmV2150xZHPUebV3YLR5gGl8R4wLuPOoxMiwCf1L4bL8ls0dcwtGFzr6NvQRgg6dWgSqbE52I6SYyeB0VnQ=="
116+
"resolved": "1.1.0",
117+
"contentHash": "4D+eM08ImfhA+zLbRzi8HA4qsT98zDxgaCD7vCg8yFesokKsgSsqWsAmImHFjVymGVhVS7WFGb19d6v1k9i0xQ==",
118+
"dependencies": {
119+
"System.Collections.Immutable": "8.0.0",
120+
"System.Memory": "4.6.0"
121+
}
122+
},
123+
"xunit.v3.common": {
124+
"type": "Transitive",
125+
"resolved": "1.1.0",
126+
"contentHash": "Cq55z8pC7fOkfj+3TB/YQ6OW96qWqxKiMd15CtkIl37VtV9EsiUL4B4HsR6VLJCzkk7cBiXQ1ABVIcp3TCm6HQ==",
127+
"dependencies": {
128+
"Microsoft.Bcl.AsyncInterfaces": "6.0.0"
129+
}
82130
},
83-
"xunit.assert": {
131+
"xunit.v3.core": {
84132
"type": "Transitive",
85-
"resolved": "2.8.1",
86-
"contentHash": "DDM18ur+PeNFhQ4w/vO+uvCUy8hA3OS5+AMf/CFov9Wco7Le49zzj0hovRWwa8f/3vaUfjL5r+IkPvqEHu2IIg=="
133+
"resolved": "1.1.0",
134+
"contentHash": "kXP/1d3jnQ2m4skcdM3gSMmubI6P747D6KVswzeedysgFkLj2xJlfo7p7slsmtEnp8BZb8X6D92Hssd/UtVPMw==",
135+
"dependencies": {
136+
"Microsoft.Testing.Platform.MSBuild": "1.5.3",
137+
"xunit.v3.extensibility.core": "[1.1.0]",
138+
"xunit.v3.runner.inproc.console": "[1.1.0]"
139+
}
87140
},
88-
"xunit.core": {
141+
"xunit.v3.extensibility.core": {
89142
"type": "Transitive",
90-
"resolved": "2.8.1",
91-
"contentHash": "Ng4Q/DOwotESPl5CufcdqgP6O2KDpdEcIvNfA3upzfCiBrkj5WsmLhf/XUsCVolzvHA7b1WUlyeTo7j1ulG4gQ==",
143+
"resolved": "1.1.0",
144+
"contentHash": "AeQbbYN001x0c+B9pqwml6jZPovHz8O/sOp7jmrjz90rUzz/QPal12SlHLKYszR44CMnW4MsDam3RYT5pkYUxw==",
92145
"dependencies": {
93-
"xunit.extensibility.core": "[2.8.1]",
94-
"xunit.extensibility.execution": "[2.8.1]"
146+
"xunit.v3.common": "[1.1.0]"
95147
}
96148
},
97-
"xunit.extensibility.core": {
149+
"xunit.v3.runner.common": {
98150
"type": "Transitive",
99-
"resolved": "2.8.1",
100-
"contentHash": "ilfAsxEhpne9AXXf3W+O65mRgGum94m2xHYm1yeJ1m7eiINM6OOwpaHhoNC/KWEQ2u/WF6/XiEs+Q0TOq7hiGA==",
151+
"resolved": "1.1.0",
152+
"contentHash": "Q81J0VPuu8fpF+/1CIjThqKKUjnqh0TQrLlD0iORkF75KdsOV+iGWT8c3AVuY96kDoxXxkTf0ZvJsK6o9osc1A==",
101153
"dependencies": {
102-
"xunit.abstractions": "2.0.3"
154+
"xunit.v3.common": "[1.1.0]"
103155
}
104156
},
105-
"xunit.extensibility.execution": {
157+
"xunit.v3.runner.inproc.console": {
106158
"type": "Transitive",
107-
"resolved": "2.8.1",
108-
"contentHash": "38UnJW+64Wn8QIabujcNEw0HKvWw2AlYCgU8GNwCCDqyrSuRYb7zwetn7SHoHfbL9e9FAvEiAMXmc2wSUY8sVQ==",
159+
"resolved": "1.1.0",
160+
"contentHash": "lX/4TwIJe9ysCd5dqLk/Doq8ieYaZGivgf95xR59wRuSV+nHzHnyhpjXfaPUp8nkncUH1rOmJ85o1KebipisXQ==",
109161
"dependencies": {
110-
"xunit.extensibility.core": "[2.8.1]"
162+
"Microsoft.Testing.Extensions.TrxReport.Abstractions": "1.5.3",
163+
"Microsoft.Testing.Platform": "1.5.3",
164+
"xunit.v3.extensibility.core": "[1.1.0]",
165+
"xunit.v3.runner.common": "[1.1.0]"
111166
}
112167
}
113168
}

exercises/concept/attack-of-the-trolls/AttackOfTheTrolls.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net9.0</TargetFramework>
5+
<OutputType>Exe</OutputType>
56
<Nullable>enable</Nullable>
67
<ImplicitUsings>enable</ImplicitUsings>
78
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
@@ -13,9 +14,9 @@
1314

1415
<ItemGroup>
1516
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
16-
<PackageReference Include="xunit" Version="2.8.1" />
17+
<PackageReference Include="xunit.v3" Version="1.1.0" />
1718
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1" />
18-
<PackageReference Include="Exercism.Tests" Version="0.1.0-beta1" />
19+
<PackageReference Include="Exercism.Tests.xunit.v3" Version="0.1.0-beta1" />
1920
</ItemGroup>
2021

2122
</Project>

0 commit comments

Comments
 (0)