public async Task AddMoreThanTenHighscores()
        {
            Highscore highscore;

            int score = 100;

            while (score <= 1100)    // Will add the highscore eleven times
            {
                highscore = new Highscore()
                {
                    Playername = "Player One " + score,
                    Points     = score
                };
                await highscoreManagement.AddHighscore(highscore);

                score += 100;
            }

            var highscores = await highscoreManagement.GetHighscores();

            Assert.True(highscores.Count == 10);
            Assert.True(highscores.Last().Points == 200);

            dbContext.Highscores.RemoveRange(highscores);
            await dbContext.SaveChangesAsync();
        }
        public async Task <bool> AddHighscore(Highscore highscore)
        {
            var highscores = await _context.Highscores.OrderByDescending(h => h.Points).ToListAsync();

            if (highscores.Count >= 10 && highscore.Points <= highscores.Last().Points)
            {
                return(false);
            }

            _context.Highscores.Add(highscore);
            if (highscores.Count >= 10)
            {
                _context.Highscores.Remove(highscores.Last());
            }
            await _context.SaveChangesAsync();

            return(true);
        }