Exemple #2
0
        public Customer GetCustomerByCustomerID(int customerID)
        {
            CustomerBO customerBO = new CustomerBO();

            Customer customer = customerBO.GetCustomerByCustomerID(customerID);

            return(customer);
        }
        private void GetCustomerSQL(int CustomerID)
        {
            CustomerBO customerBO = new CustomerBO();

            customer = customerBO.GetCustomerByCustomerID(CustomerID);

            DisplayCustomerSQL();
        }
        public void GetCustomerByCustomerID()
        {
            int        customerID;
            CustomerBO customerBO = new CustomerBO();
            Customer   customer;

            customerID = -1;

            customer = customerBO.GetCustomerByCustomerID(customerID);

            Assert.IsNull(customer);


            customerID = 0;

            customer = customerBO.GetCustomerByCustomerID(customerID);

            Assert.IsNull(customer);


            customerID = 1;

            customer = customerBO.GetCustomerByCustomerID(customerID);

            Assert.IsNotNull(customer);
            Assert.AreEqual(customer.CustomerID, customerID);


            customerID = 2;

            customer = customerBO.GetCustomerByCustomerID(customerID);

            Assert.IsNotNull(customer);
            Assert.AreEqual(customer.CustomerID, customerID);


            customerID = 3;

            customer = customerBO.GetCustomerByCustomerID(customerID);

            Assert.IsNotNull(customer);
            Assert.AreEqual(customer.CustomerID, customerID);
        }