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: improve code testability #20

Merged
merged 2 commits into from
Aug 8, 2022

Conversation

Alkaar
Copy link
Owner

@Alkaar Alkaar commented Aug 8, 2022

There is no functional code change here. This was simply to refactor the code so I can leverage scalatest and mockito. Most of the work was to expose the Resy API so it can be mocked and the rest of the code can be tested. Minor refactors were made along the way.

  • Breakout Resy API into a ResyApi class so it can be mocked
  • Create ResyClient to take in ResyApi object as an argument (or in a testing use case, a mocked version of it)
  • Moved workflow code outside of the main driver code for ease of readability since most people will be modifying the driver and the workflow code can be distracting
  • Other minor improvements

@Alkaar Alkaar self-assigned this Aug 8, 2022
@Alkaar Alkaar merged commit 148e557 into master Aug 8, 2022
@Alkaar Alkaar deleted the refactor/improve-code-testability branch August 8, 2022 22:12
@github-actions
Copy link

🚀 PR was released in v1.0.0 🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label Sep 21, 2022
@Alkaar Alkaar added the refactor A code change that neither fixes a bug nor adds a feature label Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor A code change that neither fixes a bug nor adds a feature released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant