Skip to content

Latest commit

 

History

History
95 lines (81 loc) · 4.3 KB

VideoClubRental.md

File metadata and controls

95 lines (81 loc) · 4.3 KB

VideoClub Rental

Background Info

This is a big one. It feels fairly simple but it can grow very quickly. Based it of an exercise presented by Jason Gorman on his fabulous TDD workshops and built upon it to add some more content.

Specifications

  • Users have their name and email stored.
  • Users can specify a wishlist. Users should be notified when their wished title becomes available.
  • Wishlist is non-case sensitive.
  • Users get charged per rental title £2.5.
  • Rentals have a return by date of 15 days, starting on the rental day.
  • Rentals returned on time award the user 2 priority points.
  • Users get discount with multiple rentals, up to 3 simultaneous rentals £2.5 -> £2.25 -> £1.75.
  • Users can donate videos to the library.
  • Users get priority points when donating videos (10 points per title).
  • Library records must include Title, Director, Release year, number of copies.
  • Administrator-level users can create or delete new users
  • Administrator-level users can create a new newsletter

Use Case Scenarios

Scenario: User registring to videoclub as an adult
Given User A registers with name: "Sam", age: 18, email: "sam@brfaz12345.com"
When library registers an entry for User A
Then library sends User A a welcome email

Scenario: User cannot register to videoclub as a minor
Given User A registers with name: "Sam", age: 17, email: "sam@brfaz12345.com"
When library registers an entry for User A
Then library does not send a welcome email

Scenario: User donates a copy of a non-existing title to the library
Given "Sam" and "Pawel" are members of the VideoClub
And "Sam" donates a new title with title: "Star Wars VII", director: "JJ Abrahams" and age: "2015"
And "Pawel" has a wishlist with title: "Star Wars VII" on it
Then the library creates a new entry for the title with count 1
And "Sam" receives 10 loyalty points
And "Pawel" receives a notification that title: "Star Wars VII" is available

Scenario: User donates a copy of an existing title to the library
Given "Sam" and "Pawel" are members of the VideoClub
And "Sam" donates a new title with title: "Star Wars VII", director: "JJ Abrahams" and age: "2015"
And "Pawel" has a wishlist with title: "Star Wars VII" on it
Then the library increases the count for title: "Star Wars VII" by 1
And "Sam" receives 10 loyalty points
And "Pawel" receives a notification that title: "Star Wars VII" is available

Scenario: user A performs a simple rental
Given user A is a member of the videoclub
And title is available for rental
Then user A can borrow the available copy
And user A gets charged £2.50
And library registers the copy as unavailable

Scenario: Returning a rental copy
Given user A performs a simple rental
And user A returns title
And user B is number 1 on the waiting list
Then library registers copy as available
And sends a thank you email to user A
And sends a title available email to user B

Scenario: Returning the wrong rental copy
Given user A performs a simple rental
And user A returns title
Then library sends an email to user with a warning

Scenario: Failed to return a rental copy
Given user A performs a simple rental
And 16 days later copy is still not returned
Then library sends an email to the user A
And prevents user from rental further copies
And user A looses 2 priority points

Scenario: Reserving a rental copy
Given user A is a video library member
And user A has more than 5 priority points
And user A adds title to user A wishlist
And user B is number 1 in the waiting list
And user A is number 2 in the waiting list
And user A requests to have priority access
And title becomes available for rental
Then user A gets a notification for availability
And user B does not get a notification for availability

Scenario: Sending newsletter to all members
Given user A is a administrator user
And user B is a member user
And user C is a member user
And user A sends a newsletter email
Then user B receives a newsletter email
And user C receives a newsletter email

Test Data