Skip to content

Conversation

@6aHguTo
Copy link
Contributor

@6aHguTo 6aHguTo commented Dec 25, 2024

No description provided.

@github-actions
Copy link

github-actions bot commented Dec 25, 2024

Test Results

30 tests  +8   30 ✅ +8   2s ⏱️ ±0s
 7 suites +2    0 💤 ±0 
 7 files   +2    0 ❌ ±0 

Results for commit 72e6080. ± Comparison against base commit 458129c.

♻️ This comment has been updated with latest results.

@codacy-production
Copy link
Contributor

codacy-production bot commented Dec 25, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+14.01%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (458129c) 414 101 24.40%
Head commit (be4e4a8) 414 (+0) 159 (+58) 38.41% (+14.01%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#112) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@6aHguTo 6aHguTo requested review from oleksandr-jr and removed request for dRaider-bitrek and oleksandr-jr December 25, 2024 16:49

private PhoneBookInterface phoneBookInterface;
private EditContactMenu editContactMenu;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like test logic clashes the Triple AAA pattern


@ParameterizedTest
@CsvSource({"1, New Name", "2, 987654321", "3, new.email@example.com", "4, newGithubID", "5, invalid"})
void testEditContactMenuEdit(String userChoice, String userInput) throws IOException {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider using more informative method name. What is the expected behaviour of the test? Is it _SuccessfulEditing, _CorrectEditing, _EditsSuccessfuly? Do we really need prefix "test" here?

assertEquals(0, result);

ContactDto updatedContact = editContactMenu.getContact();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider declaring local parameters or even const variables:

private final String ONE = "1";
...
String expectedName = "New Name";

if (userChoice.equals(ONE) && userInput.equals(expectedName)) { assertEquals(expectedName, updatedContact.getFullName()); verify(phoneBookInterface, times(1)).edit(updatedContact); ...

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.

4 participants