Skip to content

harrider/CodingChallenge_Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coding Challenge Read Me - Python Implementation

How to Run / Execute

  1. On the command line, navigate to the top-level 'CodingChallenge_Python" directory

  2. On the command line, type:

    • 'py main.py'
  3. For UNSORTED employee hierarchy output:

    • in the 'appsettings.json' file set 'SortEmployeeHierarchyOutput' to 'false'
  4. For SORTED employee hierarchy output:

    • in the 'appsettings.json' file set 'SortEmployeeHierarchyOutput' to 'true'

How To Run

How to Run Unit Tests

  1. On the command line, navigate to the top level 'CodingChallenge_Python' directory

  2. on the command line, type:

    • 'py -m unittest discover -s UnitTests -p '*UnitTests.py' -v'

How To Run Unit Tests

Example Program Input and Output

Exmaple Input

Exmaple Output

File Structure

  1. CodingChallenge_Python
    • main.py

      • The entry point to the console application
      • Composes the functionality from the 'CodingChallengeModule' into an application
    • CodingChallengeModule

      • init.py

        • Designates directory as a Python module
      • Classes.py

        • Contains class definitions for 'Employee' and 'Manager' types
      • DataReader.py

        • Class definition for 'DataReader'
        • Provides a 'Read()' method that returns a root 'Manager' object containing the employee hierarchy
      • JsonDataReader.py

        • Class definition for 'JsonDataReader'
        • Provides a 'Read()' method that reads employee hierarchy data from a JSON file and returns a root 'Manager' object containing the employee hierarchy
      • EmployeeHierarchyPrinter.py

        • Class definition for 'EmployeeHierarchyPrinter'
        • Provides a 'PrintString()' method that formats an employee hierarchy string
        • Employee Hierarchy Data is UNSORTED
      • SortedEmployeeHierarchyPrinter.py

        • Class definition for 'SortedEmployeeHierarchyPrinter'
        • Provides a 'PrintString()' method that formats an employee hierarchy string
        • Employee Hierarchy Data is SORTED
      • SalaryRequirementPrinter.py

        • Class definition for 'SalaryRequirementPrinter'
        • Provides a 'PrintString()' method that formats the total salary requirment

UML Diagram for Idea of How Types are Composed

Coding Challenge Implementation Overview

About

Coding Challenge Python Implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages