Example #1
0
        public void TestMoviesGetMovieCasts()
        {
            Credits resp = Config.Client.GetMovieCreditsAsync(IdHelper.AGoodDayToDieHard).Result;

            Assert.NotNull(resp);

            Cast cast = resp.Cast.SingleOrDefault(s => s.Name == "Bruce Willis");

            Assert.NotNull(cast);

            Assert.Equal(1, cast.CastId);
            Assert.Equal("John McClane", cast.Character);
            Assert.Equal("52fe4751c3a36847f812f049", cast.CreditId);
            Assert.Equal(62, cast.Id);
            Assert.Equal("Bruce Willis", cast.Name);
            Assert.Equal(0, cast.Order);
            Assert.True(TestImagesHelpers.TestImagePath(cast.ProfilePath), "cast.ProfilePath was not a valid image path, was: " + cast.ProfilePath);

            Crew crew = resp.Crew.SingleOrDefault(s => s.Name == "Marco Beltrami");

            Assert.NotNull(crew);

            Assert.Equal("5336b0e09251417d9b000cc7", crew.CreditId);
            Assert.Equal("Sound", crew.Department);
            Assert.Equal(7229, crew.Id);
            Assert.Equal("Music", crew.Job);
            Assert.Equal("Marco Beltrami", crew.Name);
            Assert.True(TestImagesHelpers.TestImagePath(crew.ProfilePath), "crew.ProfilePath was not a valid image path, was: " + crew.ProfilePath);
        }
Example #2
0
        public void TestMoviesGetMovieImages()
        {
            ImagesWithId resp = Config.Client.GetMovieImagesAsync(IdHelper.AGoodDayToDieHard).Result;

            Assert.NotNull(resp);

            ImageData backdrop = resp.Backdrops.SingleOrDefault(s => s.FilePath == "/17zArExB7ztm6fjUXZwQWgGMC9f.jpg");

            Assert.NotNull(backdrop);

            Assert.True(Math.Abs(1.77777777777778 - backdrop.AspectRatio) < double.Epsilon);
            Assert.True(TestImagesHelpers.TestImagePath(backdrop.FilePath), "backdrop.FilePath was not a valid image path, was: " + backdrop.FilePath);
            Assert.Equal(1080, backdrop.Height);
            Assert.Equal("xx", backdrop.Iso_639_1);
            Assert.True(backdrop.VoteAverage > 0);
            Assert.True(backdrop.VoteCount > 0);
            Assert.Equal(1920, backdrop.Width);

            ImageData poster = resp.Posters.SingleOrDefault(s => s.FilePath == "/c2SQMd00CCGTiDxGXVqA2J9lmzF.jpg");

            Assert.NotNull(poster);

            Assert.True(Math.Abs(0.666666666666667 - poster.AspectRatio) < double.Epsilon);
            Assert.True(TestImagesHelpers.TestImagePath(poster.FilePath), "poster.FilePath was not a valid image path, was: " + poster.FilePath);
            Assert.Equal(1500, poster.Height);
            Assert.Equal("en", poster.Iso_639_1);
            Assert.True(poster.VoteAverage > 0);
            Assert.True(poster.VoteCount > 0);
            Assert.Equal(1000, poster.Width);
        }
Example #3
0
        public void TestSearchMulti()
        {
            TestHelpers.SearchPages(i => Config.Client.SearchMultiAsync("Arrow", i).Result);

            SearchContainer <SearchBase> result = Config.Client.SearchMultiAsync("Arrow").Result;

            Assert.True(result.Results.Any());
            SearchTv item = result.Results.OfType <SearchTv>().SingleOrDefault(s => s.Id == 1412);

            Assert.NotNull(item);
            Assert.Equal(1412, item.Id);
            Assert.True(TestImagesHelpers.TestImagePath(item.BackdropPath), "item.BackdropPath was not a valid image path, was: " + item.BackdropPath);
            Assert.Equal(new DateTime(2012, 10, 10), item.FirstAirDate);
            Assert.Equal(MediaType.Tv, item.MediaType);
            Assert.Equal("Arrow", item.Name);
            Assert.Equal("Arrow", item.OriginalName);
            Assert.True(TestImagesHelpers.TestImagePath(item.PosterPath), "item.PosterPath was not a valid image path, was: " + item.PosterPath);
            Assert.True(item.Popularity > 0);
            Assert.True(item.VoteAverage > 0);
            Assert.True(item.VoteCount > 0);

            Assert.NotNull(item.OriginCountry);
            Assert.Equal(2, item.OriginCountry.Count);
            Assert.True(item.OriginCountry.Contains("US"));
            Assert.True(item.OriginCountry.Contains("CA"));
        }
