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 under the profile IntegrityAssurance.
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! π