Example #1
0
 public void RunLoadTeams()
 {
     var numTeamsInDatabase = 5;
     var repo = new TeamRepository();
     var teams = repo.LoadTeams();
     Assert.AreEqual(numTeamsInDatabase, teams.Count);
 }
        public TeamList GetTeamList()
        {
            TeamList model = new TeamList();
            TeamRepository tRepo = new TeamRepository();
            PlayersRepository pRepo = new PlayersRepository();
            model.Teams = tRepo.LoadTeams();
            List<Player> players = pRepo.LoadPlayers();
            foreach (Team team in model.Teams)
                team.Players = players.Where(p => p.TeamId == team.TeamId).ToList();

            return model;
        }