public async Task TestResizeImage() { using Stream stream = new MemoryStream(); string message = "{ \"image\": \"test.png\", \"size\": 64 }"; _fileRepository.Setup(s => s.DownloadFile("test.png")).Returns(Task.FromResult(stream)); await _function.Run(message, _logger.Object); _imageHandler.Verify(v => v.Resize(stream, It.IsAny <Stream>(), 64)); _fileRepository.Verify(v => v.UploadFile("64/test.png", It.IsAny <Stream>())); }