Example #4
0
        public void TestPersonsGetPersonMovieCredits()
        {
            MovieCredits item = Config.Client.GetPersonMovieCreditsAsync(IdHelper.BruceWillis).Result;

            Assert.NotNull(item);
            Assert.NotNull(item.Cast);
            Assert.NotNull(item.Crew);

            Assert.Equal(IdHelper.BruceWillis, item.Id);

            MovieRole cast = item.Cast.SingleOrDefault(s => s.CreditId == "52fe4329c3a36847f803f193");

            Assert.NotNull(cast);
            Assert.Equal(false, cast.Adult);
            Assert.Equal("Lieutenant Muldoon", cast.Character);
            Assert.Equal("52fe4329c3a36847f803f193", cast.CreditId);
            Assert.Equal(1992, cast.Id);
            Assert.Equal("Planet Terror", cast.OriginalTitle);
            Assert.True(TestImagesHelpers.TestImagePath(cast.PosterPath), "cast.PosterPath was not a valid image path, was: " + cast.PosterPath);
            Assert.Equal(new DateTime(2007, 4, 6), cast.ReleaseDate);
            Assert.Equal("Planet Terror", cast.Title);

            MovieJob job = item.Crew.SingleOrDefault(s => s.CreditId == "52fe432ec3a36847f8040603");

            Assert.NotNull(job);
            Assert.Equal(false, job.Adult);
            Assert.Equal("52fe432ec3a36847f8040603", job.CreditId);
            Assert.Equal("Production", job.Department);
            Assert.Equal(2026, job.Id);
            Assert.Equal("Producer", job.Job);
            Assert.Equal(new DateTime(2005, 3, 9), job.ReleaseDate);
            Assert.True(TestImagesHelpers.TestImagePath(job.PosterPath), "job.PosterPath was not a valid image path, was: " + job.PosterPath);
            Assert.Equal("Hostage", job.Title);
            Assert.Equal("Hostage", job.OriginalTitle);
        }
Example #5
0
        public void TestSearchMovie()
        {
            TestHelpers.SearchPages(i => Config.Client.SearchMovieAsync("007", i).Result);

            // Search pr. Year
            // 1962: First James Bond movie, "Dr. No"
            SearchContainer <SearchMovie> result = Config.Client.SearchMovieAsync("007", year: 1962).Result;

            Assert.True(result.Results.Any());
            SearchMovie item = result.Results.SingleOrDefault(s => s.Id == 646);

            Assert.NotNull(item);
            Assert.Equal(646, item.Id);
            Assert.Equal(false, item.Adult);
            Assert.True(TestImagesHelpers.TestImagePath(item.BackdropPath), "item.BackdropPath was not a valid image path, was: " + item.BackdropPath);
            Assert.Equal("en", item.OriginalLanguage);
            Assert.Equal("Dr. No", item.OriginalTitle);
            Assert.Equal("In the film that launched the James Bond saga, Agent 007 (Sean Connery) battles mysterious Dr. No, a scientific genius bent on destroying the U.S. space program. As the countdown to disaster begins, Bond must go to Jamaica, where he encounters beautiful Honey Ryder (Ursula Andress), to confront a megalomaniacal villain in his massive island headquarters.", item.Overview);
            Assert.Equal(false, item.Video);
            Assert.True(TestImagesHelpers.TestImagePath(item.PosterPath), "item.PosterPath was not a valid image path, was: " + item.PosterPath);
            Assert.Equal(new DateTime(1962, 10, 4), item.ReleaseDate);
            Assert.Equal("Dr. No", item.Title);
            Assert.True(item.Popularity > 0);
            Assert.True(item.VoteAverage > 0);
            Assert.True(item.VoteCount > 0);

            Assert.NotNull(item.GenreIds);
            Assert.True(item.GenreIds.Contains(12));
            Assert.True(item.GenreIds.Contains(28));
            Assert.True(item.GenreIds.Contains(53));
        }
Example #6
0
        public void TestPersonsGet()
        {
            IgnoreMissingJson(" / changes", " / external_ids", " / images", " / movie_credits", " / tagged_images", " / tv_credits");

            Person item = Config.Client.GetPersonAsync(IdHelper.BruceWillis).Result;

            Assert.NotNull(item);
            Assert.Equal(false, item.Adult);
            Assert.NotNull(item.Biography);
            Assert.Equal(PersonGender.Male, item.Gender);
            Assert.Equal(new DateTime(1955, 3, 19), item.Birthday);
            Assert.False(item.Deathday.HasValue);
            Assert.Equal("http://www.b-willis.com/", item.Homepage);
            Assert.Equal(62, item.Id);
            Assert.Equal("nm0000246", item.ImdbId);
            Assert.Equal("Bruce Willis", item.Name);
            Assert.Equal("Idar-Oberstein, Germany", item.PlaceOfBirth);
            Assert.True(item.Popularity > 0);
            Assert.True(TestImagesHelpers.TestImagePath(item.ProfilePath), "item.ProfilePath was not a valid image path, was: " + item.ProfilePath);

            Assert.NotNull(item.AlsoKnownAs);
            Assert.Equal(2, item.AlsoKnownAs.Count);
            Assert.True(item.AlsoKnownAs.Contains("Брюс Уиллис"));
            Assert.True(item.AlsoKnownAs.Contains("브루스 윌리스"));
        }
