Exemple #1
0
 public void UpdateCustomerTest()
 {
     CustomerCRUD.addCustomer(77, "Ellen", "DeGeneres");
     Assert.IsTrue(CustomerCRUD.updateLastName(77, "Page"));
     Assert.AreEqual(CustomerCRUD.GetCustomer(77).customer_l_name, "Page");
     Assert.IsTrue(CustomerCRUD.updateName(77, "Elliot"));
     Assert.AreEqual(CustomerCRUD.GetCustomerByLastName("Page").customer_f_name, "Elliot");
     CustomerCRUD.deleteCustomer(77);
 }
        public void UpdateCustomerName()
        {
            Customers c = new Customers()
            {
                id = 104, name = "Paul", money = 100
            };

            Assert.IsTrue(CustomerCRUD.addCustomer(c.id, c.name, c.money));
            Assert.IsTrue(CustomerCRUD.updateName(c.id, "Shawn"));
            c = CustomerCRUD.getCustomer(c.id);
            Assert.AreEqual(c.name, "Shawn");
        }
Exemple #3
0
        public void EditCustomer()
        {
            bool editedN = CustomerCRUD.updateName(currentCustomer.customer_id, currentCustomer.customer_f_name);
            bool editedF = CustomerCRUD.updateLastName(currentCustomer.customer_id, currentCustomer.customer_l_name);

            if (editedN && editedF)
            {
                actionText = "Customer Edited";
            }
            else
            {
                actionText = "Oh nooo something went wrong";
            }
            MessageBoxShowDelegate(ActionText);
        }