public void getSortedTeamsAscendingWPctByLeague() { LeagueStandingsReport.ReportScope scope = new LeagueStandingsReport.ReportScope(); scope.League = ""; scope.Division = "American"; scope.OrderAscending = true; List <Team> teams = leagueStandingsReport.getTeamsByWinPercentage(scope); Assert.AreEqual(6, teams.Count); double lastWpct = -1; foreach (Team team in teams) { if (lastWpct == -1) { lastWpct = team.Wpct; } else { Assert.IsTrue(team.Wpct >= lastWpct); Debug.WriteLine(team.Wpct); lastWpct = team.Wpct; } } }
public void testGettingTeamByAbbreviation() { LeagueStandingsReport.ReportScope scope = new LeagueStandingsReport.ReportScope(); scope.AllTeams = true; Assert.IsNotNull(leagueStandingsReport.getTeamByAbbreviation("PTB")); Assert.IsNotNull(leagueStandingsReport.getTeamByAbbreviation("CHB")); Assert.IsNull(leagueStandingsReport.getTeamByAbbreviation("XXX")); }
public void getTeamsByInvalidLeague() { LeagueStandingsReport.ReportScope scope = new LeagueStandingsReport.ReportScope(); scope.League = "XX"; List <Team> teams = leagueStandingsReport.getTeamsByWinPercentage(scope); Assert.AreEqual(0, teams.Count); }
public void getTeamsByDivision() { LeagueStandingsReport.ReportScope scope = new LeagueStandingsReport.ReportScope(); scope.League = ""; scope.Division = "Federal"; List <Team> teams = leagueStandingsReport.getTeamsByWinPercentage(scope); Assert.AreEqual(6, teams.Count); }
public void getAllTeamsByOwner() { LeagueStandingsReport.ReportScope scope = new LeagueStandingsReport.ReportScope(); scope.AllTeams = true; Assert.AreEqual(6, leagueStandingsReport.getTeamsByOwner("B").Count); Assert.AreEqual(6, leagueStandingsReport.getTeamsByOwner("M").Count); // Assert.AreEqual(5, leagueStandingsReport.getTeamsByOwner("J").Count); // Assert.AreEqual(6, leagueStandingsReport.getTeamsByOwner("S").Count); Assert.AreEqual(6, leagueStandingsReport.getTeamsByOwner("G").Count); }
public void getAllSortedTeamsByName() { LeagueStandingsReport.ReportScope scope = new LeagueStandingsReport.ReportScope(); scope.AllTeams = true; scope.OrderAscending = true; List <Team> teams = leagueStandingsReport.getTeamsByName(scope); Assert.AreEqual(18, teams.Count); Assert.AreEqual("ARIZONA", teams[0].Name.ToUpper()); Assert.AreEqual("CHICAGO", teams[1].Name.ToUpper()); Assert.AreEqual("CLEVELAND", teams[2].Name.ToUpper()); Assert.AreEqual("DETROIT", teams[3].Name.ToUpper()); }