TeamStats BuildTeamStatsFrom(Team teamRecord, IEnumerable<Team> teams) { var playerYearStats = PlayerYearStatsRepository.GetAllForYear(teamRecord.Year); var seasons = teams.OrderBy(x => x.Year).Select(team => team.Year); return new TeamStats(teamRecord, playerYearStats, seasons); }
public TeamStats(Team team, IEnumerable<PlayerYearStats> playerYearStats, IEnumerable<int> seasons) { Year = team.Year; Wins = team.Wins; Losses = team.Losses; Seasons = seasons; PlayerYearStats = playerYearStats; AddTotals(); }
public void Setup() { _team = new Team { Year = 2012, Wins = 1, Losses = 1, }; _seasons = new List<int> {2012, 2011}; _playerYearStats = new List<PlayerYearStats>(); }