Пример #1
0
        public static void Main(string[] args)
        {
            PopulateCatalogs();

            Recipe recipe = new Recipe();

            recipe.FinalProduct = GetProduct("Café con leche");
            try
            {
                recipe.AddStep(new Step(GetProduct("Café"), 100, GetEquipment("Cafetera"), 120));
                recipe.AddStep(new Step(GetProduct("Leche"), 200, GetEquipment("Hervidor"), 60));
                recipe.PrintRecipe();
            }
            catch (NullValueException exception)
            {
                Console.WriteLine(exception.Message);
            }
            catch (LessThanZeroException exception)
            {
                Console.WriteLine(exception.Message);
            }
            catch (EmptyStepsListException exception)
            {
                Console.WriteLine(exception.Message);
            }
            catch (StepsPrintException exception)
            {
                Console.WriteLine(exception.Message);
            }
        }
Пример #2
0
        public static void Main(string[] args)
        {
            PopulateCatalogs();

            Recipe recipe = new Recipe();

            recipe.FinalProduct = GetProduct("Café con leche");
            Step step = new Step(GetProduct("Café"), 100, GetEquipment("Cafetera"), 120);

            try
            {
                recipe.RemoveStep(step);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            try
            {
                recipe.AddStep(new Step(GetProduct("Café"), 100, GetEquipment("Cafetera"), 120));
                recipe.AddStep(new Step(GetProduct("Leche"), -10, GetEquipment("Hervidor"), 60));
                recipe.PrintRecipe();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            try
            {
                recipe.AddStep(new Step(GetProduct("Leche"), 10, GetEquipment("Hervidor"), -10));
                recipe.PrintRecipe();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            try
            {
                recipe.AddStep(step);
            }
            catch (NullReferenceException e)
            {
                Console.WriteLine(e.Message);
            }
        }
Пример #3
0
        public static void Main(string[] args)
        {
            PopulateCatalogs();

            Recipe recipe = new Recipe();

            recipe.FinalProduct = GetProduct("Café con leche");
            recipe.AddStep(new Step(GetProduct("Café"), 100, GetEquipment("Cafetera"), 120));
            recipe.AddStep(new Step(GetProduct("Leche"), 200, GetEquipment("Hervidor"), 60));
            recipe.PrintRecipe();
        }
Пример #4
0
        public static void Main(string[] args)
        {
            PopulateCatalogs();

            Recipe recipe = new Recipe();

            recipe.FinalProduct = GetProduct("Café con leche");
            recipe.AddStep(new Step(GetProduct("Café"), 100, GetEquipment("Cafetera"), 120));
            recipe.AddStep(new Step(GetProduct("Leche"), 200, GetEquipment("Hervidor"), 60));
            recipe.PrintRecipe();
            Console.WriteLine($"El precio final es: {recipe.GetProductionCost()}");
        }
Пример #5
0
        public static void Main(string[] args)
        {
            PopulateCatalogs();

            Recipe recipe = new Recipe();

            recipe.FinalProduct = GetProduct("Café con leche");
            recipe.AddStep(new Step(GetProduct("Café"), 100, GetEquipment("Cafetera"), 120));
            recipe.AddStep(new Step(GetProduct("Leche"), 200, GetEquipment("Hervidor"), 60));
            recipe.PrintRecipe();

            //RESULTADO

            /*
             * Receta de Café con leche:
             * 100 de 'Café' usando 'Cafetera' durante 120
             * 200 de 'Leche' usando 'Hervidor' durante 60
             * Total: 116
             */
        }