Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading