private IList <Movie> GetMoviesGroup(GroupDto groupOne, GroupDto groupTwo)
 {
     return(new List <Movie>
     {
         _tiebreaker.Apply(new List <Movie> {
             groupOne.Movies.First(), groupTwo.Movies.Last()
         }).First(),
         _tiebreaker.Apply(new List <Movie> {
             groupTwo.Movies.First(), groupOne.Movies.Last()
         }).First()
     });
 }
Example #2
0
        public void Execute(CompetitionBizDto dto)
        {
            var disputeResult = _tiebreaker.Apply(dto.Finals.Movies).ToList();

            dto.CompetitionResult = new CompetitionResultDto
            {
                FirstPlace  = disputeResult.First(),
                SecondPlace = disputeResult.Last(),
                ThirdPlace  = GetThirdPlace(dto.SemiFinals, disputeResult.First())
            };
        }
Example #3
0
 public IList <GroupDto> Dispute(IEnumerable <GroupDto> groups)
 {
     return(groups.Select
            (
                x => new GroupDto
     {
         Name = x.Name,
         Movies = _tiebreaker.Apply(x.Movies).Take(AmountMovies)
     }
            ).ToList());
 }