Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
There are a number of potential issues here:
DataGame
but the provided boilerplate saysGamesDetails
(should be singular,GameDetails
).stock
disappears.GameShop
class should probably receive its stock in the constructor rather than be hardcoded.shop
would be better-named asisCartWithinBudget
,canAffordCart
or similar.Cart
class with a contract like, for example,cart.isWithinBudget(budget)
and methods to add and remove items.GameShop
seems like too high a level of abstraction--that feels like the whole enterprise.import java.util.*
isn't considered good practice. Better to explicitly importHashMap
andList
(in that order, alphabetically).There are no tests where one would want to buy more items than available in stock: https://www.codewars.com/kata/reviews/634d800c238807000175778f/groups/634e7e6efb7a7d0001865f8c