public void GetClasificationWhenTeamsShouldReturnCurrentClasification() { string[,] teamList = { { "Team 1", "12" }, { "Team 2", "10" } }; Competition initialCompetition = new Competition(teamList); Assert.Equal(teamList, initialCompetition.GetClasification()); }
public void AddTeamWhenNullShouldDoNothing() { string[,] teamList = { { "Team 1", "12" }, { "Team 2", "10" } }; Competition initialCompetition = new Competition(teamList); initialCompetition.AddTeam(null); Assert.Equal(teamList, initialCompetition.GetClasification()); }
public void AddMatchWhenEmptyShouldDoNothing() { string[,] teamList = { { "Team 1", "12" }, { "Team 2", "10" } }; Competition initialCompetition = new Competition(teamList); string[,] matchList = { { } }; initialCompetition.AddTeam(matchList); Assert.Equal(teamList, initialCompetition.GetClasification()); }
public void AddMatchWhenOneMatchShouldIncreaseTeamPointsAndSortClasification() { string[,] finalTeamList = { { "Team 2", "13" }, { "Team 1", "12" } }; string[,] initialTeamList = { { "Team 1", "12" }, { "Team 2", "10" } }; Competition initialCompetition = new Competition(initialTeamList); string[,] matchListToAdd = { { "Team 2", "3" } }; initialCompetition.AddMatch(matchListToAdd); Assert.Equal(finalTeamList, initialCompetition.GetClasification()); }
public void AddTeamWhenTeamAlreadyExistsShouldIgnoreItAddTheOtherTeamsAndSortClasification() { string[,] finalTeamList = { { "Team 1", "12" }, { "Team 3", "11" }, { "Team 2", "10" } }; string[,] initialTeamList = { { "Team 1", "12" }, { "Team 2", "10" } }; Competition initialCompetition = new Competition(initialTeamList); string[,] teamListToAdd = { { "Team 3", "11" }, { "Team 2", "8" } }; initialCompetition.AddTeam(teamListToAdd); Assert.Equal(finalTeamList, initialCompetition.GetClasification()); }
public void AddTeamWhenMoreThanOneTeamShouldAddTeamsAndSortClasification() { string[,] finalTeamList = { { "Team 1", "12" }, { "Team 3", "11" }, { "Team 2", "10" }, { "Team 4", "8" } }; string[,] initialTeamList = { { "Team 1", "12" }, { "Team 2", "10" } }; Competition initialCompetition = new Competition(initialTeamList); string[,] teamListToAdd = { { "Team 3", "11" }, { "Team 4", "8" } }; initialCompetition.AddTeam(teamListToAdd); Assert.Equal(finalTeamList, initialCompetition.GetClasification()); }
public void AddMatchWhenTeamNoExistsShouldIgnoreItAddTheOtherMatchesAndSortClasification() { string[,] finalTeamList = { { "Team 1", "12" }, { "Team 3", "11" }, { "Team 2", "10" } }; string[,] initialTeamList = { { "Team 1", "12" }, { "Team 2", "10" }, { "Team 3", "8" } }; Competition initialCompetition = new Competition(initialTeamList); string[,] matchListToAdd = { { "Team 3", "3" }, { "Team 4", "3" } }; initialCompetition.AddMatch(matchListToAdd); Assert.Equal(finalTeamList, initialCompetition.GetClasification()); }
public void GetClasificationWhenNoTeamsShouldReturnNull() { Competition initialCompetition = new Competition(null); Assert.Null(initialCompetition.GetClasification()); }