Testing a .NET Core Web API — Part 1: Performance tests

Taylor Collins
4 min readSep 17, 2017

This is part one of three in a series on creating and using Web API tests in .NET Core. Part One gives an overview of the application and dives in to creating the tests and establishing a performance benchmark. In Part Two, we utilize the tests to measure performance impact after changing our DB provider to Azure Cosmos DB. And in Part Three, we address performance degradation by decorating a Redis cache layer in our API.

Recently at work, my team created a set of Performance/Load tests around a Web API endpoint (in .NET Framework). We did this as a means of being able to measure the relative impact on performance that we may have been introducing to our system after making a change to the code base.

I’ve been wanting to introduce myself to .NET Core for a while now. And after going through the above exercise at work, I decided that I would spin up a .NET Core app and try out some of these concepts.

The Application

I’m going to skip going over most of the boiler plate code, since the focus of this will be around the tests. I’ll instead post some links to resources that I used to set up the app on my laptop (running Ubuntu 16.04) . I’ll also leave a link to the GitHub repository where all of the code and tests that I used will live:

--

--