Ejemplo n.º 1
0
        static async void getDetails()
        {
            Console.WriteLine("Enter Imdb Id");
            var Id            = Console.ReadLine();
            var moviedBuilder = OmdbIdRequestBuilder.Get(Id);
            var movie         = await moviedBuilder.MakeRequest();

            Console.WriteLine(movie.Title);
            Console.WriteLine(movie.Year);
            Console.WriteLine(movie.Rated);
            Console.WriteLine(movie.Released);
            Console.WriteLine(movie.RunTime);
            Console.WriteLine(movie.Genre);
            Console.WriteLine(movie.Director);
            Console.WriteLine(movie.Writer);
            Console.WriteLine(movie.Actors);
            Console.WriteLine(movie.Plot);
            Console.WriteLine(movie.Language);
            Console.WriteLine(movie.Country);
            Console.WriteLine(movie.Awards);
            Console.WriteLine(movie.Poster);
            Console.WriteLine(movie.imdbRating);
            Console.WriteLine(movie.imdbVotes);
            Console.WriteLine(movie.imdbID);
            Console.WriteLine(movie.Type);
            Console.WriteLine(movie.BoxOffice);
        }
Ejemplo n.º 2
0
        public void SearchWithTomatoesExpectPropertyNotNull()
        {
            var target   = OmdbIdRequestBuilder.Get("tt0120737");
            var response = target.WithTomatoes().MakeRequest();

            var result = Task.Run(() => response).Result;

            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Ratings);
            MovieAssert.AssertMovieProperties(result);
            MovieAssert.AssertTomoatoesProperties(result.Ratings);
        }
Ejemplo n.º 3
0
        public void SearchWithJustIdExpectResult()
        {
            var target   = OmdbIdRequestBuilder.Get("tt0120737");
            var response = target.MakeRequest();

            var result = Task.Run(() => response).Result;

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Title.ToLower().Contains("lord"));
            MovieAssert.AssertMovieProperties(result);
            //when "Tomatoes" option is no used then the property is null
            Assert.IsNull(result.Ratings);
        }
Ejemplo n.º 4
0
        public void FullPlotShouldContainMoreContentThanShort()
        {
            var shortTarget = OmdbIdRequestBuilder.Get("tt0120737");
            var fullTarget  = OmdbIdRequestBuilder.Get("tt0120737");

            var shortResponse = shortTarget.WithPlotLength(PlotLenthType.Short).MakeRequest();
            var fullResponse  = fullTarget.WithPlotLength(PlotLenthType.Full).MakeRequest();

            var shortResult = Task.Run(() => shortResponse).Result;
            var fullResult  = Task.Run(() => fullResponse).Result;

            Assert.IsNotNull(fullResult);
            Assert.IsNotNull(shortResult);
            Assert.IsTrue(shortResult.Plot.Length < fullResult.Plot.Length);
        }