C# - How to mock or stub a class without an interface
Sometimes you come across a class that you need to stub or mock but it does not have an interface. The easiest way is of course »
Sometimes you come across a class that you need to stub or mock but it does not have an interface. The easiest way is of course »
Sometimes we want more than just a simple stub from wiremock, sometimes we want to create a scenario. We want Wiremock to do something different when »
In many cases you want some sort of wildcard in your URL matching for Wiremock.Net. Most REST URLs contain an id, especially at the end »
Are you looking for a simple guide for setting up Wiremock.Net? Well I hope this can be helpful to you :) I did this yesterday as »
In this post I will demonstrate how you can stub the DateTime struct in your unit tests. Most commonly the method DateTime.Now or DateTime.UtcNow »
I will go right to the point here. In the title I have used the term "stub" in its broad sense. What I really »
In this post I will go through how you can mock the HttpClient class in C#. This is often needed as everything we develop these days »
In order to understand how and why we use mocks for tests we need to understand different types of test doubles (implementations used for testing) and »