Example #7
0
        public void TestPersonsImages()
        {
            // Get config
            Config.Client.GetConfigAsync().Sync();

            // Get images
            ProfileImages images = Config.Client.GetPersonImagesAsync(IdHelper.BruceWillis).Result;

            Assert.NotNull(images);
            Assert.NotNull(images.Profiles);
            Assert.Equal(IdHelper.BruceWillis, images.Id);

            // Test image url generator
            TestImagesHelpers.TestImages(Config, images);

            ImageData image = images.Profiles.SingleOrDefault(s => s.FilePath == "/kI1OluWhLJk3pnR19VjOfABpnTY.jpg");

            Assert.NotNull(image);
            Assert.True(Math.Abs(0.666666666666667 - image.AspectRatio) < double.Epsilon);
            Assert.True(TestImagesHelpers.TestImagePath(image.FilePath), "image.FilePath was not a valid image path, was: " + image.FilePath);
            Assert.Equal(1500, image.Height);
            Assert.Null(image.Iso_639_1);
            Assert.Equal(1000, image.Width);
            Assert.True(image.VoteAverage > 0);
            Assert.True(image.VoteCount > 0);
        }
Example #8
0
        public void TestPersonsGetPersonTvCredits()
        {
            TvCredits item = Config.Client.GetPersonTvCreditsAsync(IdHelper.BruceWillis).Result;

            Assert.NotNull(item);
            Assert.NotNull(item.Cast);
            Assert.NotNull(item.Crew);

            Assert.Equal(IdHelper.BruceWillis, item.Id);

            TvRole cast = item.Cast.SingleOrDefault(s => s.Character == "David Addison Jr.");

            Assert.NotNull(cast);
            Assert.Equal("David Addison Jr.", cast.Character);
            Assert.Equal("52571e7f19c2957114107d48", cast.CreditId);
            Assert.Equal(71, cast.EpisodeCount);
            Assert.Equal(new DateTime(1985, 3, 3), cast.FirstAirDate);
            Assert.Equal(1998, cast.Id);
            Assert.Equal("Moonlighting", cast.Name);
            Assert.Equal("Moonlighting", cast.OriginalName);
            Assert.True(TestImagesHelpers.TestImagePath(cast.PosterPath), "cast.PosterPath was not a valid image path, was: " + cast.PosterPath);

            TvJob job = item.Crew.SingleOrDefault(s => s.CreditId == "525826eb760ee36aaa81b23b");

            Assert.NotNull(job);
            Assert.Equal("525826eb760ee36aaa81b23b", job.CreditId);
            Assert.Equal("Production", job.Department);
            Assert.Equal(37, job.EpisodeCount);
            Assert.Equal(new DateTime(1996, 9, 23), job.FirstAirDate);
            Assert.Equal(13297, job.Id);
            Assert.Equal("Producer", job.Job);
            Assert.Equal("Bruno the Kid", job.Name);
            Assert.Equal("Bruno the Kid", job.OriginalName);
            Assert.True(TestImagesHelpers.TestImagePath(job.PosterPath), "job.PosterPath was not a valid image path, was: " + job.PosterPath);
        }
Example #9
0
        public void TestTvShowSimilars()
        {
            SearchContainer <SearchTv> tvShow = _config.Client.GetTvShowSimilarAsync(1668).Result;

            Assert.IsNotNull(tvShow);
            Assert.IsNotNull(tvShow.Results);

            SearchTv item = tvShow.Results.SingleOrDefault(s => s.Id == 1100);

            Assert.IsNotNull(item);

            Assert.IsTrue(TestImagesHelpers.TestImagePath(item.BackdropPath), "item.BackdropPath was not a valid image path, was: " + item.BackdropPath);
            Assert.AreEqual(1100, item.Id);
            Assert.AreEqual("How I Met Your Mother", item.OriginalName);
            Assert.AreEqual(new DateTime(2005, 09, 19), item.FirstAirDate);
            Assert.IsTrue(TestImagesHelpers.TestImagePath(item.PosterPath), "item.PosterPath was not a valid image path, was: " + item.PosterPath);
            Assert.IsTrue(item.Popularity > 0);
            Assert.AreEqual("How I Met Your Mother", item.Name);
            Assert.IsTrue(item.VoteAverage > 0);
            Assert.IsTrue(item.VoteCount > 0);

            Assert.IsNotNull(item.OriginCountry);
            Assert.AreEqual(1, item.OriginCountry.Count);
            Assert.IsTrue(item.OriginCountry.Contains("US"));
        }
