This page walks you through everything you need to build, run, and test the TestClone API on your local machine.
| Requirement | Minimum Version | Notes |
|---|---|---|
| .NET SDK | 10.0 | Pinned via global.json; install from dot.net |
| Git | Any recent | For cloning the repository |
| IDE (optional) | VS 2022 / Rider / VS Code | .vscode/ settings are included |
Tip: Run
dotnet --versionto confirm the correct SDK is active. The repository includes aglobal.jsonthat pins the SDK version automatically.
git clone https://github.com/HarroCReineking/test.clone.git
cd test.clone
NuGet packages are managed centrally in Directory.Packages.props. Restore them with:
dotnet restore
dotnet build
All warnings are treated as errors (Directory.Build.props), so a clean build with no output means everything is in order.
dotnet run --project src/WebApi
The API starts on https://localhost:5260 by default. Open Swagger UI in your browser to explore and call the available endpoints:
https://localhost:5260/swagger
Execute all unit tests across both test projects:
dotnet test
To run tests for a specific project:
# Presentation layer tests
dotnet test src/WebApi.UnitTests
# Business logic layer tests
dotnet test src/DomainApi.UnitTests
| File | Purpose |
|---|---|
src/WebApi/appsettings.json |
Base application settings |
src/WebApi/appsettings.Development.json |
Development-environment overrides |
global.json |
Pinned .NET SDK version |
Directory.Build.props |
Shared MSBuild properties (nullable, warnings-as-errors) |
Directory.Packages.props |
Centralised NuGet package versions |
The ASP.NET Core configuration system loads settings in this order (later entries override earlier ones):
appsettings.jsonappsettings.{Environment}.json (e.g. appsettings.Development.json)Set the active environment via the ASPNETCORE_ENVIRONMENT variable:
# PowerShell
$env:ASPNETCORE_ENVIRONMENT = "Development"
# Bash / zsh
export ASPNETCORE_ENVIRONMENT=Development