- Piotr Betkier - Grupa Allegro - NAP team
- Pawel Szymczyk - Grupa Allegro - Saturn team
Slot What Who 9:00 - 9:40 Spock Intro: - spock-intro.md Piotrek - GroovyFeaturesTest Paweł - BddStyleSpockTest Piotrek - AssertionsSpockTest Piotrek - VerifyExceptionsSpockTest Piotrek - DataDrivenSpockTest Paweł - CustomAssertionSpockTest Paweł - MockSpockTest Paweł - StubSpockTest Paweł 9:40 - 10:40 Story 1. Accept Coins, write tests in AcceptCoinsTest Piotrek 11:00 - 12:30 Story 2. Accept Coins - corner case Piotrek 12:30 - 13:30 Obiadek sponsorowany Estella 13:30 - 14:50 Story 3. Select Product Paweł 15:00 - 16:30 Story 4. Make Change Paweł
- clone vending-machine project
git clone https://[email protected]/allegro-kata/vending-machine-kata.git
- Checkout proper branch (team01..10)
- If you use IntelliJ, import Gradle project and run tests normally
- Or start playing with tests from command-line:
gradle test
gradle cleanTest test
- to run again when nothing changed (gradle works incrementally) - Kata - implement 4 user stories
- Spock Big Picture
- http://docs.spockframework.org
- http://groovy.codehaus.org/Groovy+style+and+language+feature+guidelines+for+Java+developers
Based on http://github.com/guyroyse/vending-machine-kata
As a vendor I want a vending machine that accepts coins So that I can collect money from the customer
The vending machine will accept valid coins (nickels, dimes, and quarters) and reject invalid one (pennies).When a valid coin is inserted the amount of the coin will be added to the current amount and the display will be updated (use pattern: CREDIT 9.99). When there are no coins inserted, the machine displays INSERT COIN. Rejected coins are placed in the coin return.
As a vendor I want a vending machine to reject a coin when internal Coin Cassette is full
The vending machine has internal Coin Cassette with dedicated tubes for each coin type. When machine is not serviced properly, tubes can be full. In such case, when client inserts a valid coin, it should be rejected and machine should display CASSETTE IS FULL, SORRY.
If the display is checked again, it will show INSERT COINS or CREDIT, depending on current state.
As a vendor I want customers to select products So that I can give them an incentive to put money in the machine
There are three products: cola for $1.00, chips for $0.50, and candy for $0.65. When the respective button is pressed and enough money has been inserted, the product is dispensed and the machine displays THANK YOU.
If the display is checked again, it will show INSERT COINS and the current amount will be set to $0.00. If there is not enough money inserted then the machine displays PRICE and the price of the item and subsequent checks of the display will display either INSERT COINS or the current amount as appropriate.
As a vendor I want customers to receive correct change So that they will use the vending machine again
When a product is selected that costs less than the amount of money in the machine, then the remaining amount is placed in the coin return.
As a venodr I want to be notified via email when machine runs out of product
Vending machine has one shelve per product, each with 10 items capacity. Full machine contains 10x cola, 10x chips and 10x candy.
Each time when user selects sold out product, machine should do two things:
- display NO ${productName}, SORRY
- send email to vendor with supply request