Retarget exercise 3 to net10.0 and verify with dotnet test
Verified with SDK 10.0.4xx (mise): builds clean, solution test green deterministically, pristine test flaky as designed (failed 2/3 runs). net7.0 runtime is out of support and unavailable, so the exercise now targets net10.0; MSTest bumped 2.1.1 -> 3.6.4 to silence the NU1903 transitive-dependency warning. .gitignore for bin/obj.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
bin/
|
||||
obj/
|
||||
*.user
|
||||
@@ -5,7 +5,8 @@ A third, minimal example in the same kata theme: the sellers exist
|
||||
`Buyers` computes a buyer's shopping-list total, and `PriceList` stands for an
|
||||
external pricing service (it adds random surge pricing, so the test is flaky).
|
||||
|
||||
Written in **C#** (MSTest, .NET 7 — same setup as the kata's `csharp/` folder).
|
||||
Written in **C#** (MSTest, .NET 10; verified with `dotnet test` on SDK
|
||||
10.0.4xx — pristine test is flaky by design, solution is deterministic).
|
||||
Run with `dotnet test test/BuyersTests.csproj`.
|
||||
|
||||
Contents:
|
||||
@@ -33,8 +34,9 @@ Next-time arc: marketing adds surge discounts, `PriceList` grows
|
||||
`DiscountFor(...)` — two methods to stub → extract a role interface
|
||||
(`IPricing`) instead of two lambdas. See the demo script's closing note.
|
||||
|
||||
## Not verified by a build
|
||||
## Verified
|
||||
|
||||
This exercise was authored without a local .NET SDK (structurally mirrored from
|
||||
the kata's `csharp/` project files). Run `dotnet test test/BuyersTests.csproj`
|
||||
once on a machine with the SDK before facilitating.
|
||||
Built and run with `dotnet test` (SDK 10.0.4xx): solution green deterministically,
|
||||
pristine test flaky (failed 2 of 3 runs, passed 1 — both surges rolled 0).
|
||||
MSTest bumped to 3.6.4 (kata ships 2.1.1, whose transitive Newtonsoft.Json trips
|
||||
a NU1903 vulnerability warning).
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"sdk": {
|
||||
"version": "7.0.0",
|
||||
"rollForward": "latestMajor",
|
||||
"version": "10.0.0",
|
||||
"rollForward": "latestFeature",
|
||||
"allowPrerelease": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.1.1" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.1.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"sdk": {
|
||||
"version": "7.0.0",
|
||||
"rollForward": "latestMajor",
|
||||
"version": "10.0.0",
|
||||
"rollForward": "latestFeature",
|
||||
"allowPrerelease": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.1.1" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.1.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user