How do you Unit Test a WebAPI? What do you test?

This page summarizes the projects mentioned and recommended in the original post on /r/learnprogramming

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • WireMock.Net

    WireMock.Net is a flexible product for stubbing and mocking web HTTP responses using advanced request matching and response templating. Based on the functionality from http://WireMock.org, but extended with more functionality.

  • I use WireMock (@ Java) to start a local webserver alongside the tests, this webserver will provide ‘real’ responses to the client. Here’s the C# equivalent: https://github.com/WireMock-Net/WireMock.Net

  • dotnet-testcontainers

    Discontinued 🐋 A library to support tests with throwaway instances of Docker containers for all compatible .NET Standard versions. [Moved to: https://github.com/testcontainers/testcontainers-dotnet]

  • So what I usually do is: • Unit test underlying (public) services and application ‘core’ • Integration test (or w/e you call it) an entire functionality flow, by sending in ‘real’ requests on one end, and locally mocking/stubbing the application ‘edges’ that supply the response data. WireMock for requests to external services, H2 or Testcontainers for database.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Integration Tests with In Memory DB vs Real DB on Docker

    1 project | /r/dotnet | 28 Aug 2023
  • Unit Testing

    2 projects | /r/dotnet | 5 Jul 2023
  • Running untrusted (user-provided) Python code on ASP.NET/C# backend

    2 projects | /r/dotnet | 20 Jun 2023
  • If i want to do testing CRUD should I use in memory or just do integration test where I use a seperate database?

    1 project | /r/csharp | 22 Apr 2023
  • Testcontainers

    16 projects | news.ycombinator.com | 27 Feb 2024