Giter Club home page Giter Club logo

scoreboardlibrary's Introduction

Live Football World Cup Scoreboard Library

This is a simple library implementation for managing ongoing football matches and their scores, following the requirements provided in the task description. The library provides a way to start new matches, update scores, finish matches, and retrieve a summary of matches in progress ordered by their total score.

Usage

To use this library, you can follow these steps:

  1. Clone the repository or integrate the provided classes into your project.

  2. Create an instance of the Scoreboard class to manage ongoing matches:

    IScoreboard scoreboard = new Scoreboard();
  3. Start matches, update scores, and finish matches using the provided methods:

    // Start a new match
     scoreboard.StartMatch("Mexico", "Canada");
    
     // Update scores for a match
     scoreboard.UpdateScore("Mexico", "Canada", 0, 5);
    
     // Finish a match
     scoreboard.FinishMatch("Mexico", "Canada");
  4. Retrieve a summary of matches in progress ordered by their total score:

    var matchesInProgress = scoreboard.GetMatchesInProgressOrderedByScore();
    foreach (var match in matchesInProgress)
    {
    	Console.WriteLine($"{match.HomeTeam} {match.HomeScore} - {match.AwayTeam} {match.AwayScore}");
    }

Running Tests

The project includes unit tests to verify the functionality of the library. These tests are implemented using Xunit and can be run using a test runner of your choice.

  1. Install the Xunit NuGet package if not already installed:

    dotnet add package Xunit
  2. Run the tests using the following command:

    dotnet test	

Assumptions

Please note the following assumptions made during the implementation:

  1. Match order identifiers are used to distinguish matches with the same total score. The higher the order identifier, the more recently the match was started.
  2. Team names are case-sensitive and must not be empty or contain only whitespace.
  3. Negative scores are not allowed for updates.
  4. Matches between the same teams cannot be started simultaneously.

Feedback and Improvements

If you have any feedback, suggestions for improvements, or encounter issues with the library, please feel free to open an issue on this repository.

scoreboardlibrary's People

Contributors

svcho avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.