diff --git a/AGENTS.md b/AGENTS.md index 68b46b5..dbade4f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -45,6 +45,16 @@ dotnet run info MergeTwoLists dotnet run list ``` +## Updating .NET versions + +When you bump the .NET SDK or target framework, update these together: + +- `global.json`: the minimum SDK `version`. +- `Directory.Build.props`: `TargetFramework`. +- `LeetCode/Dockerfile`: the `sdk` and `runtime` image tags. +- `README.md`: the minimum SDK, and the `dotnet --list-sdks` and `git --version` output under "Build and test". + Check for a newer git release at the same time. + ## Architecture This is a LeetCode problem solutions repository with benchmarking capabilities, structured as follows: diff --git a/README.md b/README.md index 783c2ff..a0aee55 100644 --- a/README.md +++ b/README.md @@ -8,21 +8,35 @@ After stumbling across the excellent [NeetCode](https://neetcode.io) website I'm ### Build and test +Install the .NET 10 SDK, version 10.0.400 or later. `global.json` rolls forward to the newest feature band you have. + ``` bash > dotnet --list-sdks -10.0.103 [/usr/share/dotnet/sdk] +10.0.402 [/usr/share/dotnet/sdk] > git --version -git version 2.53.0 +git version 2.56.0 > git clone https://github.com/si618/leetcode.git Cloning into 'leetcode'... > cd leetcode > dotnet build -> dotnet test --no-restore +> dotnet test ``` +Tests run on xUnit v3 with [Microsoft.Testing.Platform](https://learn.microsoft.com/dotnet/core/testing/microsoft-testing-platform-intro), and sit beside the solution they test. + +``` bash +# Run a single test +> dotnet test --project LeetCode.CSharp --filter-method "*TwoSumTest" + +# Write TRX results and Cobertura coverage to artifacts/test-results, as CI does +> dotnet test --report-xunit-trx --results-directory artifacts/test-results --coverage --coverage-output-format cobertura +``` + +Build output goes to `artifacts/`, not to `bin/` and `obj/` in each project. + ### Console application An interactive console application can run benchmarks and show problem information.