Ejemplo n.º 1
0
 def test_customer_getters(self):
     address = Address()
     address.set_address("Strada Academiei nr. 7")
     address.set_county("Bucuresti")
     address.set_country("Romania")
     address.set_postal_code("010011")
     customer = Customer("Ion", "Radu", "*****@*****.**",
                         "0758245170", address)
     self.assertEqual(customer.get_first_name(), "Ion")
     self.assertEqual(customer.get_last_name(), "Radu")
     self.assertEqual(customer.get_email_address(), "*****@*****.**")
     self.assertEqual(customer.get_phone_number(), "0758245170")
     self.assertEqual(customer.get_address(), address)
Ejemplo n.º 2
0
 def test_equal(self):
     address = Address()
     address.set_address("Strada Academiei nr. 7")
     address.set_county("Bucuresti")
     address.set_country("Romania")
     address.set_postal_code("010011")
     customer = Customer("Ion", "Radu", "*****@*****.**",
                         "0758245170", address)
     customer2 = copy.deepcopy(customer)
     customer.set_id(1)
     customer2.set_id(2)
     self.assertNotEqual(customer, customer2)
     customer2.set_id(1)
     customer2.set_last_name("Dan")
     self.assertNotEqual(customer, customer2)
     customer2.set_last_name(customer.get_last_name())
     customer2.set_first_name("Pop")
     self.assertNotEqual(customer, customer2)
     customer2.set_first_name(customer.get_first_name())
     customer2.set_email_address("isk")
     self.assertNotEqual(customer, customer2)
     customer2.set_email_address(customer.get_email_address())
     customer2.set_phone_number("dokf")
     self.assertNotEqual(customer, customer2)