コード例 #1
0
    def test_manager_with_single_employee_calculates_total_pay(self):
        manager = Manager()
        developer = Developer()
        manager.add_employee(developer)

        amount_paid = manager.pay()

        self.assertEquals(1300, amount_paid)
コード例 #2
0
    def test_manager_with_single_employee_calculates_total_pay(self):
        manager = Manager()
        developer = Developer()
        manager.add_employee(developer)

        amount_paid = manager.pay()

        self.assertEquals(1300, amount_paid)
コード例 #3
0
    def test_manager_with_multiple_manager_levels_calculates_total_pay(self):
        manager = Manager()

        manager2 = Manager()
        manager2.add_employee(Developer())
        manager2.add_employee(QA())

        manager.add_employee(manager2)

        amount_paid = manager.pay()

        self.assertEquals(2100, amount_paid)
コード例 #4
0
    def test_manager_with_multiple_employees_no_managers_calculates_total_pay(
            self):
        manager = Manager()
        manager.add_employee(Developer())
        manager.add_employee(QA())

        amount_paid = manager.pay()

        self.assertEquals(1800, amount_paid)
コード例 #5
0
    def test_manager_lone_pays_300(self):
        manager = Manager()

        amount_paid = manager.pay()

        self.assertEqual(300, amount_paid)
コード例 #6
0
    def test_manager_lone_pays_300(self):
        manager = Manager()

        amount_paid = manager.pay()

        self.assertEqual(300, amount_paid)
コード例 #7
0
    def test_department_with_all_kinds_of_employees(self):
        department = Department()
        department.add_employee(Developer())
        department.add_employee(QA())

        manager = Manager()
        manager.add_employee(QA())
        manager.add_employee(Developer())
        manager.add_employee(Manager())

        manager2 = Manager()
        manager2.add_employee(Developer())

        manager.add_employee(manager2)

        department.add_employee(manager)

        amount_paid = department.pay()

        self.assertEqual(4900, amount_paid)