Resolve the KataPotter using TDD with Classicist style with Object Calisthenics and SOLID in mind.
I have solved most of the cases including the two groups of four is better than one of five and another of three.
With this implementation is very simple to add/remove rules or strategies to group the books.
Basket: Calculate the price of the Books using the Discounts.
Book: Holds the Book information.
Discounts:Generate the different ways to group the Books and calculate the best discount possible.
Books: Collection of books to get the collection related functions.
BooksGroup: A way to group the books to get the maximum number of discounts.
GroupsGenerator: Generate the different BooksGroup from at the Books to get the maximum number of discounts.
discounts folder: Business rules related to the discounts.
groups: Strategies to generate the different BooksGroup.
- Instalar composer
curl -sS https://getcomposer.org/installer | php
php composer.phar install
./vendor/bin/phpunit