Exemplo n.º 1
0
 public void GetCustomerTest()
 {
     CustomerCRUD.addCustomer(88, "Joan", "Jett");
     Assert.AreEqual(CustomerCRUD.GetCustomer(88).customer_f_name, "Joan");
     Assert.AreEqual(CustomerCRUD.GetCustomerByLastName("Jett").customer_id, (88));
     Assert.AreEqual(CustomerCRUD.GetCustomerByNames("Joan", "Jett").customer_id, 88);
     CustomerCRUD.deleteCustomer(88);
 }
Exemplo n.º 2
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);
 }
Exemplo n.º 3
0
        public void GetCustomersTest()
        {
            CustomerCRUD.addCustomer(19, "Anna", "Kowalska");
            CustomerCRUD.addCustomer(16, "Anna", "Nowak");

            IEnumerable <customer> customers = CustomerCRUD.GetCustomersByName("Anna");

            Assert.AreEqual(customers.Count(), 2);
            Assert.AreEqual(customers.ElementAt(0).customer_l_name, "Nowak");
            Assert.AreEqual(customers.ElementAt(1).customer_id, 19);

            CustomerCRUD.deleteCustomer(19);
            CustomerCRUD.deleteCustomer(16);
        }
Exemplo n.º 4
0
 public void AddCustomerTest()
 {
     Assert.IsTrue(CustomerCRUD.addCustomer(67, "Michael", "Jackson"));
     Assert.IsTrue(CustomerCRUD.deleteCustomer(67));
 }