Example #10
0
        public void TestSearchMovie()
        {
            TestHelpers.SearchPages(i => _config.Client.SearchMovieAsync("007", i).Result);

            // Search pr. Year
            // 1962: First James Bond movie, "Dr. No"
            SearchContainer <SearchMovie> result = _config.Client.SearchMovieAsync("007", year: 1962).Result;

            Assert.IsTrue(result.Results.Any());
            SearchMovie item = result.Results.SingleOrDefault(s => s.Id == 646);

            Assert.IsNotNull(item);
            Assert.AreEqual(646, item.Id);
            Assert.AreEqual(false, item.Adult);
            Assert.IsTrue(TestImagesHelpers.TestImagePath(item.BackdropPath), "item.BackdropPath was not a valid image path, was: " + item.BackdropPath);
            Assert.AreEqual("en", item.OriginalLanguage);
            Assert.AreEqual("Dr. No", item.OriginalTitle);
            Assert.AreEqual("When Strangways, the British SIS Station Chief in Jamaica goes missing, MI6 send James Bond - Agent 007 to investigate. His investigation leads him to the mysterious Crab Key; the secret base of Dr No who he suspects is trying to sabotage the American space program using a radio beam. With the assistance of local fisherman Quarrel, who had been helping Strangways, Bond sneaks onto Crab Key where he meets the beautiful Honey Ryder. Can the three of them defeat an army of henchmen and a \"fire breathing dragon\" in order to stop Dr No, save the space program and get revenge for Strangways? Dr. No is the first film of legendary James Bond series starring Sean Connery in the role of Fleming's British super agent.", item.Overview);
            Assert.AreEqual(false, item.Video);
            Assert.IsTrue(TestImagesHelpers.TestImagePath(item.PosterPath), "item.PosterPath was not a valid image path, was: " + item.PosterPath);
            Assert.AreEqual(new DateTime(1962, 10, 4), item.ReleaseDate);
            Assert.AreEqual("Dr. No", item.Title);
            Assert.IsTrue(item.Popularity > 0);
            Assert.IsTrue(item.VoteAverage > 0);
            Assert.IsTrue(item.VoteCount > 0);

            Assert.IsNotNull(item.GenreIds);
            Assert.IsTrue(item.GenreIds.Contains(12));
            Assert.IsTrue(item.GenreIds.Contains(28));
            Assert.IsTrue(item.GenreIds.Contains(53));
        }
Example #11
0
        public void TestTvShowRecommendations()
        {
            // Ignore missing json
            IgnoreMissingJson("results[array] / media_type");

            SearchContainer <SearchTv> tvShow = Config.Client.GetTvShowRecommendationsAsync(1668).Result;

            Assert.NotNull(tvShow);
            Assert.NotNull(tvShow.Results);

            SearchTv item = tvShow.Results.SingleOrDefault(s => s.Id == 1100);

            Assert.NotNull(item);

            Assert.True(TestImagesHelpers.TestImagePath(item.BackdropPath), "item.BackdropPath was not a valid image path, was: " + item.BackdropPath);
            Assert.Equal(1100, item.Id);
            Assert.Equal("How I Met Your Mother", item.OriginalName);
            Assert.Equal(new DateTime(2005, 09, 19), item.FirstAirDate);
            Assert.True(TestImagesHelpers.TestImagePath(item.PosterPath), "item.PosterPath was not a valid image path, was: " + item.PosterPath);
            Assert.True(item.Popularity > 0);
            Assert.Equal("How I Met Your Mother", item.Name);
            Assert.True(item.VoteAverage > 0);
            Assert.True(item.VoteCount > 0);

            Assert.NotNull(item.OriginCountry);
            Assert.Equal(1, item.OriginCountry.Count);
            Assert.True(item.OriginCountry.Contains("US"));
        }
Example #12
0
        public void TestSearchTvShow()
        {
            TestHelpers.SearchPages(i => Config.Client.SearchTvShowAsync("Breaking Bad", i).Result);

            SearchContainer <SearchTv> result = Config.Client.SearchTvShowAsync("Breaking Bad").Result;

            Assert.True(result.Results.Any());
            SearchTv item = result.Results.SingleOrDefault(s => s.Id == 1396);

            Assert.NotNull(item);
            Assert.Equal(1396, item.Id);
            Assert.True(TestImagesHelpers.TestImagePath(item.BackdropPath), "item.BackdropPath was not a valid image path, was: " + item.BackdropPath);
            Assert.Equal(new DateTime(2008, 1, 19), item.FirstAirDate);
            Assert.Equal("Breaking Bad", item.Name);
            Assert.Equal("Breaking Bad", item.OriginalName);
            Assert.Equal("en", item.OriginalLanguage);
            Assert.True(TestImagesHelpers.TestImagePath(item.PosterPath), "item.PosterPath was not a valid image path, was: " + item.PosterPath);
            Assert.Equal("Breaking Bad is an American crime drama television series created and produced by Vince Gilligan. Set and produced in Albuquerque, New Mexico, Breaking Bad is the story of Walter White, a struggling high school chemistry teacher who is diagnosed with inoperable lung cancer at the beginning of the series. He turns to a life of crime, producing and selling methamphetamine, in order to secure his family's financial future before he dies, teaming with his former student, Jesse Pinkman. Heavily serialized, the series is known for positioning its characters in seemingly inextricable corners and has been labeled a contemporary western by its creator.", item.Overview);
            Assert.True(item.Popularity > 0);
            Assert.True(item.VoteAverage > 0);
            Assert.True(item.VoteCount > 0);

            Assert.NotNull(item.GenreIds);
            Assert.Equal(1, item.GenreIds.Count);
            Assert.Equal(18, item.GenreIds[0]);

            Assert.NotNull(item.OriginCountry);
            Assert.Equal(1, item.OriginCountry.Count);
            Assert.Equal("US", item.OriginCountry[0]);
        }
