public ActionResult Ingredient(string name, string measurement)
        {
            var rest = new MakeRESTCalls();

            if (string.IsNullOrEmpty(name))
            {
                return(Redirect("/home/RecipeBox"));
            }
            if (string.IsNullOrEmpty(name) && string.IsNullOrEmpty(measurement))
            {
                return(Redirect("/home/recipe?name=" + currentRecipe.name));
            }
            foreach (var ingredient in currentRecipe.ingredients)
            {
                if (ingredient.name == name && ingredient.measurement == measurement)
                {
                    currentIngredient = ingredient;
                }
            }
            ViewBag.currentrecipe                   = currentRecipe;
            ViewBag.currentingredient               = currentIngredient;
            ViewBag.currentitemresponselist         = rest.GetListItemResponses(currentIngredient);
            ViewBag.currentitemresponselistnoweight = rest.GetListItemResponseNoSellingWeights(currentIngredient);
            return(View());
        }
Ejemplo n.º 2
0
        public void TestListOfItemResponsesNoWeightVanillaExtractFirstLetterCapitalized()
        {
            var rest     = new MakeRESTCalls();
            var i        = new Ingredient("Vanilla Extract");
            var expected = new List <Ingredient>();
            var actual   = rest.GetListItemResponseNoSellingWeights(i);

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        public void TestListOfItemResponsesNoWeight()
        {
            var rest     = new MakeRESTCalls();
            var i        = new Ingredient("Bread Flour");
            var expected = new List <Ingredient>();
            var actual   = rest.GetListItemResponseNoSellingWeights(i);

            Assert.AreEqual(expected, actual); //this is just to make sure actual is giving me what i want... it is
        }
Ejemplo n.º 4
0
        public void TestListOfItemResponsesNoWeightVanillaExtract()
        {
            var rest     = new MakeRESTCalls();
            var i        = new Ingredient("vanilla extract");
            var expected = new List <Ingredient>();
            var actual   = rest.GetListItemResponseNoSellingWeights(i);

            Assert.AreEqual(expected, actual);
            //ok, this one is passing, but i don't want it to, i have to test capitalization
        }