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 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"
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"
I cought a tweet a few days ago asking for your developers toolbelt, specifically on windows. And I gave a very short answer and mentioned I would blog about this:
So, this is a more elaborate answer to the developers toolbelt question. My default windows developer installation contains the following:
Continue reading "My developers toolbelt 2016"
"Can you run Bash in Cmder?" - In the comments of my last post (install and run (Oh-my-) zsh on Bash on Ubuntu on Windows), I was asked whether it would be possible to run the Bash (or Zsh) also in Cmder. First I thought it was not possible, but then I got curious. After digging in a bit more it turned out that it IS, in fact, possible. And it's not difficult too.
So, since I figured out how it works, I also want to show you how you can run the Windows 10 Ubuntu Bash (and/or Zsh) in Cmder.
Continue reading "Running Windows 10 Ubuntu Bash in Cmder"