예제 #1
0
        public string GetLongestOpeningCrawlMovie()
        {
            List <Films> films        = dataAccess.GetAllFilms().ToList();
            var          openingCrawl = films.Max(s => s.OpeningCrawl);
            var          longest      = films.FirstOrDefault(s => s.OpeningCrawl == openingCrawl);

            return(longest.Title);
        }
        public void GetLongestMovie()
        {
            var filmsList = A.CollectionOfFake <Films>(10);

            filmsList[0].OpeningCrawl = "a series of bbbbbb";
            filmsList[0].Title        = "new movie";
            A.CallTo(() => dataAccess.GetAllFilms()).Returns(filmsList);
            var movie = controller.GetLongestMovie();

            Assert.NotNull(movie);
        }