Skip to content

luisrovirosa/KataPotter-PHP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Objective

Resolve the KataPotter using TDD with Classicist style with Object Calisthenics and SOLID in mind.

Solution

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.

Classes

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.

Usage

  1. Instalar composer curl -sS https://getcomposer.org/installer | php
  2. php composer.phar install
  3. ./vendor/bin/phpunit

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages