예제 #1
0
        public void Create_WithValidData_SavesRecordInTheDatabase()
        {
            // Arrange
            var newFoodItem = sut.Create(foodItem);

            // Assert
            Assert.IsNotNull(newFoodItem);
            Assert.IsTrue(newFoodItem.FoodId != null);

            // CleanUp
            sut.Delete(foodItem.FoodId);
        }
예제 #2
0
                                                      public async Task <IHttpActionResult> Delete(int Id)
                                                      {
                                                          try{ log.Info(new MDCSet(this.ControllerContext.RouteData), new InfoException(Id));
                                                               await _entityRepo.Delete(Id);

                                                               return(Ok("Registro eliminado exitosamente!")); }
                                                          catch (Exception e) { log.Error(new MDCSet(this.ControllerContext.RouteData), e);
                                                                                return(InternalServerError(e)); }
                                                      }
예제 #3
0
 public void Delete(int id)
 {
     productRepository.Delete(id);
 }