def it_creates_a_loan_request(self):
     an_employee_decorator = EmployeeDecorator()
     an_employee_decorator.decorate(self.a_person)
     self.a_credit_analyst_decorator.decorate(self.a_person)
     self.a_credit_analyst_decorator.create_loan_request(
         self.an_account, 10000)
     self.a_person.input_area | should | contain('1234567-8')
 def it_decorates_a_person(self):
     #should fail
     (self.a_credit_analyst_decorator.decorate,
      self.a_person) | should | throw(AssociationError)
     #should work
     an_employee_decorator = EmployeeDecorator()
     an_employee_decorator.decorate(self.a_person)
     self.a_credit_analyst_decorator.decorate(self.a_person)
     self.a_credit_analyst_decorator.decorated | should | be(self.a_person)
     self.a_credit_analyst_decorator.decorated | should | have(2).decorators
 def it_creates_a_loan(self):
     an_employee_decorator = EmployeeDecorator()
     an_employee_decorator.decorate(self.a_person)
     loan_request = LoanRequest(self.an_account, 7000,
                                self.a_credit_analyst_decorator)
     self.a_credit_analyst_decorator.decorate(self.a_person)
     self.a_credit_analyst_decorator.decorated.output_area[
         self.an_account.number] = loan_request
     #creates a machine to be decorated by the account - will need to check its processing_area
     a_machine = Machine()
     self.an_account.decorate(a_machine)
     #creates the loan
     self.a_credit_analyst_decorator.create_loan(loan_request)
     #given that I am using datetime to generate the key, I cannot access the newly
     #created loan through its key
     self.a_credit_analyst_decorator.decorated.output_area.values(
     ) | should | have_at_least(1).loan
 def it_analyses_a_loan_request(self):
     an_employee_decorator = EmployeeDecorator()
     an_employee_decorator.decorate(self.a_person)
     #Stub removed, from now on Node really transfers resources internally
     self.a_credit_analyst_decorator.decorate(self.a_person)
     self.an_account.average_credit = 5000
     #should approve
     self.a_credit_analyst_decorator.create_loan_request(
         self.an_account, 10000)
     self.a_credit_analyst_decorator.analyse(self.an_account.number)
     self.a_credit_analyst_decorator.decorated.output_area[
         '1234567-8'].approved | should | equal_to(True)
     #should refuse
     self.a_credit_analyst_decorator.create_loan_request(
         self.an_account, 50000)
     self.a_credit_analyst_decorator.analyse(self.an_account.number)
     self.a_credit_analyst_decorator.decorated.output_area[
         '1234567-8'].approved | should | equal_to(False)
 def setUp(self):
     self.an_employee_decorator = EmployeeDecorator()
     self.an_attendant_decorator = AttendantDecorator()
     self.an_attendant = Person()
def given_i_am_a_registered_credit_analyst(step):
    world.a_person = Person()
    an_employee_decorator = EmployeeDecorator()
    an_employee_decorator.decorate(world.a_person)
    world.credit_analyst = CreditAnalystDecorator('09876-5')
    world.credit_analyst.decorate(world.a_person)
Example #7
0
 def setUp(self):
     self.an_employee_decorator = EmployeeDecorator()
     #test doubles won't work given type checking rules, using classic
     self.a_person = Person()