Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor createTemplateService and add a few automated tests #507

Merged
merged 7 commits into from
Sep 15, 2021

Commits on Aug 31, 2021

  1. Remove test folder and create tests

    Tests is more used and intuitive since it stores all the tests not
    just one. Also the existing test files weren't working and only had
    tests for getters and setters (probably auto generated tests).
    anarute committed Aug 31, 2021
    Configuration menu
    Copy the full SHA
    3954015 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    55b4b2b View commit details
    Browse the repository at this point in the history
  3. Move template creation logic to TemplateService

    The createTemplateService will just receive a request and return
    whatever the TemplateService parses and executes from it.
    
    The goal is to start splitting what handles the requests and what
    processes the data and business logic.
    anarute committed Aug 31, 2021
    Configuration menu
    Copy the full SHA
    74a3e2a View commit details
    Browse the repository at this point in the history
  4. Split template creation

    Add parseTemplates that is a pure function that receives a XMLReader
    and returns an array of TemplateVO with the parsed values from
    the XML.
    anarute committed Aug 31, 2021
    Configuration menu
    Copy the full SHA
    864c208 View commit details
    Browse the repository at this point in the history
  5. Pass LoginManager as a parameter instead of instanciating it

    Use depedency injection to decouple TemplateService from
    LoginManager. This will make TemplateService more isolated and
    easier to test, since with this change we are able to mock
    LoginManager instead of instanciating it.
    anarute committed Aug 31, 2021
    Configuration menu
    Copy the full SHA
    6107705 View commit details
    Browse the repository at this point in the history
  6. Add tests for TemplateService

    Add initial set of tests for the TemplateService: one for testing
    the parserTemplates method and another to check if user can't
    create a template if there's no active section
    anarute committed Aug 31, 2021
    Configuration menu
    Copy the full SHA
    e40028d View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    21fd68d View commit details
    Browse the repository at this point in the history