This is a test API service built on top of .Net Core Framework 3.1.
The implementation applies the Mediatr pipeline with a command query pattern as shown below:
Requests validation has been decoupled by using FluentValidation.
For test purpose, data will be stored in memory by using Entity Framework Core InMemory.
Application telemetries recorded by using Microsoft.ApplicationInsight.AspNetCore.
- FluentValidation.AspNetCore 8.6.2
- MediatR 8.0.1
- Microsoft.EntityFrameworkCore.InMemory 3.1.4
- Swashbuckle.AspNetCore.Swagger
- Microsoft.ApplicationInsight.AspNetCore
- Microsoft.Extensions.Http.Polly
- AutoMapper
- NUnit
- Moq
Running the API project locally will launch the Swagger client exposing 5 endpoints as shown below:
Each endpoint exposes its request/response schema.
An example of test flow could be:
- Submit one or more Transactions via the ../api/beta/transactions endpoint.
- Use the merchantId from previous response to invoke the ../api/beta/merchants/{id}/transactions and fetch all its transactions (successful and non).
- Use the transactionId from previous response to invoke the ../api/beta/transactions/{id}/ and fetch the transaction detail.
- After playng around with above endpoints, youcan try out and have a look at telemetries fetched by Azure Application Insights:
- ../api/beta/Telemetries/events/all/top/10 to check out what kind of events have bee recored.
- ../api/beta/Telemetries/requests/count to check out how many requests have been submitted.
The Transactions validation will be apllied using the response codes listed at Checkout testing page via a mocked service.