def test_should_create_customer_with_properties(self): customer = Customer('identifier_type', 'identifier', 'name') assert_equals('identifier_type', customer.identifier_type()) assert_equals('identifier', customer.identifier()) assert_equals('name', customer.name())
def test_should_create_customer_with_properties(self): customer = Customer ('identifier_type', 'identifier', 'name') assert_equals('identifier_type', customer.identifier_type()) assert_equals('identifier', customer.identifier()) assert_equals('name', customer.name())
def test_should_save_customer(self): identifier_type = "some_type" identifier = "any_identifier" name = "Customer Name" customer = Customer(identifier_type, identifier, name) repository = CustomerRepository(self.db) repository.save(customer) customer_save = repository.get_by_identifier("any_identifier") assert_equals(customer.identifier_type(), customer_save.identifier_type())
def test_should_save_customer(self): identifier_type = 'some_type' identifier = 'any_identifier' name = 'Customer Name' customer = Customer(identifier_type, identifier, name) repository = CustomerRepository(self.db) repository.save(customer) customer_save = repository.get_by_identifier('any_identifier') assert_equals(customer.identifier_type(), customer_save.identifier_type())
def test_should_return_true_when_compare_two_equals_customer(self): customerOne = Customer('identifier_type', 'identifier', 'name') customerTwo = Customer('identifier_type', 'identifier', 'name') assert_equals(customerOne, customerTwo)
def test_should_return_false_when_compare_two_diferents_customer(self): customerOne = Customer('identifier_type', 'identifier', 'name') customerTwo = Customer('identifier_type', 'other_identifier', 'name') assert_not_equals(customerOne, customerTwo)
def decode_custom(self, document): assert document["_type"] == "customer" customer = Customer(document["identifier_type"], document["identifier"], document["name"]) return customer