Beispiel #1
0
        private static void ProcessPriceSearches(Catalog catalog, int count)
        {
            for (int i = 0; i < count; i++)
            {
                var products = catalog.GetProductsInPriceRange(generator.GetRandomNumber(1, 5), generator.GetRandomNumber(6, 25));

                // TODO: If you have free time uncomment this code :)
                //foreach (var product in products)
                //{
                //    Console.WriteLine(product);
                //}
            }
        }
Beispiel #2
0
        private static Catalog MakeCatalog(int count)
        {
            var result = new Catalog();

            for (int i = 0; i < count; i++)
            {
                var product = new Product()
                {
                    Name = generator.GetRandomString(5, 20),
                    Price = generator.GetRandomNumber(1, 50)
                };

                result.Add(product);
            }

            return result;
        }