Beispiel #1
0
    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");
    }
Beispiel #2
0
 /// <inheritdoc />
 public void DeleteMealType(DeleteMealTypeDto deleteArticleGroupDto)
 {
     SimpleCrudHelper.Delete <MealType>(deleteArticleGroupDto.MealTypeId);
 }