title: Value cannot be null. Parameter name: request
body: <p>I'm creating a unit test using nunit and all of this code works fine in runtime.</p>
  
  <p>I have this protected <code>HttpResponseMessage</code> code below that is being called by my controller when it returns.</p>
  
  <p>However, an error: </p>
  
  <blockquote>
    <p>"Value cannot be null. Parameter name: request" is displaying. </p>
  </blockquote>
  
  <p>And when I check the request, it is actually <code>null</code>.</p>
  
  <p>Question:
  How will I code my unit test to return the <code>HttpResponseMessage</code>?</p>
  
  <p>Error is shown in this line:</p>
  
  <pre><code>  protected HttpResponseMessage Created&lt;T&gt;(T result) =&gt; Request.CreateResponse(HttpStatusCode.Created, Envelope.Ok(result));
  </code></pre>
  
  <p>Here is my Controller:</p>
  
  <pre><code>    [Route("employees")]
      [HttpPost]
      public HttpResponseMessage CreateEmployee([FromBody] CreateEmployeeModel model)
      {
          //**Some code here**//
  
          return Created(new EmployeeModel
          {
              EmployeeId = employee.Id,
              CustomerId = employee.CustomerId,
              UserId = employee.UserId,
              FirstName = employee.User.FirstName,
              LastName = employee.User.LastName,
              Email = employee.User.Email,
  
              MobileNumber = employee.MobileNumber,
              IsPrimaryContact = employee.IsPrimaryContact,
              OnlineRoleId = RoleManager.GetOnlineRole(employee.CustomerId, employee.UserId).Id,
              HasMultipleCompanies = EmployeeManager.HasMultipleCompanies(employee.UserId)
          });
      }
  </code></pre>