Skip to content

Refactored FormattingSwitch...Tests suites#269

Open
fresheed wants to merge 6 commits into
plutext:masterfrom
fresheed:formatting_tests_refactoring
Open

Refactored FormattingSwitch...Tests suites#269
fresheed wants to merge 6 commits into
plutext:masterfrom
fresheed:formatting_tests_refactoring

Conversation

@fresheed
Copy link
Copy Markdown

@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