Esempio n. 1
0
        private static int GetScoreByPictures(Advertisement advertisement)
        {
            var scoreByPictures = 0;

            if (advertisement.GetTotalPictures() == 0)
            {
                scoreByPictures -= 10;
            }
            else
            {
                var pictures = advertisement.GetPictures();
                pictures.ForEach(p =>
                {
                    if (p.Quality == QualityEnum.HD.Name)
                    {
                        scoreByPictures += 20;
                    }
                    else
                    {
                        scoreByPictures += 10;
                    }
                });
            }

            return(scoreByPictures);
        }