Raphael added tests to show the resources amount depending on their type
Refactored some code and test code