-
Notifications
You must be signed in to change notification settings - Fork 1k
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
made tests for implementations and added files #784
base: main
Are you sure you want to change the base?
Conversation
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.
LGTM
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.
Good job! Let’s fix a few mistakes ;)
@@ -0,0 +1,28 @@ | |||
package model; |
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 is the model package placed here?
import org.junit.jupiter.api.Test; | ||
|
||
class FileWriterServiceImplTest { | ||
|
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.
assertThrows(RuntimeException.class, () -> fruitService.processFruitLines(data)); | ||
} | ||
|
||
@Test |
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.
which difference between this test and input_InvalidData_NotOk
ActivityType.PURCHASE, new PurchaseOperationsHandler(), | ||
ActivityType.RETURN, new ReturnOperationsHandler() | ||
)); | ||
|
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.
new FruitTransaction(ActivityType.BALANCE, "apple", 100), | ||
new FruitTransaction(ActivityType.SUPPLY, "banana", 100) | ||
); | ||
assertDoesNotThrow(() -> processService.process(data)); |
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.
you should check data in storage and add more test cases, for instance, purchase when fruits are not enough, other operations, etc.
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.
not fixed
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.
I added 4 more tests for that
Storage.getStorage().put("banana", 100); | ||
Storage.getStorage().put("apple", 100); | ||
String expected = "fruit,quantity" + System.lineSeparator() | ||
+ "banana,100" + System.lineSeparator() | ||
+ "apple,100"; |
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.
what are you testing here?
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class FileWriterServiceImplTest { |
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.
you also can add a method that reads the file and checks the data that was written.
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.
Not fixed
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.
Some comments should be fixed
new FruitTransaction(ActivityType.BALANCE, "apple", 100), | ||
new FruitTransaction(ActivityType.SUPPLY, "banana", 100) | ||
); | ||
assertDoesNotThrow(() -> processService.process(data)); |
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.
not fixed
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class FileWriterServiceImplTest { |
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.
Not fixed
No description provided.