开发者

Unit test which requires a file in Request.Files

I'm writing a unit test and the piece of code its testing requires that a file be in Request.Files.

In my controller I'm c开发者_运维知识库alling something called AddDocument(file) and the file is taken from Request.Files.

How do you achieve unit testing this? Isn't the Request only available in the controller?


check out this blog by scott hanselman on the topic. its pretty informative and well written.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