Integration tests without API dependencies with ASP.NET Core and WireMock.Net

Integration tests without API dependencies with ASP.NET Core and WireMock.Net

Mockings APIs with WireMock.Net

Introduction

Although there are many definitions about the scope of an integration test, Martin Fowler defines Narrow integration tests, where the integration with other systems are tested using mocks, and Broad integration tests, where they communicate using real APIs.

In this post, I’ll explain how to create mocks for HTTP APIs in narrow integration tests using the WireMock.Net library.