
Build and test a complete event-driven microservice architecture with C# .NET, containerized in Docker, focusing on end-to-end, integration, and contract testing.
Explore how event-driven architecture transforms microservices into scalable, loosely coupled systems by using an event streaming platform like Kafka, with producers and consumers publishing to topics for real-time analytics.
Learn how an event-driven microservice app uses rabbitmq, docker compose, and a web api and ui to publish and consume real-time updates across portals.
Learn a comprehensive testing approach for event-driven microservices, covering UI, API, database, message broker, and publisher and subscriber tests, guided by the testing pyramid and tools like Pact and Playwright.
Learn to test the UI of a distributed event-driven microservice app using Playwright, focusing on its thin UI layer and core functionality.
Migrate all projects to net7, then create a UI tests project using xUnit with SDK seven, and install Playwright to enable fast, browser-based UI testing for the microservice.
Learn to write a Playwright test in C# .NET by creating a Playwright instance, launching a browser, navigating to an inventory portal, and creating a product with name and quantity.
Install and use the fluent assertion library from NuGet to verify UI tests, checking for the text 'keyboard' on the all products page and practice data driven testing with parameters.
Apply data driven testing with inline data in XUnit, replacing values with parameterized inputs using the theory attribute. Run tests several times to cover permutations and avoid data reuse problems.
Use the auto fixture library to generate dynamic test data for xUnit tests, creating random product names and quantities that the test fills asynchronously.
Explore how an event-driven architecture using a service broker synchronizes inventory and customer portals, and test ui flows for product creation and verification.
Explore the testing pyramid and weigh the advantages of ui tests with playwright. Identify fragility, end-to-end coverage, and cost considerations across microservices.
Explore API testing in event-driven microservices, aligning with UI testing practices, as you verify APIs only when all services are up and the whole system is available.
Create a dedicated api tests project and use playwright to perform simple api tests against swagger endpoints, validating product get calls and the api-first approach guiding the next lecture.
Learn API testing with Playwright in C# .NET by creating an API context, setting a base URL, and issuing a GET to customer products endpoint to confirm a 200 status.
Deserialize the response into the product model, then verify with fluent assertions and assertion scope in API tests to validate product data and creation.
Examine the pros and cons of API testing with modern tools like Playwright, covering end-to-end flows, CRUD calls, contract testing, and the cloud-based integration challenges in event-driven microservices.
Explore integration testing for event-driven microservices, comparing it to costly UI and API tests, and learn to run in-memory tests with a test web host using ASP.NET Core MVC testing.
Learn to perform integration testing in an event-driven architecture by building in-memory services and databases, publishing messages via RabbitMQ, and validating end-to-end workflows across customer service, inventory, and API layers.
Test the api service and its database interactions using an in-memory EF Core and an in-memory customer service, with a web application factory for in-memory integration testing.
Modify program.cs in .NET 7 to run the EDA customer app in memory, bypass startup files, with a main entry in an ADA inventory namespace to test the products API.
Run an integration test to invoke the in-memory eda customer app and fetch /products with a default web client, noting the need for a running rabbit mq broker and localhost.
Set up in-memory data for an api service, add a product to the in-memory context, save via entity framework, and run an integration test with xUnit using http client.
Publish a message to RabbitMQ in the integration test and verify the customer service subscribes, stores inventory data in the database, and the products endpoint confirms consumption.
Install xUnit dependency injection, create a startup, and register the RabbitMQ utility as a singleton with its settings for integration tests.
Develop and test a RabbitMq subscriber for an event-driven microservice in C# .NET, using in-memory fixtures, dependency injection, and json serialized product messages to the inventory dot product queue.
Demonstrates resilience in test code with Polly retry, looping async operations for up to ten seconds to ensure message processing saves to the database and the API responds.
Refactor the test into an async method that returns a string via an HTTP client, publish a RabbitMQ message to trigger the EDA listener, and verify the API response.
Publish a product-related message via the rabbit in service broker and verify the database update using the repository pattern and unit of work for data access, with integration tests forthcoming.
Write a subscriber test against the database using Entity Framework, switching from API calls to a data repository, and validate product retrieval by ID in an integration test.
Test the complete workflow by posting a product to the in-memory inventory, publishing a RabbitMQ event, and validating customer and inventory updates via endpoints.
Write an end-to-end workflow test invoking both the EDA inventory and EDA customer APIs with in-memory databases and dedicated fixtures. Verify product creation and consumption across APIs and queues.
Continue the test workflow by creating a customer from the retrieved product id, purchasing inventory, and validating the end-to-end integration test using in-memory databases, services, and rabbit MQ.
Learn to fix test execution errors by configuring XUnit collections for sequential runs, properly disposing the web application factory, and ensuring reliable end-to-end integration tests.
Add an integration testing service with a separate docker-compose YAML, ensuring RabbitMQ is up before running tests, and connect Docker, tests, and GitHub actions CI/CD in the project.
Add a Linux-based Dockerfile and a separate Docker Compose file to run integration tests for the api and ui with dotnet test and a rabbitmq dependency.
Run and validate tests inside the Docker container using Docker Compose with a test YAML file, fix host name issues, and execute end-to-end integration testing in CI/CD pipelines.
Learn how contract testing with PACT enables consumer-driven tests for http services, generating a PACT file and using PACT verifier to validate the provider against consumer expectations.
Set up a contract testing project with pact .NET, configure the pact builder, and run an http pact server to verify the customer portal's /products endpoint against the EDA customer.
Set up pact consumer tests by configuring a pact http server, defining expectations for the /products get response, and verifying against the EDA underscore customer API using async verify.
Run pact consumer tests against the customer API to generate a contract, then verify the pact file against the provider using an HTTP pact server.
Learn to set up pact provider tests against the actual service using packed verifier configuration, JSON pact files, and the provider state URI for EDA underscore customer service.
Run pact provider tests against the actual EDA customer API running in a docker container on localhost:8000 to verify the get operation matches the expected response using packed verifier.
Build an event-driven microservice stack using ASP.NET Web API and RabbitMQ, connecting the customer and inventory portals via Docker compose. Publishers and subscribers handle orders and live inventory updates.
Implement the event-driven customer service api from scratch using dotnet 6, model customer and product data, configure ef core db context with sqlite, and expose portal and inventory controllers.
Design three controllers for customers and products to create customers, fetch all products, and list customers, backed by SQLite via Entity Framework with ensure created.
Build the EDA inventory API with product controllers and a product DbContext using Entity Framework, enabling get, post, and update operations, and prepare for RabbitMQ-based event-driven messaging.
Explore an event-driven microservice flow using RabbitMQ topic exchange to publish new inventory products to the customer API. Learn to update databases and manage inventory via inventory and customer topics.
Demonstrate an event-driven architecture with RabbitMQ topic exchange, publishing to inventory product and inventory customer queues for real-time service updates.
Publish a product event from the inventory service to a RabbitMQ topic exchange using a routing key, via an asynchronous publisher wired with dependency injection.
Learn how to run RabbitMQ in Docker, configure queues, exchanges, and bindings via a definition JSON and Docker Compose, and handle authentication and startup health checks.
Publish messages to RabbitMQ by configuring host, admin credentials, and Docker compose assumptions; verify by publishing a product update to the inventory product queue and observing new messages.
Learn to consume messages from the EDA inventory topic with RabbitMQ in C# .NET, parse them, and store products in a database via a service scope factory and dependency injection.
Develop an event-driven RabbitMQ listener in .NET to subscribe to the inventory.product queue, process messages via dependency-injected utilities, and test with breakpoints.
Refactors the background service to centralize RabbitMQ connection, enable dispatch of consumer async methods, and validate event driven architecture with producer and listener for product and inventory queues.
Publish customer purchase updates to the inventory queue using RabbitMQ, so the inventory service consumes the event and updates stock in the database.
Refactor the RabbitMQ utility into a shared project to remove duplicate code across inventory and customer modules, moving hardcoded settings and routing keys to app settings for reuse.
Design the front end with an asp.net core mvc app, using razor views, models, and controllers with entity framework, for the customer and inventory portals backed by the eda apis.
employ an api first approach by generating a c# client from the EDA inventory api using swagger open api, producing a swagger json and a usable inventory api class.
Learn to call a generated inventory API in a .NET app by wrapping the API client, configuring an HTTP client, and implementing get and create product methods via dependency injection.
Build the create product view in ASP.NET MVC by wiring a dependency-injected inventory API wrapper, a razor view, and a post create flow.
Learn how to build a product list view in asp.net mvc by fixing async calls with cancellation tokens, wiring create and list views, and rendering a table of products.
Build a dot net 6 web api mvc customer portal to purchase products from the inventory portal, using a wrapper api, swagger, and rabbit mq for end-to-end event-driven flow.
Propose refactor ideas to replace hardcoded URLs with app settings, centralize API client code in a shared folder, and leverage local development profiles to configure API and UI URLs.
Welcome to the Master course of Developing and Testing Event-Driven Microservices with C# .NET
In this course, we will discuss following
Development
Building Event-Driven API Service
Includes ASP Net Web API
Entity Framework for DB access
Creating Controllers
Building Event-Driven Service broker
Includes message broker via RabbitMq
Publisher of Message to Service Broker
Subscriber of Message from Service Broker
Building Event-Driven UI Portal
Includes ASP Net Web App
Consuming Web API
Containerizing Application
Using Docker file
Using Docker Compose file
Running applications via Docker Compose in Docker with all networks
Testing
Testing Application User Interface with Playwright C#.NET UI Testing
Testing Application Services with Playwright C# .NET API Testing
Testing Applications each and every component and interaction via Integration testing
Testing applications InMemory API
Testing Publisher
Testing Subscriber
Containerizing Tests
Contract Testing via Pact
Testing application Consumer side
Testing application Provider side
Testing Events via Pact
The course uses following Tech stacks
.NET 7
C# 11
ASP.NET Web API
ASP.NET MVC Web App
RabbitMq Message Broker
Playwright .NET
Integration testing libraries
Docker and more...
So, at the end of this course, one will have clear understanding of what Event-Driven Architecture applications are and how to efficiently and Robustly test application of this scale with Modern approaches.
This course will also help to better optimize the cost incurred by Event-Driven system while testing the application via User Interface and API Testing.
This course will also help to better optimize the cost incurred by Event-Driven system while testing the application via User Interface and API Testing.