public void DeleteMealType() { using var context = new InMemoryDbContext(); var existingMealType = context.MealTypes.Add(new MealType("Lunch", 1)); context.SaveChanges(); var testee = new MealTypeService(new SimpleCrudHelper(context, TestMapper.Create())); var deleteMealTypeDto = new DeleteMealTypeDto(existingMealType.Entity.MealTypeId); testee.DeleteMealType(deleteMealTypeDto); context.MealTypes.Should().NotContain(x => x.Name == "Lunch"); }
/// <inheritdoc /> public void DeleteMealType(DeleteMealTypeDto deleteArticleGroupDto) { SimpleCrudHelper.Delete <MealType>(deleteArticleGroupDto.MealTypeId); }