Acceptance Tests - TeamGroup-Org/CS2263_Project1 GitHub Wiki
Use Cases
Setup
UC01 - Beginning the Game
Test 1 - Normal Case
- GIVEN: Each Player gets 6,000$
- AND: Rest of the money is put into a pile
- WHEN: Each Player draws a tile
- AND: Puts it face up on a matching letter space on a gameboard
- AND: Player 2 plays a card closest to 1A
- THEN: Player 2 plays first. All six players decide as a group whether the money and stocks acquired will be openly displayed
Playing A Tile
UC02 - Founding a Corporation
Test 1 - Normal Case
- GIVEN: A Player places a tile next to an unincorporated tile
- AND: A corporation is founded
- WHEN: The founder selects an available corporation building marker
- AND: Places it on anyone of the corporation’s tiles
- THEN: Player receives a free founders bonus stock
Test 2 - No Stock Remaining
- GIVEN: A player places a tile next to an unincorporated tile
- AND: A corporation is founded
- WHEN: The founder selects an available corporation building marker
- AND: The Player is already holding all corporation’s stock cards
- THEN: Player doesn’t receive a founders bonus stock
UC03 - Tile Played Between Two Corporations
Test 1 - Normal Case
- GIVEN: A player places a tile next to an unincorporated tile
- AND: A corporation is founded
- WHEN: The founder selects an available corporation building marker
- AND: Player plays a tile that connects two corporations
- AND: A merger takes place
- THEN: The larger corporation absorbs the smaller corporation
Buying Stocks
UC04 - Purchasing Stock
Test 1 - Normal Case
- GIVEN: Player One has legally placed a tile
- AND: Resolved all activities involved with placing the tile
- WHEN: Player One requests 2 Stock in Tower
- AND: Correct payment is issued to the stock market tray
- THEN: Requested stock is issued to Player One
Test 2 - Insufficient Funds
- GIVEN: Player One has legally placed a tile
- AND: Resolved all activities involved with placing the tile
- AND: Has a current balance of $0
- WHEN: Player One requests 1 Stock in American
- THEN: An appropriate message is displayed, use case exit
Test 3 - Insufficient Stock
- GIVEN: Player One has legally placed a tile
- AND: Resolved all activities involved with placing the tile
- WHEN: Player One requests 3 Stock in Festival
- AND: All 25 Festival Stock have already been purchased
- THEN: Prompt player for different selection or exit
Drawing a Tile
UC05 - Draw Tile
Test 1 - Normal Case
- GIVEN: A player turn has has ended
- AND: There are tiles left to draw
- WHEN: Player turn begins
- THEN: Player is given the first tile from the facedown cluster of tiles
Test 2 - No tiles left
- GIVEN: Player turn has ended
- AND: There are no tiles left to draw
- WHEN: Player turn begins
- THEN: Player doesn’t receive a tile and no tile is drawn
Test 3: Player exits program turning drawing
- GIVEN: Player turn has ended
- AND: One player decides to exit the program
- WHEN: Player presses exit button
- THEN: Program terminates
Ending the Game
UC06 - Game End
Test 1 - Normal Case
- GIVEN: A player has 41 or more tiles on the game board, or all corporations are safe
- AND: Player presses end game button
- AND: It is the player’s turn
- WHEN: Player presses end game button
- THEN: End of game begins
Test 2 - Invalid end game state
- GIVEN: A player presses the end game button
- AND: Not all corporations are safe, and one player doesn’t have 41 or more tiles
- WHEN: Player presses end game button
- THEN: System ignores the button input
Test 3 - Deadlock
- GIVEN: There are no more tiles left to draw
- AND: No player can play a tile
- AND: No player presses the end game button
- WHEN: Next player turn begins
- THEN: End of game begins