You have a class that depends on
IHttpClientFactory for that matter), and want to unit test that. Since you want a unit test and not an integration test, it should not call a real http endpoint. You decide to mock out your dependency on
HttpClient, and soon thereafter you got stuck. After googling ‘How to mock HttpClient’ you landed on this post. So, how would you mock
HttpClient for your unit tests?
I give you the short answer right away: Continue reading “How to mock HttpClient in your .NET / C# unit tests”
As a developer, you sometimes have to correctly normalize strings. Be it to do quick case-insensitive lookups, or to compare stuff. The question is, what is considered a correct normalization for these use cases? This post uses C# for the sample code, but this topic applies to all languages and environments equally.
Continue reading “How to correctly normalize strings and how to compare them (in .NET)”
Why should you care about versioning your API? Well, writing a web API with ASP.NET Core is easy. Getting it in production also. But what happens when you have your API live, clients are out there consuming it, and the need arises to change something? This is, when you should have thought about versioning your ASP.NET Core web API. This article shows how to version a web API written using ASP.NET Core. It shows different approaches and explains the differences between them.
Continue reading “Using versioning in your ASP.NET Core API”
I recently had some trouble adding my iCloud account to the Windows 10 Email & app accounts. The reason for that: I had 2-factor security enabled on my iCloud account. It is not possibly to directly connect an iCloud account with the account password to Windows 10 if 2-factor authentication is enabled. Continue reading “How to connect your 2fa-enabled iCloud account to Windows 10”
I want to show you how you can the Babun shell in Cmder.
From my previous blog posts you know I am a fan of Cmder on Windows. It gives me a powerful shell as a replacement of the normal cmd.exe, and it also lets me run Bash and Zsh in the Windows Subsystem for Linux (WSL).
That said, Cmder does not provide a full featured *nix shell, but an extended Windows cmd prompt. And while Bash (or Zsh) on the WSL provide with an full featured Linux shell, it has some drawbacks as it really IS a Linux environment. For example, when you install certain Node packages in your project like PhantomJS, they will bring the Linux version and executables, and you can’t run them from your normal Windows environment.
Babun is a tool, that can bridge this gap. Continue reading “How to run the Babun shell in Cmder”
The German keyboard layout is great. It has everything you need, including all of the umlauts, the ß and also the µ. For programming, however, the German keyboard layout is 💩: The normal braces are on 8 and 9 with shift state, just off by one from the English ones at 9 and 0, but the square and curly braces are available only on Alt-Gr combos left and right from that. Also the forward and backward slashes are Shift and Alt-Gr combos. You can imagine that this slows you down.
So, to be more efficient when writing code, I tried and trained myself to use an English keyboard layout. This is, what I learned. Continue reading “English keyboard layout hints for German developers”
You may notice it, this blog has got a small design update.
The old theme was fine, but it was very… white with just a little bit of black. I decided to look out for another theme that adds a little bit of color, but still focuses on readability and cleanness.
After checking out a lot of themes, testing them and navigating around to get a gasp of the overall look & feel of different themes, I found one that pleases me and hopefully you, too: I decided to go with the official WordPress Twenty Seventeen theme and just give the color scheme a little personal touch.
If you are in the mood, please leave some feedback on how you like my new design. 😉
It is, again, the time of the year where the schedule for the conference season comes together nicely. So, without further adue, these are the conferences I will be giving talks on this year.
Continue reading “My conference season 2017”
On our Thinktecture Research Retreat I had the chance to have a deeper look at the Visual Studio Team System (VSTS), especially in regards to VSTS and its Build / CI System. Right on the first steps with it I ran into an issue with the VSTS wildcards for .NET Core projects.
Continue reading “Using VSTS Wildcards for .NET Core projects”
When you create a single page application (SPA) with Angular (or other SPA-frameworks, for the matter), you might want to leverage the power of the web and allow a deep link directly to a certain route within your application.
Continue reading “How to: Deep link into an Angular SPA on IIS”