Refactoring existing unit tests#7687
Conversation
Transformed StringLengthComparatorTest & MinifyNameListFormatterTest to parameterized tests, since they've got multiple assertions within one unit test included (Test Smell: Assertion Roulette)
There exists unit tests in these test classes that have multiple assertions (Test smell: Assertion Roulette). I therefore have refactored those unit tests, either by incorporating them into existing parameterized tests or by creating new parameterized tests.
koppor
left a comment
There was a problem hiding this comment.
Nice to see work on using paramterized tests.
Please do that everywhere.
General comment: It would be nice to have one pull request per test class. Otherwise, reviewing gets hard, because there are soooo many lines changed.
(I also updated #6207. I hope not to annoy people when always wringint things NOT to do)
Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
Hi @koppor |
Looking at our mass of pull requests, I decided to have "global" reviewing strategy/workflow for our core developers. Deciding on a case-bases makes it difficult to handle the mass of open pull requests. Furthermore, if at class A there is a comment, but class B can go as is, the changes of class B won't go into
You could use the
|
| @@ -10,151 +10,134 @@ | |||
|
|
|||
| public class AuthorsTest { | |||
There was a problem hiding this comment.
Please convert the whole class to paramterized tests
|
I will merge and wait for parameterized AuthorsTest in a follow-up pr |
* upstream/main: (71 commits) [Bot] Update CSL styles (#7735) Fix for issue 6966: open all files of multiple entries (#7709) Add simple unit tests (#7696) Add simple unit tests (#7543) Update check-outdated-dependencies.yml Added preset for new entry keybindings and reintroduced defaults (#7705) Select the entry which has smaller dictonary order when merge (#7708) Update CHANGELOG.md fix: make more fields, fomatters, ids and languages sorted by alphabetical order (#7717) Bump libreoffice from 7.1.2 to 7.1.3 (#7721) Bump unoloader from 7.1.2 to 7.1.3 (#7724) Bump org.beryx.jlink from 2.23.7 to 2.23.8 (#7723) Bump org.openjfx.javafxplugin from 0.0.9 to 0.0.10 (#7725) fix: make fields sorted by lexicographical order (#7711) Fix tests Refactoring existing unit tests (#7687) Refactoring and addition of unit tests (#7581) Refactor simple Unit Tests (#7571) Add simple unit tests (#7544) add and extend unit tests (#7685) ...
This pull request contributes to issue #6207, which is to add more unit tests or improve existing ones.
Tests refactored:
MinifyNameListFormatterTest
StringLengthComparatorTest
CapitalizeFormatterTest
AuthorsTest
RemoveBracketsAddCommaTests
DOICheckTest
FileLinkTest
FirstPageTest
RemoveTildeTest
CHANGELOG.mddescribed in a way that is understandable for the average user (if applicable)