Beispiel #1
0
        public async Task <IActionResult> Information(string id)
        {
            if (!ModelState.IsValid)
            {
                return(RedirectToAction("Index"));
            }

            var movieDetails = await _omdbService.GetDetailsByImdbIdAsync($"&i={id}");

            if (movieDetails != null)
            {
                return(View(movieDetails));
            }
            else
            {
                return(RedirectToAction("Index"));
            }
        }
        public void Test_Imdb_Movie_Details_Is_Not_Empty()
        {
            var movieDetails = _omdbService.GetDetailsByImdbIdAsync($"&i=tt3766394");

            Assert.IsTrue(movieDetails.Result.Title != null);
        }