Joas
Joas

Reputation: 2026

Integration testing C# WebAPI asp.NET Framework 4.6.1

I am trying to write integration tests in C# for my C# asp.NET Framework 4.6.1 WebAPI which contains simple CRUD functionalities.

I have found little to no documentation on making automated integration tests for .NET Framework 4.6.1 using Microsoft.AspNet.WebApi 5.2.4. I've only found relatively old articles and video's on making integration tests for .NET Core using Xunit and Nunit, but ran into a lot of compatibility issues while trying to somehow make them work on .NET Framework 4.6.1 and WebApi 5.2.4.

I know this question could be considered primarily opinion based, but I would really appreciate any help on the matter.

How to write automated tests for an .NET Framework 4.6.1 Microsoft.AspNet.WebApi 5.2.4 application?

I currently do not use Owin for hosting my application, but invoke my configurations in Global.asax, but I could create a solution configuration which builds the project using Owin if needed.

Upvotes: 13

Views: 8431

Answers (1)

Shane Ray
Shane Ray

Reputation: 1469

After reading the comments it sounds like you’re looking for owin TestServer.

https://www.strathweb.com/2012/06/asp-net-web-api-integration-testing-with-in-memory-hosting/

Upvotes: 4

Related Questions