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

Refactored FormattingSwitch...Tests suites #269

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Refactored FormattingSwitch...Tests suites #269

wants to merge 6 commits into from

Conversation

fresheed
Copy link

@fresheed fresheed commented Nov 6, 2017

While digging through field updating logic I came across FormattingSwitch...Tests classes which (as I understood) are etalons on how different properties values are parsed. Unfortunately these classes contained a lot of duplicating and were hard to read. So I refactored them:

  • Junit's parametrized tests feature was used. So test cases which are only differ in values to test were replaced with single lines in test values list.
  • These classes contained duplicating code such as doit, getFormat methods and SwitchTestData utility classes. So FormattingTestsBase superclass was introduced.

As a result, these classes are now several times shorter than originals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant