public void TestDeleteCustomer() { /*Create the test variables.*/ Customer c = new Customer(); c.Name = "Mickey Mouse"; c.Address = "101 Main Street"; c.City = "Orlando"; c.State = "FL"; c.ZipCode = "10101"; int customerID = CustomerDB.AddCustomer(c); c = CustomerDB.GetCustomer(customerID); /* Test the command.*/ bool isCustomerDeleted = CustomerDB.DeleteCustomer(c); /* If it affected the database in some way, the test was successful. */ Assert.AreEqual(true, isCustomerDeleted); }
public void TestAddCustomer() { /*Create the test variables.*/ Customer c = new Customer(); c.Name = "Mickey Mouse"; c.Address = "101 Main Street"; c.City = "Orlando"; c.State = "FL"; c.ZipCode = "10101"; /* Test the command.*/ int customerID = CustomerDB.AddCustomer(c); c = CustomerDB.GetCustomer(customerID); /* If the test subject has a name within the database, the test was successful. */ Assert.AreEqual("Mickey Mouse", c.Name); /*Clean up the test*/ CustomerDB.DeleteCustomer(c); }
public void DeleteCustomer(int customerID) { cDb.DeleteCustomer(customerID); }