Exemplo n.º 1
0
        public void SimpleLine()
        {
            // Arrange
            var parser = new IngredientParser();

            // Act
            Ingredient item = parser.ParseLine("2 cups of Jasmine Rice - Slightly undercooked");

            // Assert
            Assert.IsNotNull(item);
            Assert.AreEqual(2M, item.Quantity);
            Assert.AreEqual("cups", item.Uom);
            Assert.AreEqual("Jasmine Rice", item.Name);
            Assert.AreEqual("Slightly undercooked", item.Directions);
        }
Exemplo n.º 2
0
        public void OneGarlicPowder()
        {
            // Arrange
            var parser = new IngredientParser();

            // Act
            Ingredient item = parser.ParseLine("1 Garlic Powder");

            // Assert
            Assert.IsNotNull(item);
            Assert.AreEqual(1, item.Quantity);
            Assert.AreEqual(null, item.Uom);
            Assert.AreEqual("Garlic Powder", item.Name);
            Assert.AreEqual(null, item.Directions);
        }
Exemplo n.º 3
0
        public void OneToTwo()
        {
            // Arrange
            var parser = new IngredientParser();

            // Act
            Ingredient item = parser.ParseLine("10cm Ginger");

            // Assert
            Assert.IsNotNull(item);
            Assert.AreEqual(10, item.Quantity);
            Assert.AreEqual("cm", item.Uom);
            Assert.AreEqual("Ginger", item.Name);
            Assert.AreEqual(null, item.Directions);
        }
Exemplo n.º 4
0
        public void HalfAQuantity()
        {
            // Arrange
            var parser = new IngredientParser();

            // Act
            Ingredient item = parser.ParseLine("1/2 cup Brown Sugar");

            // Assert
            Assert.IsNotNull(item);
            Assert.AreEqual(0.5M, item.Quantity);
            Assert.AreEqual("cup", item.Uom);
            Assert.AreEqual("Brown Sugar", item.Name);
            Assert.IsNull(item.Directions);
        }