A fun-to-use C# microservice built with .NET 8.
Itโs all about testing, automation, and making developersโ lives easier.
โญ Leave a star if you like it!
๐ฐ Found a bug? Report it here!
The Appointments Microservice is a testing playground disguised as a backend app. Itโs built to show off Unit Testing, Functional Testing, and Automation. Sure, it uses Clean Architecture, but the star of the show is making sure everything is fully tested and automated for reliability.
This app keeps things clean, testable, and easy to automate:
/Microservice.Appointments.sln # Main solution
/Microservice.Appointments.IntegrityAssurance.sln # Testing solution
/src
โโโ Api # Your API controllers, middlewares
โโโ Application # Use cases, DTOs, and services
โโโ Domain # Core business logic like entities and events
โโโ Infrastructure # Database, repositories, and external integrations
/tests
โโโ FunctionalTests # End-to-end tests for APIs
โโโ UnitTests # Isolated tests for logic and services
โโโ IntegrationTests # Tests that touch the database or external services
Clone this repo:
git clone https://github.com/maurogioberti/microservice-appointments.git
cd microservice-appointments
Restore dependencies:
dotnet restore
Set up and run the solutions:
Microservice.Appointments.sln
in Visual Studio or your preferred IDE.Microservice.Appointments.Api
as the startup project.http://localhost:[port]
).Microservice.Appointments.IntegrityAssurance.sln
.Microservice.Appointments.IntegrationTests
project.Microservice.Appointments.Api
is running in IntegrityAssurance mode.This project uses Docker to simplify the infrastructure setup. Make sure Docker is running, and the app will handle everything for you automatically.
Take a coffee โ and relax while the app spins up the containers. Hereโs whatโs included:
AppointmentCreatedEvent
.Everything is pre-configured and ready to go. Just hit โRunโ and start testing! ๐
Consistency is key, and this project follows the Given_When_Then naming convention for tests to ensure maintainability.
Given_[Condition]_When_[Action]_Then_[ExpectedOutcome]
Given_Valid_Parameters_When_ExecuteAsync_Called_Then_Returns_Expected_Result
.Unit tests keep things predictable:
Functional tests check the big picture:
Automation makes life easier. Hereโs what this microservice automates:
This microservice uses RabbitMQ ๐ to handle domain events asynchronously.
Where to manage it?
๐ Go to RabbitMQ Management UI and log in to see everything in action.
Queues youโll find:
appointment.created
๐ข: Triggered when a new appointment is created.appointment.changed
๐: Handles updates to appointments.appointment.deleted
โ: Removes appointment data from the system.appointment.notification
๐ฉ: Processes notifications and updates relevant data.๐ก The appointment.notification
queue listens for incoming events and automatically updates appointments when it receives a notification.
This project features a lightweight CI pipeline to keep everything stable and running smoothly.
๐ก With these automated steps, you can push with confidence knowing the app wonโt break! ๐ค
This project is under the MIT License, so feel free to use it, share it, or break itโjust donโt forget to give credit!
If youโre a dev ๐จโ๐ป and youโve never done something like thisโฆ ๐ค What are you waiting for? ๐ฅ Improve your quality and get excited to dive in! ๐