Files
Theatrical-Players-Refactor…/java
2019-08-08 10:20:39 +02:00
..
2019-08-08 10:20:39 +02:00
2019-08-08 10:20:39 +02:00
2019-08-08 10:20:39 +02:00

Video store kata

Based on the book 'Refactoring' by Martin Fowler. More information on this book can be found on https://martinfowler.com/books/refactoring.html

Imagine a company of theatrical players who go out to various events performing plays. Typically, a customer will request a few plays and the company charges them based on the size of the audience and the kind of play they perform. There are currently two kinds of plays that the company performs: tragedies and comedies. As well as providing a bill for the performance, the company gives its customers “volume credits” which they can use for discounts on future performances—think of it as a customer loyalty mechanism.

Plays.json

{
  "hamlet": {"name": "Hamlet", "type": "tragedy"},
  "as-like": {"name": "As You Like It", "type": "comedy"},
  "othello": {"name": "Othello", "type": "tragedy"}
}

Invoices.json

[
  {
    "customer": "BigCo",
    "performances": [
      {
        "playID": "hamlet",
        "audience": 55
      },
      {
        "playID": "as-like",
        "audience": 35
      },
      {
        "playID": "othello",
        "audience": 40
      }
    ]
  }
]