Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pieetrus/score-board
Sample project written using TDD
https://github.com/pieetrus/score-board
bdd csharp tdd
Last synced: 3 days ago
JSON representation
Sample project written using TDD
- Host: GitHub
- URL: https://github.com/pieetrus/score-board
- Owner: pieetrus
- Created: 2024-05-09T08:11:50.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-09T18:13:42.000Z (8 months ago)
- Last Synced: 2024-11-08T19:48:57.414Z (about 2 months ago)
- Topics: bdd, csharp, tdd
- Language: C#
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Live Football World Cup Scoreboard Library
## Overview
The Live Football World Cup Scoreboard is a simple library designed to manage football matches during the World Cup. It provides functionalities to start a new match, update scores, finish a match, and retrieve a summary of ongoing matches based on the total score and most recent activity.
## Getting Started
### Prerequisites
- .NET 8
- Any preferred IDE that supports C# (e.g., Visual Studio, VSCode)### Installation
Clone the repository to your local machine:
```
git clone https://github.com/pieetrus/score-board
```### Usage
To use the scoreboard in your project, reference the library and follow the example below to manipulate match data:
```
var scoreboardService = new ScoreboardService(new MatchRepository());// Starting a match
scoreboardService.StartMatch("HomeTeamName", "AwayTeamName");// Updating scores
scoreboardService.UpdateScores("HomeTeamName", "AwayTeamName", 2, 3);// Finishing a match
scoreboardService.FinishMatch("HomeTeamName", "AwayTeamName");// Getting summary of matches
var summary = scoreboardService.GetSummary();```
### Assumptions
1. Matches that was finished does not need to be stored.
2. Only one match of teams with the same name could be ongoing.
3. No UI for interaction with library is required.
4. Summary doesn't have to be returned in format provided as example in documentation.### Potential improvements
#### Data Persistence
Database Integration: Transition from an in-memory store to a database to ensure data persistence across system restarts and crashes, which would also support more complex queries and long-term data storage.
#### Domain Driven Design
- Use factory for Match creation and Score update - for now it could break SRP principle
- Use ValueObjects
- Add identifier to Match - now they are diffrentiate based on home and away team names
- Use Events - for better testing#### Add more abstractions
Abstraction could be added from repository for easier database or other storage implementation
#### Asynchronous operations
I did not add it due to in-memory storage solution was used.