Пример #1
0
        public void GetTeamsByIdCompetition_TeamsForThatCompetitionExist_ReturnsTeamList()
        {
            var competition = CompetitionCommands.SaveCompetition(new Competition {
                Name = RandomUtil.GetRandomString(), Description = RandomUtil.GetRandomString(100)
            }, Context);
            var serie1 = SerieCommands.SaveSerie(new Serie {
                Description = RandomUtil.GetRandomString(), IdCompetition = competition.IdCompetition
            }, Context);
            var serie2 = SerieCommands.SaveSerie(new Serie {
                Description = RandomUtil.GetRandomString(), IdCompetition = competition.IdCompetition
            }, Context);

            TeamCommands.SaveTeam(new Team {
                Name = RandomUtil.GetRandomString(), Description = RandomUtil.GetRandomString(), IdSerie = serie1.IdSerie
            }, Context);
            TeamCommands.SaveTeam(new Team {
                Name = RandomUtil.GetRandomString(), Description = RandomUtil.GetRandomString(), IdSerie = serie1.IdSerie
            }, Context);
            TeamCommands.SaveTeam(new Team {
                Name = RandomUtil.GetRandomString(), Description = RandomUtil.GetRandomString(), IdSerie = serie2.IdSerie
            }, Context);
            TeamCommands.SaveTeam(new Team {
                Name = RandomUtil.GetRandomString(), Description = RandomUtil.GetRandomString(), IdSerie = serie2.IdSerie
            }, Context);

            var teams = TeamQueries.GetTeamsByIdCompetition(Context, competition.IdCompetition);

            Assert.IsNotNull(teams);
            Assert.AreEqual(4, teams.Count);
        }
Пример #2
0
 public void GetTeamsByIdCompetition_TeamsForThatCompetitionDoesNotExist_ReturnsEmptyList()
 {
     Assert.IsEmpty(TeamQueries.GetTeamsByIdCompetition(Context, -1));
 }