示例#1
0
        public void Customer_CreateNewOrder5()
        {
            Customer customer = new Customer()
            {
                ID           = 12,
                UserName     = "******",
                Password     = "******",
                FirstName    = "John",
                LastName     = "Doe",
                CreditNumber = "4580"
            };
            CustomerForms customerForms = new CustomerForms(TestMode.On, customer);

            customerForms.input.Injections = new List <object>()
            {
                16,
                1
            };
            customerForms.CreateNewOrder();

            List <Order> orders = new StoreDAO().GetCustomerOrders(customer.ID);

            // Getting the latest order:
            Order order = orders[orders.Count - 1];

            Assert.AreEqual(order.ProductName, "Batteries Pack");
            Assert.AreEqual(order.CustomerID, 12);
            Assert.AreEqual(order.Amount, 1);
            Assert.AreEqual(order.TotalPrice, 8);
        }
示例#2
0
        public void Customer_LogIn()
        {
            CustomerForms customerForms = new CustomerForms(TestMode.On);

            customerForms.input.Injections = new List <object>()
            {
                "jdoe",
                "Wrong password" // Inserting a wrong password.
            };
            customerForms.CustomerLogInForm();
        }
示例#3
0
        public void Customer_NewCustomerForm()
        {
            CustomerForms customerForms = new CustomerForms(TestMode.On);

            customerForms.input.Injections = new List <object>()
            {
                "jdoe",
                "fake password",
                "fake name",
                "fake last name",
                "fake credit card"
            };
            customerForms.NewCustomerForm();
        }
示例#4
0
        public void Customer_CreateNewOrder2()
        {
            Customer customer = new Customer()
            {
                ID           = 12,
                UserName     = "******",
                Password     = "******",
                FirstName    = "John",
                LastName     = "Doe",
                CreditNumber = "4580"
            };
            CustomerForms customerForms = new CustomerForms(TestMode.On, customer);

            customerForms.input.Injections = new List <object>()
            {
                23,
                -1
            };
            customerForms.CreateNewOrder();
        }