xUnit - How to assert that a method throws an exception - 2022
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 »
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 [https://docs.microsoft.com/en-us/dotnet/api/system.datetime?view=netcore-3.1] struct in »
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 »
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 almost everything we develop these »
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 »