Resolve all using mine

Mocking dependencies in ASP.NET Core tests
, Author: Cezary Piątek



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. ... Read More

Why I don't use MediatR for CQRS
, Author: Cezary Piątek



The purpose of this article is not to criticize the MediatR library. MediatR is a tool - and just like any tool, it has its own scope of application, and being used incorrectly might do more harm than good. This blog post summarizes my thoughts about using MediatR for supporting CQRS architecture.

... Read More

Adding support for VisualStudio 2022 to your extension
, Author: Cezary Piątek



I published my first VisualStudio extension on 26th February 2018. It was initially created for Visual Studio 2017, but a few months later Visual Studio 2019 came out and I needed to support it as I was one of the beneficent. The migration was straightforward: it required only to extend InstallationTarget range to [15.0,17.0) in vsixmanifest, re-compile, and of course, re-publish the extension to the Visual Studio marketplace. Recently, the Visual Studio 2022 Preview was published. ... Read More

Readable and clear tests for ASP.NET Core services
, Author: Cezary Piątek



For the last year, I’ve had an opportunity to work quite a lot with Component Tests for microservices built with ASP.NET Core. The vocabulary related to testing is very vague and terms like Unit, Component, and Integration tests can be interpreted differently based on the context, so let me explain first what I mean by Component Tests. It’s a kind of test that treats your whole service as a black box. ... Read More

Testing WebAPI with ApprovalTests.NET
, Author: Cezary Piątek



In this blog post, I’m going to share my experience on testing ASP.NET Core applications by applying an unconventional method called snapshot assertions. In comparison to the classical approach, this method should save you a lot of time and improve assertions maintainability.

... Read More