-
Notifications
You must be signed in to change notification settings - Fork 0
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
Tested shopping cart functionality #19
Conversation
ivan0dyatlyukkk
commented
Oct 23, 2023
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.
GJ! Let`s improve your solution
void findById_withValidId_returnsCartItem() { | ||
CartItem actualCartItem = cartItemRepository.findById(TEST_VALID_CART_ITEM_ID).get(); | ||
|
||
assertNotNull(actualCartItem.getShoppingCart()); |
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.
Are you sure that is it enough to assert that shopping cart is not null, maybe makes sence to check content of cart?And actually make sure that you have at least one tets which checks content of something that you receive
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.
It is not resolved, at least in CartControllerTest you don`t have assert where content of cart is checked fullt
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 are completely right, sorry, I added it to the next method and forgot to add to this one
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.
Comments are not fully resolved
void findById_withValidId_returnsCartItem() { | ||
CartItem actualCartItem = cartItemRepository.findById(TEST_VALID_CART_ITEM_ID).get(); | ||
|
||
assertNotNull(actualCartItem.getShoppingCart()); |
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.
It is not resolved, at least in CartControllerTest you don`t have assert where content of cart is checked fullt