The TestClone API is a RESTful HTTP API documented with OpenAPI 3.0 / Swagger UI.
Interactive docs: Start the API (
dotnet run --project src/WebApi) and openhttps://localhost:5260/swaggerto explore and execute endpoints directly in the browser.
https://localhost:5260
Returns a greeting message. Primarily used to verify the API and Facade wiring are working end-to-end.
Request
No request body or query parameters required.
GET /TestOperation HTTP/1.1
Host: localhost:5260
Response — 200 OK
| Field | Type | Description |
|---|---|---|
| (body) | string |
Greeting message from the Facade layer |
"Hello from the Facade!"
Creates a new product order. The order is processed by the Facade and assigned a random order ID with an initial status of "Pending".
Request
| Field | Type | Required | Description |
|---|---|---|---|
productName |
string |
✅ | Name of the product being ordered |
quantity |
integer |
✅ | Number of units to order |
POST /CreateOrder HTTP/1.1
Host: localhost:5260
Content-Type: application/json
{
"productName": "Widget A",
"quantity": 5
}
Response — 200 OK
| Field | Type | Description |
|---|---|---|
orderId |
integer |
Randomly generated unique order identifier (1000–9998) |
productName |
string |
Echoed product name from the request |
quantity |
integer |
Echoed quantity from the request |
status |
string |
Initial order status — always "Pending" |
{
"orderId": 4271,
"productName": "Widget A",
"quantity": 5,
"status": "Pending"
}
Defined in src/DomainModel/Requests/CreateOrderRequest.cs.
public class CreateOrderRequest
{
public string ProductName { get; set; }
public int Quantity { get; set; }
}
Defined in src/DomainModel/Responses/CreateOrderResponse.cs.
public class CreateOrderResponse
{
public int OrderId { get; set; }
public string ProductName { get; set; }
public int Quantity { get; set; }
public string Status { get; set; }
}
All endpoints are handled by TestCloneController (src/WebApi/TestCloneController.cs), which delegates to IFacade for business logic. The controller is deliberately thin — it only performs HTTP mapping and delegates work to the Facade layer.
[ApiController]
public class TestCloneController(IFacade facade) : ControllerBase
{
[HttpGet]
[Route("TestOperation")]
public async Task<IActionResult> GetTestOperation() { ... }
[HttpPost]
[Route("CreateOrder")]
public async Task<IActionResult> PostCreateOrder(CreateOrderRequest request) { ... }
}