Example #13
0
        public void TestPersonsTaggedImages()
        {
            // Get config
            Config.Client.GetConfigAsync().Sync();

            // Get images
            TestHelpers.SearchPages(i => Config.Client.GetPersonTaggedImagesAsync(IdHelper.BruceWillis, i).Result);

            SearchContainer <TaggedImage> images = Config.Client.GetPersonTaggedImagesAsync(IdHelper.BruceWillis, 1).Result;

            Assert.NotNull(images);
            Assert.NotNull(images.Results);

            TaggedImage image = images.Results.SingleOrDefault(s => s.FilePath == "/my81Hjt7NpZhaMX9bHi4wVhFy0v.jpg");

            Assert.NotNull(image);
            Assert.True(Math.Abs(1.77777777777778 - image.AspectRatio) < double.Epsilon);
            Assert.True(TestImagesHelpers.TestImagePath(image.FilePath), "image.FilePath was not a valid image path, was: " + image.FilePath);
            Assert.Equal(1080, image.Height);
            Assert.Equal("4ea5d0792c058837cb000431", image.Id);
            Assert.Null(image.Iso_639_1);
            Assert.True(image.VoteAverage > 0);
            Assert.True(image.VoteCount > 0);
            Assert.Equal(1920, image.Width);
            Assert.Equal("backdrop", image.ImageType);
            Assert.Equal(MediaType.Movie, image.MediaType);

            Assert.NotNull(image.Media);
            Assert.IsType <SearchMovie>(image.Media);

            SearchMovie mediaBase = (SearchMovie)image.Media;

            Assert.Equal(false, mediaBase.Adult);
            Assert.True(TestImagesHelpers.TestImagePath(mediaBase.BackdropPath), "image.Media.BackdropPath was not a valid image path, was: " + mediaBase.BackdropPath);
            Assert.Equal(187, mediaBase.Id);
            Assert.Equal("en", mediaBase.OriginalLanguage);
            Assert.Equal("Sin City", mediaBase.OriginalTitle);
            Assert.Equal("Welcome to Sin City. This town beckons to the tough, the corrupt, the brokenhearted. Some call it dark… Hard-boiled. Then there are those who call it home — Crooked cops, sexy dames, desperate vigilantes. Some are seeking revenge, others lust after redemption, and then there are those hoping for a little of both. A universe of unlikely and reluctant heroes still trying to do the right thing in a city that refuses to care.", mediaBase.Overview);
            Assert.Equal(new DateTime(2005, 3, 31), mediaBase.ReleaseDate);
            Assert.True(TestImagesHelpers.TestImagePath(mediaBase.PosterPath), "image.Media.PosterPath was not a valid image path, was: " + mediaBase.PosterPath);
            Assert.True(mediaBase.Popularity > 0);
            Assert.Equal("Sin City", mediaBase.Title);
            Assert.Equal(false, mediaBase.Video);
            Assert.True(mediaBase.VoteAverage > 0);
            Assert.True(mediaBase.VoteCount > 0);

            Assert.NotNull(mediaBase.GenreIds);
            Assert.Equal(3, mediaBase.GenreIds.Count);
            Assert.True(mediaBase.GenreIds.Contains(28));
            Assert.True(mediaBase.GenreIds.Contains(53));
            Assert.True(mediaBase.GenreIds.Contains(80));
        }
Example #14
0
        public void TestSearchCompany()
        {
            TestHelpers.SearchPages(i => Config.Client.SearchCompanyAsync("20th", i).Result);

            SearchContainer <SearchCompany> result = Config.Client.SearchCompanyAsync("20th").Result;

            Assert.True(result.Results.Any());
            SearchCompany item = result.Results.SingleOrDefault(s => s.Id == 25);

            Assert.NotNull(item);
            Assert.Equal(25, item.Id);
            Assert.True(TestImagesHelpers.TestImagePath(item.LogoPath), "item.LogoPath was not a valid image path, was: " + item.LogoPath);
            Assert.Equal("20th Century Fox", item.Name);
        }
