Home About

All posts tagged with "Test doubles"

A collection of 8 posts tagged with "Test doubles"

Page 1 of 1

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 »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on Test doubles, Testing, Unit tests, C# 15 May 2022

C# - How to set up scenarios with Wiremock - with examples

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 »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on Wiremock, .Net, Testing, Test doubles, System tests, Mocking 08 September 2021

C# - How to match a path with a wildcard in Wiremock.Net

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 »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on Wiremock, .Net, Mocking, Test doubles, Testing, System tests 05 September 2021

C# - A simple guide to setup Wiremock.Net for integration tests

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 »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on Integration tests, Test doubles, System tests, Testing, .Net, Wiremock, Mocking 02 September 2021

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

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 »

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

Mocks vs stubs, the pros and cons of frameworks vs implementations

I will go right to the point here. In the title I have used the term "stub" in its broad sense. What I really »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on Mocking, Test doubles, Testing 03 December 2018

C# - How to mock the HttpClient for tests when it is a dependency

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 »

Peter Daugaard Rasmussen Peter Daugaard Rasmussen on HttpClient, HTTP, C#, Dependency injection, Test doubles, Mocking 11 October 2018

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

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 »

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 © 2022 Cookie policy