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 »
A year ago I made a post on the absence of the DoesNotThrow assertion in xUnit. In this post I show how you can assert if »
The Triple A (AAA) abbreviation: Arrange. Act and Assert is a way to structure your unit tests into 3 sections: Arrange: Assign variables, setup stubs, mocks »
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 »
If you are moving from NUnit to xUnit, you will likely encounter the absence of the DoesNotThrow method in xUnit. At first I believed this did »
In this post I describe what units tests are all about. It seems to me that in the last many years, the focus has drifted away »
Often when writing tests one value can be as good as any other value. Such as if you need to apply a number within a range »
In this post I will describe some automated testing techniques. Testing is done to assure quality in our systems. But what is quality? Quality is that »
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 »