WireMock.NET allows for easy testing of the code that makes HTTP requests, without having to rely on the actual external service being available and without hacking HttpClient.
Strona głównaUżytkownik
cezarypiatek | użytkownik
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.
Sztuka programowania 680 dni, 34 minuty temu 90 źrodło rozwiń
MediatR is a very popular library used to reduce dependencies between objects. It advocates an architecture based on very valuable design principles: not allowing direct communication between objects, it promotes loose coupling...
Sztuka programowania 1029 dni, 1 godzinę, 19 minut temu 137 źrodło rozwiń
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.
Sztuka programowania 1070 dni, 1 godzinę, 7 minut temu 197 źrodło rozwiń
I recently migrated my VS Extension MappingGenerator (https://mappinggenerator.net/) to VisualStudio 2022. Unfortunately, I lost 4h by following the official migration guideline. Here are my notes on the subject to save you some time https://cezarypiatek.github.io/post/migrate-vsix-to-vs2022/
In the “classical unit tests” developers quite often use Arrange/Act/Assert comments to annotate the main parts of the test method script. However, the test case scenarios in component tests tend to be more complex and those simple notations don’t fit anymore. Here's my proposition on how to deal with that problem...
Sztuka programowania 1199 dni, 2 godziny, 51 minut temu 64 źrodło rozwiń
In this blog post I’m going to share my experience on testing ASP.NET Core applications with applying unconventional method called snapshot assertions. In comparison to the classical approach this method should save you a lot of time and improve assertions maintainability.
A while ago I came across “Quick notes on a rant” authored by Don Syme. This rant criticizes the C# language for the lack of a few important features. The first point is "Implicitly discarding information is so 20th Century" which brings our attention to one of the sources of bugs in C# programs. Lucky me, I got the pleasure to make this kind of bug and find it later in production code, so this blog post is to save you the trouble...
Sztuka programowania 1372 dni, 1 godzinę, 28 minut temu 72 źrodło rozwiń
How to completely automate continuous integration and release management of visual studio extensions.
In the last two posts, I’ve described 14 different code smells related to the async/await keywords. Beside the problem description, I’ve also provided info about code analyzers that can detect and report given issue. Those analyzers come from a few different packages that are not strictly devoted to the asynchronous programming area. They also contain rules from other fields with predefined severity, which might not be appropriate to your needs, or you might not be interested in enforcing them at all. Th...
This blog post continues the series which is a guide through the code analyzers available on the market and their possibilities. I’m trying to help you answer the question: “Which analyzer package should I use and how to configure it to avoid problems related to async/await?".
Sztuka programowania 1494 dni, 2 godziny, 32 minuty temu 49 źrodło rozwiń
Which analyzer package should I use and how to configure it to avoid most common problems related to async/await.
Sztuka programowania 1501 dni, 2 godziny, 32 minuty temu 70 źrodło rozwiń
In this blog post I introduce Mapping Generator - a possible design time alternative to AutoMapper.
How to configure dotnet core solutions to automatically generate client packages for WebAPI projects
A couple of tricks which simplify database access code while using Dapper library.
Bazy danych i XML 1571 dni, 1 minutę temu 135 źrodło rozwiń
There’s a certain set of special method signatures in C# which have particular support on the language level. Methods with those signatures allow for using a special syntax which has several benefits. For example, we can use them to simplify our code or create DSL to express a solution to our domain-specific problem in a much cleaner way. I came across those methods in different places, so I decided to create a blog post to summarize all my discoveries on this subject.
Sztuka programowania 1604 dni, 1 godzinę, 48 minut temu 206 źrodło rozwiń
How to keep two different types in synchronization using roslyn analyzers.
How to improve developer's experience while working with non-nullable references
Sztuka programowania 1702 dni, 1 godzinę, 25 minut temu 66 źrodło rozwiń
How to create immutable types without writing a large amount of boilerplate code.
Sztuka programowania 1711 dni, 1 godzinę, 41 minut temu 90 źrodło rozwiń
If you are still using regex for setting AssemblyVersion you should definitely read this article.