A C# test project demonstrating REST API testing against the Restful Booker public API.
Tests cover three areas of the Restful Booker API:
- Auth - token generation via
POST /auth - Booking - create, read, update, and delete bookings via
/booking - Health check - service availability via
GET /ping
- .NET 10 / xUnit
- FluentAssertions
- Newtonsoft.Json
HttpClientviaMicrosoft.Extensions.HttpMicrosoft.Extensions.Configurationfor settings and secrets
API credentials are read from Config/appsettings.json and can be overridden with environment variables (used in CI).
| Folder | Purpose |
|---|---|
Controllers/ |
Test classes organized by API controller (Auth, Booking, Ping) |
Fixtures/ |
TestFixture — sets up HttpClient and handles auth token caching |
Models/ |
DTOs for serializing request and response bodies |
Config/ |
ApiSettings and TestConfiguration — reads from appsettings.json or environment variables |
dotnet test