Single-resource booking system (.NET 10) with clean-core architecture. One resource, whole-hour slots, 08:00–15:00.
# API
dotnet run --project SimpleBooking.Api # http://localhost:5106
# CLI client (needs API running)
dotnet run --project SimpleBooking.Cli
# Tests
dotnet testClean core: domain logic in SimpleBooking.Core with zero I/O. Infrastructure, API, and console apps depend on Core.
| Project | Type | Stores |
|---|---|---|
SimpleBooking.Core |
Class library | Domain models, BookingService, repository interfaces |
SimpleBooking.Infrastructure |
Class library | EF Core SQLite, SqlBookingRepository, JsonBookingRepository |
SimpleBooking.Api |
ASP.NET Core | REST API with SQLite DB |
SimpleBooking.Cli |
Console app | HTTP client — calls API, no project refs |
SimpleBooking |
Console app | Legacy app with JSON repos |
*.Tests |
NUnit 4.3.2 | Unit + integration tests, hand-rolled fakes |
| Method | Path | Body |
|---|---|---|
| GET | /api/bookings |
— |
| POST | /api/bookings |
{"date":"2026-05-12","hour":10,"description":"Teammøte"} |
| GET | /api/schedule/2026-05-12 |
— |
- Opening hours: 08–15 (8 slots)
- Cannot book today or past dates
- One resource — no overlapping bookings
Booking.IdisGuidHourStatus.IsAvailable—truemeans free
- No mocking library (Moq/NSubstitute). Hand-roll fakes in test files
- Unit tests:
CreateService(...)factory,FakeClockfor time - Integration tests:
WebApplicationFactory<Program>with temp SQLite DB - Use
[TestCase]for boundaries
- Solution file is
.slnx(XML), not.sln - API auto-creates DB via
EnsureCreated()on startup Programin API ispublic partialforWebApplicationFactory