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.
精彩评论