title: Issue Moq'ing HttpResponseMessage
body: <p>I have the following Method:</p>
  
  <pre><code>public async Task&lt;SecurityRoleDeleteResult&gt; DeleteSecurityRoleByRoleId(int securityRoleId)
  {
      string url = $"{_housingDataSecurityConfiguration.HousingDataSecurityWebApiUrl}SecurityRoles/Delete";
  
      HttpResponseMessage message = _apiClientService.Post(url, securityRoleId);
  
      if (message.StatusCode == HttpStatusCode.InternalServerError)
      {
          return SecurityRoleDeleteResult.ErrorOccurred;
      }
  
      int intResult = 0;
      var apiResult = await message.Content.ReadAsStringAsync();
      if (int.TryParse(apiResult, out intResult))
      {
          return (SecurityRoleDeleteResult)intResult;
      }
      else
      {
          return SecurityRoleDeleteResult.ErrorOccurred;
      }
  }
  </code></pre>
  
  <p>I'm now trying to write a unit test for it and so far have:</p>
  
  <pre><code>[Test]
  public async Task DeleteSecurityRoleByRoleId()
  {
      _mockApiClientService.Setup(a =&gt; a.Post(It.IsAny&lt;string&gt;(), It.IsAny&lt;int&gt;()))
          .Returns(new HttpResponseMessage {StatusCode = HttpStatusCode.OK});
  
      SecurityRoleDeleteResult result = await _securityRoleService.DeleteSecurityRoleByRoleId(It.IsAny&lt;int&gt;());
  
      Assert.AreEqual(SecurityRoleDeleteResult.Success, result);
  }
  </code></pre>
  
  <p>The issue here is that when running the test in the <code>_securityRoleService.DeleteSecurityRoleByRoleId</code> method at the point I try to set <code>var apiResult</code> message.content is null, because in this instance I'm only mocking so crashes.</p>
  
  <p>How can I mock this out so that my test will work?</p>