protected override async Task DeleteData(Product entity) { if (await ProductExistInDiet(entity, diet)) { NutrientsManagement.SubtractNutrients(entity, diet); } await base.DeleteData(entity); }
public void SubtractNutrients_Success() { //Act NutrientsManagement.SubtractNutrients(product, diet); //Arrange Assert.Equal(0, diet.TotalCalories); Assert.Equal(0, diet.TotalCarbohydrates); Assert.Equal(0, diet.TotalFats); Assert.Equal(0, diet.TotalProteins); }