public void GetAllHighscores() { var database = new Database(); List<HighScore> scores = database.GetAllHighscores(); Assert.That(scores, Is.Not.Empty); List<Player> players = database.GetAllPlayers(); Assert.That(players, Is.Not.Empty); }
public ActionResult Index() { ViewBag.Highscores = "<table>" + "<tr><th>Rank</th><th>Player</th><th>Score</th></tr>"; var database = new Database(); foreach (var scoreUser in database.GetAllHighscores()) foreach (var player in database.GetAllPlayers()) if (player.Id == scoreUser.PlayerId) ViewBag.Highscores += "<tr><td>" + scoreUser.PositionInRanking + ".</td>" + "<td>" + player.Username + "</td>" + "<td>" + scoreUser.Score + "</td></tr>"; ViewBag.Highscores += "</table>"; return View(); }