public void IsJPG_JPGFile_ReturnsTrue() { using (var stream = File.OpenRead($"{ImageSourcePath}\\image.jpg")) { var formFile = new FormFile(stream, 0, stream.Length, null, Path.GetFileName(stream.Name)) { Headers = new HeaderDictionary(), ContentType = "image/jpeg" }; var result = formFile.IsJPG(); Assert.IsTrue(result); } }