Example #15
0
        public void TestMoviesGet()
        {
            IgnoreMissingJson(" / account_states", " / alternative_titles", " / changes", " / credits", " / images", " / keywords", " / lists", " / release_dates", " / releases", " / reviews", " / similar", " / translations", " / videos", " / recommendations");

            Movie item = Config.Client.GetMovieAsync(IdHelper.AGoodDayToDieHard).Result;

            Assert.NotNull(item);
            Assert.Equal(IdHelper.AGoodDayToDieHard, item.Id);
            Assert.Equal(IdHelper.AGoodDayToDieHardImdb, item.ImdbId);

            // Check all properties
            Assert.Equal("A Good Day to Die Hard", item.Title);
            Assert.Equal("A Good Day to Die Hard", item.OriginalTitle);
            Assert.Equal("en", item.OriginalLanguage);

            Assert.Equal("Released", item.Status);
            Assert.Equal("Yippee Ki-Yay Mother Russia", item.Tagline);
            Assert.Equal("Iconoclastic, take-no-prisoners cop John McClane, finds himself for the first time on foreign soil after traveling to Moscow to help his wayward son Jack - unaware that Jack is really a highly-trained CIA operative out to stop a nuclear weapons heist. With the Russian underworld in pursuit, and battling a countdown to war, the two McClanes discover that their opposing methods make them unstoppable heroes.", item.Overview);
            Assert.Equal("http://www.diehardmovie.com/", item.Homepage);

            Assert.True(TestImagesHelpers.TestImagePath(item.BackdropPath), "item.BackdropPath was not a valid image path, was: " + item.BackdropPath);
            Assert.True(TestImagesHelpers.TestImagePath(item.PosterPath), "item.PosterPath was not a valid image path, was: " + item.PosterPath);

            Assert.Equal(false, item.Adult);
            Assert.Equal(false, item.Video);

            Assert.NotNull(item.BelongsToCollection);
            Assert.Equal(1570, item.BelongsToCollection.Id);
            Assert.Equal("Die Hard Collection", item.BelongsToCollection.Name);
            Assert.True(TestImagesHelpers.TestImagePath(item.BelongsToCollection.BackdropPath), "item.BelongsToCollection.BackdropPath was not a valid image path, was: " + item.BelongsToCollection.BackdropPath);
            Assert.True(TestImagesHelpers.TestImagePath(item.BelongsToCollection.PosterPath), "item.BelongsToCollection.PosterPath was not a valid image path, was: " + item.BelongsToCollection.PosterPath);

            //Assert.Equal(1, item.BelongsToCollection.Count);
            //Assert.Equal(1570, item.BelongsToCollection[0].Id);
            //Assert.Equal("Die Hard Collection", item.BelongsToCollection[0].Name);
            //Assert.True(TestImagesHelpers.TestImagePath(item.BelongsToCollection[0].BackdropPath), "item.BelongsToCollection[0].BackdropPath was not a valid image path, was: " + item.BelongsToCollection[0].BackdropPath);
            //Assert.True(TestImagesHelpers.TestImagePath(item.BelongsToCollection[0].PosterPath), "item.BelongsToCollection[0].PosterPath was not a valid image path, was: " + item.BelongsToCollection[0].PosterPath);

            Assert.Equal(2, item.Genres.Count);
            Assert.Equal(28, item.Genres[0].Id);
            Assert.Equal("Action", item.Genres[0].Name);
            Assert.Equal(53, item.Genres[1].Id);
            Assert.Equal("Thriller", item.Genres[1].Name);

            Assert.True(item.ReleaseDate > new DateTime(2013, 01, 01));
            Assert.Equal(304654182, item.Revenue);
            Assert.Equal(92000000, item.Budget);
            Assert.Equal(98, item.Runtime);
        }
Example #16
0
        public void TestSearchCollection()
        {
            TestHelpers.SearchPages(i => Config.Client.SearchCollectionAsync("007", i).Result);

            SearchContainer <SearchCollection> result = Config.Client.SearchCollectionAsync("James Bond").Result;

            Assert.True(result.Results.Any());
            SearchCollection item = result.Results.SingleOrDefault(s => s.Id == 645);

            Assert.NotNull(item);
            Assert.Equal(645, item.Id);
            Assert.Equal("James Bond Collection", item.Name);
            Assert.True(TestImagesHelpers.TestImagePath(item.BackdropPath), "item.BackdropPath was not a valid image path, was: " + item.BackdropPath);
            Assert.True(TestImagesHelpers.TestImagePath(item.PosterPath), "item.PosterPath was not a valid image path, was: " + item.PosterPath);
        }
