Giter Site home page Giter Site logo

oyster-card's Introduction

The Oyster Card Problem

You are required to model the following fare card system which is a limited version of London’s Oyster card system. At the end of the test, you should be able to demonstrate a user loading a card with £30, and taking the following trips, and then viewing the balance.

  • Tube Holborn to Earl’s Court
  • 328 bus from Earl’s Court to Chelsea
  • Tube Earl’s court to Hammersmith

Operation

When the user passes through the inward barrier at the station, their oyster card is charged the maximum fare. When they pass out of the barrier at the exit station, the fare is calculated and the maximum fare transaction removed and replaced with the real transaction (in this way, if the user doesn’t swipe out, they are charged the maximum fare).

All bus journeys are charged at the same price. The system should favour the customer where more than one fare is possible for a given journey. E.g. Holburn to Earl’s Court is charged at £2.50. For the purposes of this test use the following data:

Stations and zones:

Station Zone(s)
Holborn 1
Earl's Court 1, 2
Wimbledon 3
Hammersmith 2

Fares:

Journey Fare
Anywhere in Zone 1 £2.50
Any one zone outside zone 1 £2.00
Any two zones including zone 1 £3.00
Any two zones excluding zone 1 £2.25
Any three zones £3.20
Any bus journey £1.80

The maximum possible fare is therefore £3.20.

Assessment Criteria

Points you will be assessed on:

  • Following the Operational requirements
  • A working solution which meets the requirements.
  • Testing methods and coverage
  • Design, Approach and Elegance of Solution.

Execute the build

To run the build, type the following in command line in the project's root directory:

mvn clean test

All the test cases are executed as part of this build.

Spock Reports

After the build has run, the test reports can be found in target/spock-reports. Use a browser to view the index.html file.

Specifications Summary Page

Specification Summary Page

Feature Summary Page

Click on any feature link to view the detail test criteria and test results. Feature Summary Page

oyster-card's People

Contributors

donaldsiziba avatar

Watchers

 avatar  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.