Exemple #1
0
 def InvalidNameException(self):
     """
     Test that the InvalidNameException is thrown when a first and last name does not meet the criteria.
     :return: Pass or fail test.
     """
     with self.assertRaises(InvalidNameException):
         customer5 = cust(1234, '123', 'Ty', '515-456-7890')
         customer6 = cust(1234, 'Hobbs', '123', '515-456-7890')
Exemple #2
0
 def InvalidCustomerException(self):
     """
     Test that the InvalidCustomerException is thrown when a customer_id does not meet the criteria.
     :return: Pass or fail test.
     """
     with self.assertRaises(InvalidCustomerException):
         customer3 = cust(123, 'Hobbs', 'Ty', '515-456-7890')
         customer4 = cust(123456, 'Hobbs', 'Ty', '515-456-7890')
Exemple #3
0
 def InvalidPhoneNumberFormat(self):
     """
     Test that the correct phone number format is inputted.
     :return: Pass or fail test.
     """
     with self.assertRaises(InvalidPhoneNumberFormat):
         customer7 = cust(123, 'Hobbs', 'Ty', '5-456-7890')
         customer8 = cust(123, 'Hobbs', 'Ty', '515-45a-7890')
         customer9 = cust(123, 'Hobbs', 'Ty', '515-456-7')
         customer10 = cust(123, 'Hobbs', 'Ty', '515-987-7654')
Exemple #4
0
 def test_inital_all_attributes(self):
     """
     Test that all initial values are set
     :return: Pass of fail of the test
     """
     customer = cust(6789, "Smith", "Jane", "515-555-5555")
     assert customer.customer_id == 6789
     assert customer.last_name == 'Smith'
     assert customer.first_name == 'Jane'
     assert customer.phone_number == '515-555-5555'
Exemple #5
0
 def setUp(self):
     self.customer1 = cust(1234, "Hobbs", "Ty", "319-330-1234")