-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add four additional unit tests #7653
Conversation
FieldChange.java 18% -> 94% Abbreviation.java 63% -> 88% SuggestionProviders.java 0% -> 100%
FileHelper.java -> Boundary testing of an empty file CitationKeyGenerator.java -> Boundary testing of testlagepage parser for 0-00 & 1-1 HTMLCharacterChecker.java -> Null Value Boundary test
ParsedEntryLink.java -> Partition testing of ParsingEntryLink UpperCaseFormatter.java -> Partition testing for special characters CitationStyleCacheTest.java -> Partition testing of cache storage
SPTest typo fix
Checkstyle passed
Adjustments for @ellieMayVelasquez feedback #7543 (review)
Assertion Roulette
Added Resource Optimism
Added assertion messages to fix assertion roulette.
General Fixture, removed test code duplication
checkstyle fix
General Refactoring
not needed
Fixed AssertionRoulette, one instance of duplicated test code.
Test code duplication
Assertion Roulette fixed
fixed Assertion Roulette
using test doubles
assertEquals("foo", (LayoutEntry.parseMethodsCalls("bla(test),foo(fark)").get(1)).get(0)); | ||
assertEquals("test", (LayoutEntry.parseMethodsCalls("bla(test),foo(fark)").get(0)).get(1)); | ||
assertEquals("fark", (LayoutEntry.parseMethodsCalls("bla(test),foo(fark)").get(1)).get(1)); | ||
assertEquals(1, LayoutEntry.parseMethodsCalls("bla").size(), "Parsing of layout entry method calls failed."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please no comment for the assert, This is bad design. Better group this into multiple methods testing one aspect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even better, use ParameterizedTests!
@@ -29,41 +39,40 @@ public void migrateToCorrectField(SpecialField field, String fieldInKeyword, Bib | |||
|
|||
@Test | |||
public void noKewordToMigrate() { | |||
BibEntry entry = new BibEntry().withField(StandardField.AUTHOR, "JabRef") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you change this? withField is a a valid alternative
|
||
@Test | ||
void testEquals() { | ||
BibEntry entry = new BibEntry(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We talked about this before in your other PR. No testing on equals or hashcode or toString necessary
assertEquals("bla", (LayoutEntry.parseMethodsCalls("bla").get(0)).get(0), "Parsing of layout entry method calls failed. Input did not match expected output."); | ||
|
||
assertEquals(1, LayoutEntry.parseMethodsCalls("bla,").size(), "Parsing of layout entry method calls failed. Check for comma behaviour."); | ||
assertEquals("bla", (LayoutEntry.parseMethodsCalls("bla,").get(0)).get(0), "Parsing of layout entry method calls failed. Input did not match expected output."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Directly compare the content of the lists, not their size!
It seems like we already have enough unit tests for that classes and here are many confilicts, so Im closing |
This pull request contributes to issue #6207, which is to add more unit tests to the project.
Tests added:
AppendWordsStrategyTest
ChangeScannerTest
NewEntryActionTest
FileHistoryMenuTest
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)