title: Mock HttpPostedFile in Unit Test
body: <pre><code>public async Task&lt;HttpResponseMessage&gt; UpdateUserProfile(HttpPostedFile postedFile)
  { 
    //update operations
  }
  </code></pre>
  
  <p>I have a method UpdateUserProfile where I am updating the image of a person using <code>HttpPostedFile</code>. It is working fine from Postman/Swagger. Now am writing UnitTestCases for the same. I have the below code</p>
  
  <pre><code>public void UpdateUserProfile_WithValidData()
  {
     HttpPostedFile httpPostedFile;
     //httpPostedFile =??
  
    var returnObject =  UpdateUserProfile( httpPostedFile );
  
    //Assert code here
  }
  </code></pre>
  
  <p>Now I have to give the image file to <code>HttpPostedFile</code> object from code manually which I am trying to do but couldn't. Please suggest me how to proceed further to mock image in the unit test.</p>