public void PrintSummary() { PlayerStats playerStats = new PlayerStats(); List<WeeklyScore> lastWeeksScores = _allScores.Where(s => s.Week.WeekNumber == SelectedWeek.WeekNumber - 1).ToList(); List<Point> lastWeekMensHighSeries = playerStats.GetTop3HighSeriesPlayers(lastWeeksScores, "M"); List<Point> overallMensHighSeries = playerStats.GetTop3HighSeriesPlayers(_allScores, "M"); List<Point> lastWeekMensHighGames = playerStats.GetTop3HighGamePlayers(lastWeeksScores, "M"); List<Point> overallMensHighGames = playerStats.GetTop3HighGamePlayers(_allScores, "M"); List<Point> lastWeekWomensHighSeries = playerStats.GetTop3HighSeriesPlayers(lastWeeksScores, "F"); List<Point> overallWomensHighSeries = playerStats.GetTop3HighSeriesPlayers(_allScores, "F"); List<Point> lastWeekWomensHighGames = playerStats.GetTop3HighGamePlayers(lastWeeksScores, "F"); List<Point> overallWomensHighGames = playerStats.GetTop3HighGamePlayers(_allScores, "F"); SummaryReportData summaryReportData = new SummaryReportData(_teams, lastWeekMensHighSeries, overallMensHighSeries, lastWeekMensHighGames, overallMensHighGames, lastWeekWomensHighSeries, overallWomensHighSeries, lastWeekWomensHighGames, overallWomensHighGames); new PrintSummaryReport().Print(summaryReportData, SelectedWeek); }
public void given_a_list_of_scores_when_printing_the_top_3_high_series_for_women_then_only_the_top_3_high_series_for_women_should_print() { Team team1 = CreateTeam("team1"); Team team2 = CreateTeam("team2"); Week week1 = CreateWeek(1, "week1"); Player player1 = CreatePlayer("M", 1, "player1", team1, 150); Player player2 = CreatePlayer("F", 2, "player2", team1, 150); Player player3 = CreatePlayer("M", 3, "player3", team1, 150); Player player4 = CreatePlayer("F", 4, "player4", team1, 150); Player player5 = CreatePlayer("M", 5, "player5", team1, 150); Player player6 = CreatePlayer("F", 6, "player6", team1, 150); Player player7 = CreatePlayer("M", 7, "player7", team1, 150); Player player8 = CreatePlayer("F", 8, "player8", team1, 150); WeeklyScore score1 = CreateWeeklyScore(100, 101, 102, player1, team1, week1, false); WeeklyScore score2 = CreateWeeklyScore(103, 104, 105, player2, team1, week1, false); WeeklyScore score3 = CreateWeeklyScore(106, 107, 108, player3, team1, week1, false); WeeklyScore score4 = CreateWeeklyScore(109, 110, 111, player4, team1, week1, false); WeeklyScore score5 = CreateWeeklyScore(112, 113, 114, player5, team1, week1, false); WeeklyScore score6 = CreateWeeklyScore(115, 116, 117, player6, team1, week1, false); WeeklyScore score7 = CreateWeeklyScore(118, 119, 120, player7, team1, week1, true); WeeklyScore score8 = CreateWeeklyScore(121, 122, 123, player8, team1, week1, true); List<WeeklyScore> scores = new List<WeeklyScore>() { score1, score2, score3, score4, score5, score6, score7, score8 }; PlayerStats playerStats = new PlayerStats(); List<Point> top3Scores = playerStats.GetTop3HighSeriesPlayers(scores, "M"); Assert.That(3, Is.EqualTo(top3Scores.Count)); Assert.IsNotNull(top3Scores.Find(p => p.Points == 339)); Assert.IsNotNull(top3Scores.Find(p => p.Points == 321)); Assert.IsNotNull(top3Scores.Find(p => p.Points == 303)); }