File Uploads in ASP.NET Core Integration Tests

Writing integration tests for ASP.NET Core controller actions used for file uploads is not a rare need. It is fully supported by ASP.NET Core integration tests system. This post shows how to write integration tests for single and multiple file uploads.

Getting Started

Suppose we have controller action for file upload that supports multiple files. It uses a complex composite command for image file analysis and saving. Command is injected to action by framework-level dependency injection using controller action injection.