Exemple #1
0
        static void Main(string[] args)
        {
            var catalog = new ProductCatalog();

            Console.WriteLine(catalog.LookupId(1234));
            Console.ReadLine();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            //Instantiate new instance of a ProductCatalog
            ProductCatalog catalog = new ProductCatalog();

            //Attempt to find a product by the id P2
            Product product = catalog.Lookup("P2");

            //Test that it was found
            Debug.Assert(product != null, "Product with Id P2 not found");
        }
Exemple #3
0
        static void Main(string[] args)
        {
            ProductCatalog searsCatalog = new ProductCatalog();
            int userIdNum;
            Console.Write("Enter the Product ID# for the item you would like to purchase: ");
            userIdNum = Convert.ToInt32(Console.ReadLine());
            Product userProduct = searsCatalog.Lookup(userIdNum);

            Console.WriteLine(string.Format("\nYou have chose to purchase a {0} for {1:c}.", userProduct.Name, userProduct.Price));
            Console.ReadLine(); //pause
        }
Exemple #4
0
        static void Main(string[] args)
        {
            ProductCatalog searsCatalog = new ProductCatalog();
            int            userIdNum;

            Console.Write("Enter the Product ID# for the item you would like to purchase: ");
            userIdNum = Convert.ToInt32(Console.ReadLine());
            Product userProduct = searsCatalog.Lookup(userIdNum);

            Console.WriteLine(string.Format("\nYou have chose to purchase a {0} for {1:c}.", userProduct.Name, userProduct.Price));
            Console.ReadLine(); //pause
        }
Exemple #5
0
 static void Main(string[] args)
 {
     var catalog = new ProductCatalog();
     Console.WriteLine(catalog.LookupId(1234));
     Console.ReadLine();
 }