public IEnumerable <RecipeIngredient> CreateValidRecipeIngredientList() =>
 new List <RecipeIngredient>
 {
     _recipeIngredientFactory.Create(Guid.NewGuid(), 100),
     _recipeIngredientFactory.Create(Guid.NewGuid(), 100),
     _recipeIngredientFactory.Create(Guid.NewGuid(), 100)
 };
 private IEnumerable <RecipeIngredient> ToDomainRecipeIngredients(IEnumerable <Entities.Recipe.RecipeIngredient> recipeIngredients) =>
 recipeIngredients.Select(x => _recipeIngredientFactory.Create(x.IngredientId, x.Grams))
 .ToList();
示例#3
0
        public void GivenNegativeGrams_WhenCreatingRecipeIngredient_ThrowArgumentException()
        {
            Action action = () => _recipeIngredientFactory.Create(Guid.NewGuid(), -200);

            action.Should().Throw <ArgumentException>();
        }