Skip to content
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 solution1 #799

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

add solution1 #799

wants to merge 4 commits into from

Conversation

evgenkolner
Copy link

No description provided.

Copy link

@RomanYuzviak RomanYuzviak left a comment

Choose a reason for hiding this comment

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

Great solution, but you can improve it a little bit

@@ -0,0 +1,4 @@
package core.basesyntax;

class MainTest {

Choose a reason for hiding this comment

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

Redundant class

private ReaderService fileReaderService = new FileReaderServiceImpl();

@Test
void readFromNonExistingDirectory_notOk() {

Choose a reason for hiding this comment

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

In method name there is not the name of method

}

@Test
void readFromExistingDirectory_Ok() {

Choose a reason for hiding this comment

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

the same

import org.junit.jupiter.api.Test;

public class ReportCreatorServiceImplTest {
private static ReportCreatorService reportCreatorService;

Choose a reason for hiding this comment

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

I think you can add keyword final here

Copy link

@Andriy-dz Andriy-dz left a comment

Choose a reason for hiding this comment

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

Very Good Job! Lets improve your solution

@Test
void convertData_notNumericQuantity_notOk() {
List<String> data = List.of("b,banana,10", "b,apple,10", "s,banana,2a0");
assertThrows(RuntimeException.class,

Choose a reason for hiding this comment

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

where in your code u throw RuntimeException?

Choose a reason for hiding this comment

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

not fixed

import org.junit.jupiter.api.Test;

public class BalanceOperationTest {
private final OperationService balanceOperation = new BalanceOperation();

Choose a reason for hiding this comment

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

lets initializate it in BeforeAll. Same in other cases

balanceOperation.doOperation(appleTransaction);
int secondAppleActual = Storage.getStorage().get("apple");
assertEquals(120, secondAppleActual);
}

Choose a reason for hiding this comment

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

what will happen if you send a negative value or null here. Same in other cases

@evgenkolner evgenkolner requested a review from Andriy-dz October 11, 2023 05:49
@Test
void convertData_notNumericQuantity_notOk() {
List<String> data = List.of("b,banana,10", "b,apple,10", "s,banana,2a0");
assertThrows(RuntimeException.class,

Choose a reason for hiding this comment

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

not fixed

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.

3 participants