Home About

All posts tagged with "Unit tests"

A unit test is a test of single unit of code, this could be a method or function. Sometimes this test is done in isolation using predefined test doubles.

Page 1 of 1

xUnit - How to assert that a call throws an exception

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 »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on XUnit, Testing, Unit tests 09 September 2020

The Arrange, Act and Assert structure for unit tests

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 »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on Testing, Unit tests 23 May 2020

C# - how to inject, mock or stub the DateTime struct for unit tests

In this post I will demonstrate how you can stub the DateTime struct in your unit tests. Most common the method DateTime.Now or DateTime.UtcNow »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C#, Unit tests, Test doubles 16 May 2020

xUnit - how to check if a call does not throw an exception

If you are moving from NUnit to xUnit, you will likely encounter the absence of the DoesNotThrow method in xUnit. You are looking for something that »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C#, XUnit, Unit tests 27 October 2019

What is a unit test?

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 »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on Unit tests, Programming, Testing 31 January 2019

Deciding on what values to use for (unit) test cases

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 »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on Testing, Unit tests, Integration tests, System tests 18 February 2018

Levels of automated tests in software - when to use what?

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 »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on Testing, Unit tests, Integration tests, System tests 23 December 2017

Why do we use mocking for unit tests? and the use of test-doubles

In order to understand mocking we need to understand different types of test doubles and what unit testing is. Later in this blog post I will »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on C#, NUnit, Unit tests, NSubstitute, Testing, Test doubles 09 December 2017
Page 1 of 1
Rss
Twitter
LinkedIn
profile for Peter Rasmussen at Stack Overflow, Q&A for professional and enthusiast programmers
Peter Daugaard Rasmussen - developer, Consultant, Blogger © 2021 Cookie policy