Skip to content
Open
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
1 change: 1 addition & 0 deletions dot-net-core/.tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dotnet 10
29 changes: 21 additions & 8 deletions dot-net-core/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
# .NET Core

Pairing test skeleton using .NET core and `nunit` for testing.
Skeleton project for .NET Core (C#).

## Prerequisites

The toolchain this project needs is declared in [`.tool-versions`](./.tool-versions):

```
dotnet 10
```

Install those however you prefer, as long as they end up on your `PATH`. The quickest route is
[mise](https://mise.jdx.dev/), which reads the file for you:

```sh
mise install
```

## Usage
- `./script/setup` to install dependencies (uses [homebrew](https://brew.sh/))
- `./script/test` to run the tests
- `./script/start` to run the code
- `./script/setup` to restore dependencies
- `./script/test` to run the tests, or `./script/test --watch` to re-run them on every change
- `./script/start` to run the app

## Structure
- Code located in [`PairingTest.cs`](./Code/PairingTest.cs)
- Tests located in [`Tests.cs`](./Test/Tests.cs)

However, you're free to organise your code as you like.
However, you're free to organise your code as you like.

## Notes
IDE-wise you can use VS Code with the standard Microsoft C# extension.

Skeleton created following these instructions: https://docs.microsoft.com/en-us/dotnet/core/testing/unit-testing-with-nunit
IDE-wise you can use VS Code with the standard Microsoft C# extension.
6 changes: 4 additions & 2 deletions dot-net-core/script/setup
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

set -e
set -euo pipefail

brew install dotnet-sdk
cd "$(dirname "${BASH_SOURCE[0]}")/.."

dotnet restore
4 changes: 3 additions & 1 deletion dot-net-core/script/start
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

set -e
set -euo pipefail

cd "$(dirname "${BASH_SOURCE[0]}")/.."

dotnet run --project Code
10 changes: 8 additions & 2 deletions dot-net-core/script/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env bash

set -e
set -euo pipefail

dotnet test
cd "$(dirname "${BASH_SOURCE[0]}")/.."

if [[ "${1:-}" == "--watch" ]]; then
dotnet watch test
else
dotnet test
fi
Loading