Mocking dependencies in ASP.NET Core tests

5 sty 2023 | Blog | programowanie | .net | testowanie | unit tests | IT
As I recently spent some time writing and refactoring tests that utilize WebApplicationFactory, I’ve come to have some thoughts and ideas for improvement that I’d like to share. In this article, I’ll delve into the process of mocking dependencies in a DI container when using WebApplicationFactory, and offer some insights and best practices I’ve learned along the way. Whether you’re a seasoned pro or new to unit testing ASP.NET Core applications, I hope this information will be helpful as you work to simplify and streamline your tests.

POSTY TEGO AUTORA

Visualizing Test Execution with OpenTelemetry4 maj 2025

Blog | programowanie | .net | c# | IT

Structuring Test Projects for Maintainability1 maj 2025

Blog | programowanie | testowanie | software design | IT

How to Run a React Development Server with HTTPS4 sty 2025

Blog | programowanie | .net | react | IT

Mocking authorization tokens with WireMock.NET28 lut 2024

Blog | programowanie | .net | c# | IT

C# code snippets for Resharper and Rider9 lut 2024

Blog | programowanie | .net | c# | IT

Cezary Piątek Blog

Cezary Piątek