public void Parse_converts_a_string_into_ingredient() { var ingredient = _parser.Parse("1 cup flour"); ingredient.Should().NotBeNull(); ingredient.Name.Should().Be("flour"); ingredient.Quantity.Should().Be(1); ingredient.Unit.Should().Be(Unit.Cup); }
/// <summary>Generates the Ingredients and Steps</summary> public void ProcessRecipe() { this.Steps = new List <string>(); if (!String.IsNullOrEmpty(this.StepsText)) { string[] lines = this.StepsText.Split(new string[] { "\n", "\r\n" }, StringSplitOptions.None); this.Steps = new List <string>(lines); } IngredientParser parser = new IngredientParser(); this.Ingredients = parser.Parse(this.IngredientsText); }