Ejemplo n.º 1
0
        public ChocolateBox GenerateChocolateBox(int noOfChocolates = 20)
        {
            ChocolateBox box = new ChocolateBox();

            for (int i = 0; i < noOfChocolates; i++)
            {
                box.AddChocolate(_chocolateGenerator.GenerateChocolate());
            }

            return(box);
        }
Ejemplo n.º 2
0
        private static void RunSpecificScenario()
        {
            ForrestGumpGenerator  fgGenerator = new ForrestGumpGenerator();
            ChocolateBoxGenerator cbGenerator = new ChocolateBoxGenerator();

            ForrestGump  gump = fgGenerator.GenerateForrestGump();
            ChocolateBox box  = cbGenerator.GenerateChocolateBox();

            gump.SayFavoriteProverb();
            while (box.ChocolateLeft)
            {
                gump.Eat(box.TakeAChocolate());
            }

            Console.WriteLine();
            Console.WriteLine();
        }