Esempio n. 1
0
        public void InvalidInputRecipeStringParseFail()
        {
            // Arrange
            string           input      = "!@#$%^&";
            IngredientType   ingredType = IngredientType.Produce;
            RecipeIngredient theIngredient;

            // Act

            theIngredient = ParseHandler.parseRecipeLine(input, testContainer);

            // Assert
            Assert.IsNull(theIngredient);
        }
Esempio n. 2
0
        public void ValidRecipeStringParseSuccess()
        {
            // Arrange
            string           input = "- 3/4 cup olive oil";
            RecipeIngredient theIngredient;

            // Act

            theIngredient = ParseHandler.parseRecipeLine(input, testContainer);

            // Assert
            Assert.IsNotNull(theIngredient);
            Assert.IsTrue(theIngredient.getIngredient().getIsOrganic());
            Assert.IsFalse(theIngredient.getIngredient().getIsProduce());
            Assert.AreEqual(theIngredient.getIngredient().getName(), "olive oil");
            Assert.AreEqual(theIngredient.getAmount(), 0.75m);
        }