Ejemplo n.º 1
0
    def test_002_add_employee_01(self):


        with self.assertRaises(company.InvalidDataTypeForNumberOfWorkHours):
            company.DeveloperSenior("*****@*****.**", "Slobodan", "Dolinic", "M", {"hours": "pera"} )

        slobodan = company.DeveloperSenior("*****@*****.**", "Slobodan", "Dolinic", "M", 140)
        self.digital_cube.add_employee(slobodan)
        self.assertEqual(len(self.digital_cube), 1)
Ejemplo n.º 2
0
    def test_003_add_employee_01(self):

        slobodan = company.DeveloperSenior("*****@*****.**", "Slobodan", "Dolinic", "M", 140)
        self.digital_cube.add_employee(slobodan)
        ivo = company.DeveloperJunior("*****@*****.**", "Ivo", "Kovacevic", "M", 140)
        self.digital_cube.add_employee(ivo)
        self.assertEqual(len(self.digital_cube), 2)

        self.assertEqual(
'''<Company name="DigitalCUBE", address="Otona Zupancica 24, Beograd">
  <DeveloperSenior email="*****@*****.**", fist_name="Slobodan", last_name="Dolinic", gender="M" />
  <DeveloperJunior email="*****@*****.**", fist_name="Ivo", last_name="Kovacevic", gender="M" />
</Company>''', str(self.digital_cube))
Ejemplo n.º 3
0
    def test_005_add_employee_01(self):
        self.digital_cube.add_employee(company.DeveloperSenior("*****@*****.**", "Slobodan", "Dolinic", "M", 140))
        self.digital_cube.add_employee(company.DeveloperJunior("*****@*****.**", "Ivo", "Kovacevic", "M", 140))
        self.assertEqual(self.digital_cube.nr_of_workhours(), 280)
        self.digital_cube.add_employee(company.DeveloperJunior("*****@*****.**", "Mladen", "Milicevic", "M", 140))
        self.assertEqual(self.digital_cube.nr_of_workhours(), 420)
        self.digital_cube.add_employee(company.Hygienist("*****@*****.**", "Dragana", "Dragana", "F", 10))
        self.assertEqual(self.digital_cube.nr_of_workhours(), 420+10)

        with self.assertRaises(company.EmailNotPresentedInCompany):
            self.digital_cube.set_hierarchy("*****@*****.**", "*****@*****.**")


        self.digital_cube.set_hierarchy("*****@*****.**", "*****@*****.**")
        self.digital_cube.set_hierarchy("*****@*****.**", "*****@*****.**")
        self.digital_cube.set_hierarchy("*****@*****.**", "*****@*****.**")

        with self.assertRaises(company.DuplicatedMasterException):
            self.digital_cube.set_hierarchy("*****@*****.**", "*****@*****.**")

        self.digital_cube.show_hierarchy()
Ejemplo n.º 4
0
 def test_004_add_employee_01(self):
     self.digital_cube.add_employee(company.DeveloperSenior("*****@*****.**", "Slobodan", "Dolinic", "M", 140))
     with self.assertRaises(company.EmployeeMustBeUniqueInCompany):
        self.digital_cube.add_employee(company.DeveloperSenior("*****@*****.**", "Slobodan", "Dolinic", "M", 140))
Ejemplo n.º 5
0
    def test_001_constructor_01(self):

        pera = company.DeveloperSenior("*****@*****.**", "Pera", "Peric", "M", 140)
        self.assertEqual('<DeveloperSenior email="*****@*****.**", fist_name="Pera", last_name="Peric", gender="M" />', str(pera))