title: Delete an item unit test in web api
body: <p>I have the delete method in asp.net web api.</p>
  
  <pre><code>[HttpDelete("{id}")]
  public void Delete(int id)
  {
      _repository.DeleteRestrictions(id);
  }
  </code></pre>
  
  <p>Not sure how to do an unit test for it. My partial code</p>
  
  <pre><code>[Fact]
  public void DeleteRestrictionsRepository()
  {
      var mockRepository = new Mock&lt;IRepository&gt;();
      var repo = mockRepository.Object;
      var demoItem = GetTestItems();
      var controller = new MyController(repo);
      var result = controller.Delete(2) as OkNegotiatedContentResult&lt;Restrictions&gt;;
      controller.Delete(123);
  }
  </code></pre>