Resolve all using mine

Mocking authorization tokens with WireMock.NET
, Author: Cezary Piątek



Testing applications that require authorization presents a unique set of challenges, especially when it comes to simulating different user permissions. Using an actual authorization server and manually creating test users with specific roles and claims can quickly become cumbersome when trying to cover a wide range of permission combinations. Another option is to use libraries like fake-authentication-jwtbearer, but these libraries have a significant drawback. They replace the actual authorization logic, so we are not testing what will actually be used on production. ... Read More

C# code snippets for Resharper and Rider
, Author: Cezary Piątek



10 years ago I published my first blog post entitled “Don’t write dull code” which was dedicated to a Resharper feature called LiveTemplates. It’s a code snippet engine that was originally introduced in Resharper, but is now also available in Rider. LiveTemplate comes with a set of predefined snippets for basic coding scenarios such as conditions, loops, exception handling, etc. However, the real power lies in the ability to create custom snippets with placeholders that can be completed manually or automatically by macros. ... Read More

The fastest way to create WireMock.NET mappings
, Author: Cezary Piątek



In my journey through the nuances of API testing, I’ve often encountered the challenges and time-consuming aspects of creating accurate WireMock mappings. As developers, we often get bogged down in the details of the anatomy of inter-service communication, not to mention the frustrating typos that lead to inaccurate mappings. In this blog post, I will introduce a powerful solution: the WireMock.NET proxy. This feature completely changes the way we approach mapping preparation, significantly reducing both workload and debugging time. ... Read More

Mocking GraphQL queries with WireMock.NET
, Author: Cezary Piątek



GraphQL is a query language for APIs that allows clients to request exactly what they need, making data retrieval more efficient than traditional REST APIs. It supports three different types of client-server interaction: queries, mutations and subscriptions. When you start integrating a GraphQL API as a consumer in your application, it’s likely that you’ll need to write automated tests to ensure that the integration works correctly. In this blog post, I will show you how to mock GraphQL queries using WireMock.NET.

... Read More


In this blog post I describe the typical problems caused by the usage of Setup and Teardown method in dotnet tests and how those problems can be solved by using only C# language features.

... Read More