How to Mock IConfiguration.GetValue in ASP.NET Core
In this article, we'll take a closer look at how we can mock IConfiguration.GetValue when writing unit tests in ASP.NET Core. Let's start!...
MY ARTICLES:
In this article, we'll take a closer look at how we can mock IConfiguration.GetValue when writing unit tests in ASP.NET Core. Let's start!...
In this article, we'll look at how to use source generators to validate IOptions and ensure they meet the required configuration expectations. [sc name="github"...
In this article, we'll look closely at the Carter library and how we can use it in our ASP.NET Core projects. Let's get started! What...
In this article, we'll look at source-generated RegEx and how it can improve performance in our .NET applications. ...
In this article, we'll explore why we might need sortable unique IDs in .NET and how to create them with the NewId NuGet Package. ...
The practices that matter most with Serilog are small and structural: configure it from appsettings.json rather than in code, log message templates rather than interpolated strings, inject ILogger<T> rather than reaching for the static Log class, and enrich once...
In this article, we will explore how we can improve our Minimal API endpoints in .NET with automatic registration. Let's dive...
NetArchTest is a small .NET library that turns architecture rules into unit tests. We write a normal xUnit or NUnit test that asserts something about our own assemblies, for example "nothing in Domain references Persistence" or "every class in Persistence is sealed",...
A unique constraint in EF Core is a unique index on our model: we declare it with the [Index] attribute or with HasIndex().IsUnique(), and the database refuses the second row that repeats the value. Indexes allow duplicates until we say otherwise, which is the one...
In this article, we'll take a look at how to inject a DbContext instance into an IHostedService. We'll also point out some important concepts we should be aware of. [sc name="github"...
In this article, we'll look closer at how we can overwrite the DateTime.Now property when testing applications in .NET. Let's dive in!...