Exemplo n.º 1
0
        public void GivenDataLoaded_WhenMovieGotById_ThenCorrectMovieReturned()
        {
            var movieStore = new MovieJsonStore();

            movieStore.LoadFromString(_movieJsonData);

            var movie = movieStore.GetById(424694);

            Assert.Equal(424694, movie.Id);
            Assert.Equal("Bohemian Rhapsody", movie.Title);
        }
        public IActionResult Details(int id)
        {
            var movieStore = new MovieJsonStore();

            movieStore.LoadFromString(MovieResources.movies);

            var movie = movieStore.GetById(id);
            var model = new MovieViewModel
            {
                Id               = movie.Id,
                Title            = movie.Title,
                OriginalLanguage = movie.OriginalLanguage,
                ReleaseDate      = movie.ReleaseDate,
                VoteAverage      = movie.VoteAverage
            };

            return(View(model));
        }