The following repo contains Live football world cup scoreboard which is Java based application.
You are working in a sports data company, and we would like you to develop a new Live Football World Cup Scoreboard library (or frontend application) that shows all the ongoing matches and their scores. The scoreboard supports the following operations:
- Start a new game, assuming initial score 0 โ 0 and adding it the scoreboard. This should capture following parameters: a. Home team b. Away team
- Update score. This should receive a pair of absolute scores: home team score and away team score.
- Finish game currently in progress. This removes a match from the scoreboard.
- Get a summary of games in progress ordered by their total score. The games with the same total score will be returned ordered by the most recently started match in the scoreboard. For example, if following matches are started in the specified order and their scores respectively updated: a. Mexico 0 - Canada 5 b. Spain 10 - Brazil 2 c. Germany 2 - France 2 d. Uruguay 6 - Italy 6 e. Argentina 3 - Australia 1 The summary should be as follows:
- Uruguay 6 - Italy 6
- Spain 10 - Brazil 2
- Mexico 0 - Canada 5
- Argentina 3 - Australia 1
- Germany 2 - France 2
-
Clone this repository
-
Go to src/test/java directory and run WorldCupScoreBoardTest.java
All Junit tests are in Java test class WorldCupScoreBoardTest.java
WorldCupScoreBoardTest contains Junit test :
void itShouldInsertMatch()
void itShouldNotInsertMatchWhenSameMatchExists()
void itShouldNotInsertMatchWhenActiveMatchExist()
void itShouldRemoveMatch()
void itShouldUpdateMatch()
void itShouldNotUpdateMatchWhenMatchIsDisabled()
void itShouldNotUpdateTeamWithNegativeTeamScoreValue()
void itShouldReturnOrderedMatches()
Any question regarding this repo can be send to email [email protected]