public void Delete()
        {
            var countShouldBe   = _products.Count - 1;
            var productExisting = _products.First();

            _productLibrary.Delete(productExisting.Id);
            var countIs = _products.Count;

            Assert.AreEqual(countIs, countShouldBe);
        }
Beispiel #2
0
 public IHttpActionResult Delete(Guid id)
 {
     try
     {
         _productLibrary.Delete(id);
         return(Ok());
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message + ex.InnerException?.Message + ex.InnerException?.StackTrace));
     }
 }