Skip to content

tests - #1339

Open
AlexPranschke wants to merge 2 commits into
mate-academy:mainfrom
AlexPranschke:main
Open

tests#1339
AlexPranschke wants to merge 2 commits into
mate-academy:mainfrom
AlexPranschke:main

Conversation

@AlexPranschke

Copy link
Copy Markdown

No description provided.

@slade13 slade13 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good job, the overall test structure is on the right track: services and transaction handlers have their own test classes, normal and exceptional scenarios are present. The biggest improvements are to follow the required test naming convention consistently, strengthen assertions so tests verify complete behavior rather than only sizes/contains(), and focus more on meaningful boundary cases.

Comment thread src/test/java/core/basesyntax/service/impl/DataConverterTest.java Outdated
Comment thread src/test/java/core/basesyntax/service/impl/FileReaderCsvTest.java Outdated
Comment thread src/test/java/core/basesyntax/strategy/SupplyTransactionTest.java Outdated
Comment thread src/test/java/core/basesyntax/service/impl/ReportGeneratorTest.java Outdated
Comment thread src/test/java/core/basesyntax/service/impl/DataConverterTest.java
Comment thread src/test/java/core/basesyntax/service/impl/ReportGeneratorTest.java
@AlexPranschke
AlexPranschke requested a review from slade13 August 16, 2026 13:40

@slade13 slade13 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Some of the test names still do not follow test name convention:

<methodUnderTest>_<state>_<expectedBehavior>

for example:

execute_removesFruitQuantity()
execute_throwsExceptionWhenNotEnoughFruit()
execute_setsFruitQuantity()
execute_addsFruitQuantity()
execute_addsFruitWhenFruitDoesNotExist()

Please also review my other comments, besides that it looks good.

}

@Test
void convertData_ConvertData_dataTrimmed() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fix capitalization problem, also this test could be named better:

Suggested change
void convertData_ConvertData_dataTrimmed() {
void convertData_dataWithSpaces_returnsTrimmedTransaction() {

}

@Test
void setFruitQuantity_ZeroQuantity_isOk() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fix capitalization problem:

Suggested change
void setFruitQuantity_ZeroQuantity_isOk() {
void setFruitQuantity_zeroQuantity_isOk() {

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.

2 participants