예제 #1
0
        public void GetClasificationWhenTeamsShouldReturnCurrentClasification()
        {
            string[,] teamList = { { "Team 1", "12" }, { "Team 2", "10" } };
            Competition initialCompetition = new Competition(teamList);

            Assert.Equal(teamList, initialCompetition.GetClasification());
        }
예제 #2
0
        public void AddTeamWhenNullShouldDoNothing()
        {
            string[,] teamList = { { "Team 1", "12" }, { "Team 2", "10" } };
            Competition initialCompetition = new Competition(teamList);

            initialCompetition.AddTeam(null);

            Assert.Equal(teamList, initialCompetition.GetClasification());
        }
예제 #3
0
        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());
        }
예제 #4
0
        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());
        }
예제 #5
0
        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());
        }
예제 #6
0
        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());
        }
예제 #7
0
        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());
        }
예제 #8
0
        public void GetClasificationWhenNoTeamsShouldReturnNull()
        {
            Competition initialCompetition = new Competition(null);

            Assert.Null(initialCompetition.GetClasification());
        }