A Manager of a warehouse

If you are too lazy to constantly recreate projects for kata, download bat. You can read how to use it here

Task

Create a method for managing loads in a warehouse.

Acceptance criteria

All the code should be covered by tests.

  1. Create a class responsible for a warehouse state. The constructor must take the area of the warehouse in square meters (int).
  • Anyone can find out the area of the warehouse (public read access)
  1. The class must have a method of loading goods.
  • input parameter - the size of the truck with the goods (number of boxes, int), each box has a base of one square meter
  • the method returns the number of boxes that were placed in the warehouse (boxes take up space in the warehouse - 1 square meter)
  • if there is not enough space, the appropriate part of the boxes remains in the truck
  • anyone can find out the unfilled area of the warehouse (public read access)
  1. Create a method that allows you to unload goods from a warehouse.
  • input parameter - the size of the truck (in square meters, int)
  • each machine must be loaded as densely as possible!
  • the method returns the number of unloaded boxes
  • if the goods are not enough to load the next car, then
    • the truck leaves partially loaded (returns a value less than the volume of the truck)
    • 0 boxes left in the warehouse
  1. New 4 square meter boxes have been released!
  • adapt the acceptance to the new conditions (allowing to bring boxes of different sizes at the same time)
  • methods now return not the number of boxes, but their total area
  • unload the warehouse, filling the car as much as possible!
  • fill the warehouse as densely as possible!
  • make sure that if the machine is not completely filled, there are not always 0 boxes left in the warehouse (from item 3)