Esempio n. 1
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());
        }
Esempio n. 2
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());
        }
Esempio n. 3
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());
        }
Esempio n. 4
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());
        }