Example #17
0
        public void TestPersonsTaggedImages()
        {
            // Get config
            _config.Client.GetConfig();

            // Get images
            TestHelpers.SearchPages(i => _config.Client.GetPersonTaggedImagesAsync(IdHelper.BruceWillis, i).Result);

            SearchContainer <TaggedImage> images = _config.Client.GetPersonTaggedImagesAsync(IdHelper.BruceWillis, 1).Result;

            Assert.IsNotNull(images);
            Assert.IsNotNull(images.Results);

            TaggedImage image = images.Results.SingleOrDefault(s => s.FilePath == "/my81Hjt7NpZhaMX9bHi4wVhFy0v.jpg");

            Assert.IsNotNull(image);
            Assert.IsTrue(Math.Abs(1.77777777777778 - image.AspectRatio) < double.Epsilon);
            Assert.IsTrue(TestImagesHelpers.TestImagePath(image.FilePath), "image.FilePath was not a valid image path, was: " + image.FilePath);
            Assert.AreEqual(1080, image.Height);
            Assert.AreEqual("4ea5d0792c058837cb000431", image.Id);
            Assert.IsNull(image.Iso_639_1);
            Assert.IsTrue(image.VoteAverage > 0);
            Assert.IsTrue(image.VoteCount > 0);
            Assert.AreEqual(1920, image.Width);
            Assert.AreEqual("backdrop", image.ImageType);
            Assert.AreEqual(MediaType.Movie, image.MediaType);

            Assert.IsNotNull(image.Media);
            Assert.AreEqual(false, image.Media.Adult);
            Assert.IsTrue(TestImagesHelpers.TestImagePath(image.Media.BackdropPath), "image.Media.BackdropPath was not a valid image path, was: " + image.Media.BackdropPath);
            Assert.AreEqual(187, image.Media.Id);
            Assert.AreEqual("en", image.Media.OriginalLanguage);
            Assert.AreEqual("Sin City", image.Media.OriginalTitle);
            Assert.AreEqual("Sin City is a neo-noir crime thriller based on Frank Miller's graphic novel series of the same name.The film is primarily based on three of Miller's works: The Hard Goodbye, about a man who embarks on a brutal rampage in search of his one-time sweetheart's killer; The Big Fat Kill, which focuses on a street war between a group of prostitutes and a group of mercenaries; and That Yellow Bastard, which follows an aging police officer who protects a young woman from a grotesquely disfigured serial killer.", image.Media.Overview);
            Assert.AreEqual(new DateTime(2005, 3, 31), image.Media.ReleaseDate);
            Assert.IsTrue(TestImagesHelpers.TestImagePath(image.Media.PosterPath), "image.Media.PosterPath was not a valid image path, was: " + image.Media.PosterPath);
            Assert.IsTrue(image.Media.Popularity > 0);
            Assert.AreEqual("Sin City", image.Media.Title);
            Assert.AreEqual(false, image.Media.Video);
            Assert.IsTrue(image.Media.VoteAverage > 0);
            Assert.IsTrue(image.Media.VoteCount > 0);

            Assert.IsNotNull(image.Media.GenreIds);
            Assert.AreEqual(3, image.Media.GenreIds.Count);
            Assert.IsTrue(image.Media.GenreIds.Contains(28));
            Assert.IsTrue(image.Media.GenreIds.Contains(53));
            Assert.IsTrue(image.Media.GenreIds.Contains(80));
        }
Example #18
0
        public void TestGetCreditSeasons()
        {
            Credit result = Config.Client.GetCreditsAsync(IdHelper.HughLaurieHouse).Result;

            Assert.NotNull(result);
            Assert.NotNull(result.Media);
            Assert.NotNull(result.Media.Seasons);

            CreditSeason item = result.Media.Seasons.SingleOrDefault(s => s.SeasonNumber == 1);

            Assert.NotNull(item);

            Assert.Equal(new DateTime(2004, 11, 16), item.AirDate);
            Assert.True(TestImagesHelpers.TestImagePath(item.PosterPath), "item.PosterPath was not a valid image path, was: " + item.PosterPath);
            Assert.Equal(1, item.SeasonNumber);
        }
Example #19
0
        public void TestSearchPerson()
        {
            TestHelpers.SearchPages(i => Config.Client.SearchPersonAsync("Willis", i).Result);

            SearchContainer <SearchPerson> result = Config.Client.SearchPersonAsync("Willis").Result;

            Assert.True(result.Results.Any());
            SearchPerson item = result.Results.SingleOrDefault(s => s.Id == 62);

            Assert.NotNull(item);
            Assert.Equal(62, item.Id);
            Assert.Equal("Bruce Willis", item.Name);
            Assert.True(TestImagesHelpers.TestImagePath(item.ProfilePath), "item.ProfilePath was not a valid image path, was: " + item.ProfilePath);
            Assert.Equal(false, item.Adult);
            Assert.True(item.Popularity > 0);

            Assert.NotNull(item.KnownFor);
            Assert.True(item.KnownFor.Any(s => s.Id == 680));
        }
