var recipe = new RecipeBuilder()
.With(new IngredientBuilder().For("Milk").WithQuantity(200, Unit.Milliliters))
.Build();
Action action = () => recipe.AddIngredient("Milk", 100, Unit.Spoon);
action
.Should().Throw<RuleViolationException>()
.WithMessage("*change the unit of an existing ingredient*")
.And.Violations.Should().Contain(BusinessRule.CannotChangeIngredientQuantity);
👉 GitHub & Сайт
