Mock httpcontext.current.request.files
问题 I am implementing nUnit Test case for one of my method called, UploadFile() , some thing like below public void UploadFile(string siteId, string sitePageId) { int fileCount = HttpContext.Current.Request.Files.Count; //Rest of code } so basically i am reading file using HttpContext.Current.Request.Files . From UI it is working fine but when i am implementing nUnit test case for it, i am not able to mock HttpContext.Current.Request.Files . I googled about some of mocking tools but there also i