Giter VIP home page Giter VIP logo

vending-machine-kata's Introduction

Spock Workshop - 07.05.2014 - Poznan

Who we are:

  • Piotr Betkier - Grupa Allegro - NAP team
  • Pawel Szymczyk - Grupa Allegro - Saturn team

Agenda

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ł

vending-machine SPOCK kata

  1. clone vending-machine project

    git clone https://[email protected]/allegro-kata/vending-machine-kata.git

  2. Checkout proper branch (team01..10)
  3. If you use IntelliJ, import Gradle project and run tests normally
  4. Or start playing with tests from command-line:

    gradle test

    gradle cleanTest test - to run again when nothing changed (gradle works incrementally)

  5. Kata - implement 4 user stories

See

  1. Spock Big Picture
  2. http://docs.spockframework.org
  3. http://groovy.codehaus.org/Groovy+style+and+language+feature+guidelines+for+Java+developers

User stories

Based on http://github.com/guyroyse/vending-machine-kata

1. Accept Coins

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.


2. Accept Coins - corner case

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.


3. Select Product

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.


4. Make Change

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.


5. Storage & eMails

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:

  1. display NO ${productName}, SORRY
  2. send email to vendor with supply request

vending-machine-kata's People

Contributors

bartoszwalacik avatar pszymczyk avatar pcierpiatka avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.