I want to test a function that attaches files to documents in a RavenDB database with an integration test. For this, I need an instance of IFormFile.
IFormFile
Ob
Thanks to Hans his comment, the actual answer is:
using (var stream = File.OpenRead("placeholder.pdf")) { var file = new FormFile(stream, 0, stream.Length, null, Path.GetFileName(stream.Name)) { Headers = new HeaderDictionary(), ContentType = "application/pdf" }; }