Example #20
0
        public void TestGetCreditEpisode()
        {
            Credit result = Config.Client.GetCreditsAsync(IdHelper.BruceWillisMiamiVice).Result;

            Assert.NotNull(result);
            Assert.NotNull(result.Media);
            Assert.NotNull(result.Media.Episodes);

            CreditEpisode item = result.Media.Episodes.SingleOrDefault(s => s.Name == "No Exit");

            Assert.NotNull(item);

            Assert.Equal(new DateTime(1984, 11, 9), item.AirDate);
            Assert.Equal(8, item.EpisodeNumber);
            Assert.Equal("No Exit", item.Name);
            Assert.Equal("Crockett attempts to help an old flame free herself from a racketeer, then is framed for taking bribes. Martin Castillo becomes the squad's new Lieutenant.", item.Overview);
            Assert.Equal(1, item.SeasonNumber);
            Assert.True(TestImagesHelpers.TestImagePath(item.StillPath), "item.StillPath was not a valid image path, was: " + item.StillPath);
        }
Example #21
0
        public void TestSearchList()
        {
            TestHelpers.SearchPages(i => Config.Client.SearchListAsync("to watch", i).Result);

            SearchContainer <SearchList> result = Config.Client.SearchListAsync("to watch").Result;

            Assert.True(result.Results.Any());
            SearchList item = result.Results.SingleOrDefault(s => s.Id == "54a5c0ceaed56c28c300013a");

            Assert.NotNull(item);
            Assert.Equal("to watch", item.Description);
            Assert.Equal("54a5c0ceaed56c28c300013a", item.Id);
            Assert.Equal("en", item.Iso_639_1);
            Assert.Equal("movie", item.ListType);
            Assert.Equal("Movies", item.Name);
            Assert.True(TestImagesHelpers.TestImagePath(item.PosterPath), "item.PosterPath was not a valid image path, was: " + item.PosterPath);
            Assert.True(item.FavoriteCount > 0);
            Assert.True(item.ItemCount > 0);
        }
Example #22
0
        public void TestPersonsGet()
        {
            Person item = _config.Client.GetPersonAsync(IdHelper.BruceWillis).Result;

            Assert.IsNotNull(item);
            Assert.AreEqual(false, item.Adult);
            Assert.IsNotNull(item.Biography);
            Assert.AreEqual(new DateTime(1955, 3, 19), item.Birthday);
            Assert.IsFalse(item.Deathday.HasValue);
            Assert.AreEqual("http://www.b-willis.com/", item.Homepage);
            Assert.AreEqual(62, item.Id);
            Assert.AreEqual("nm0000246", item.ImdbId);
            Assert.AreEqual("Bruce Willis", item.Name);
            Assert.AreEqual("Idar-Oberstein, Germany", item.PlaceOfBirth);
            Assert.IsTrue(item.Popularity > 0);
            Assert.IsTrue(TestImagesHelpers.TestImagePath(item.ProfilePath), "item.ProfilePath was not a valid image path, was: " + item.ProfilePath);

            Assert.IsNotNull(item.AlsoKnownAs);
            Assert.AreEqual(2, item.AlsoKnownAs.Count);
            Assert.IsTrue(item.AlsoKnownAs.Contains("Брюс Уиллис"));
            Assert.IsTrue(item.AlsoKnownAs.Contains("브루스 윌리스"));
        }
        private void TestBreakingBadSeasonOneEpisodeOneBaseProperties(TvEpisode tvEpisode)
        {
            Assert.Equal(62085, tvEpisode.Id);
            Assert.True(tvEpisode.AirDate.HasValue);
            Assert.Equal(new DateTime(2008, 1, 19), tvEpisode.AirDate.Value.Date);
            Assert.Equal(1, tvEpisode.EpisodeNumber);
            Assert.Equal("Pilot", tvEpisode.Name);
            Assert.NotNull(tvEpisode.Overview);
            Assert.Null(tvEpisode.ProductionCode);
            Assert.Equal(1, tvEpisode.SeasonNumber);
            Assert.NotNull(tvEpisode.StillPath);

            Assert.NotNull(tvEpisode.Crew);
            Crew crew = tvEpisode.Crew.SingleOrDefault(s => s.CreditId == "52542275760ee313280006ce");

            Assert.NotNull(crew);

            Assert.Equal(66633, crew.Id);
            Assert.Equal("52542275760ee313280006ce", crew.CreditId);
            Assert.Equal("Vince Gilligan", crew.Name);
            Assert.Equal("Writing", crew.Department);
            Assert.Equal("Writer", crew.Job);
            Assert.True(TestImagesHelpers.TestImagePath(crew.ProfilePath), "crew.ProfilePath was not a valid image path, was: " + crew.ProfilePath);

            Assert.NotNull(tvEpisode.GuestStars);
            Cast star = tvEpisode.GuestStars.SingleOrDefault(s => s.CreditId == "52542273760ee3132800068e");

            Assert.NotNull(star);

            Assert.Equal(92495, star.Id);
            Assert.Equal("John Koyama", star.Name);
            Assert.Equal("52542273760ee3132800068e", star.CreditId);
            Assert.Equal("Emilio Koyama", star.Character);
            Assert.Equal(1, star.Order);
            Assert.True(TestImagesHelpers.TestImagePath(star.ProfilePath), "star.ProfilePath was not a valid image path, was: " + star.ProfilePath);
        }