示例#1
0
        public void TestTvShowSeparateExtrasCredits()
        {
            Credits credits = Config.Client.GetTvShowCreditsAsync(IdHelper.BreakingBad).Result;

            Assert.NotNull(credits);
            Assert.NotNull(credits.Cast);
            Assert.Equal(IdHelper.BreakingBad, credits.Id);

            Cast castPerson = credits.Cast[0];

            Assert.Equal("Walter White", castPerson.Character);
            Assert.Equal("52542282760ee313280017f9", castPerson.CreditId);
            Assert.Equal(17419, castPerson.Id);
            Assert.Equal("Bryan Cranston", castPerson.Name);
            Assert.NotNull(castPerson.ProfilePath);
            Assert.Equal(0, castPerson.Order);

            Assert.NotNull(credits.Crew);

            Crew crewPerson = credits.Crew.FirstOrDefault(s => s.Id == 66633);

            Assert.NotNull(crewPerson);

            Assert.Equal(66633, crewPerson.Id);
            Assert.Equal("52542287760ee31328001af1", crewPerson.CreditId);
            Assert.Equal("Production", crewPerson.Department);
            Assert.Equal("Vince Gilligan", crewPerson.Name);
            Assert.Equal("Executive Producer", crewPerson.Job);
            Assert.NotNull(crewPerson.ProfilePath);
        }
        public void TestTvEpisodeSeparateExtrasCredits()
        {
            CreditsWithGuestStars credits = Config.Client.GetTvEpisodeCreditsAsync(IdHelper.BreakingBad, 1, 1).Result;

            Assert.NotNull(credits);

            Cast guestStarItem = credits.GuestStars.FirstOrDefault(s => s.Id == 92495);

            Assert.Equal(92495, guestStarItem.Id);
            Assert.Equal("Emilio Koyama", guestStarItem.Character);
            Assert.Equal("52542273760ee3132800068e", guestStarItem.CreditId);
            Assert.Equal("John Koyama", guestStarItem.Name);
            Assert.NotNull(guestStarItem.ProfilePath);
            Assert.Equal(1, guestStarItem.Order);

            Cast castItem = credits.Cast.FirstOrDefault(s => s.Id == 17419);

            Assert.Equal(17419, castItem.Id);
            Assert.Equal("Walter White", castItem.Character);
            Assert.Equal("52542282760ee313280017f9", castItem.CreditId);
            Assert.Equal("Bryan Cranston", castItem.Name);
            Assert.NotNull(castItem.ProfilePath);
            Assert.Equal(0, castItem.Order);

            Crew crewItem = credits.Crew.FirstOrDefault(s => s.Id == 1280071);

            Assert.NotNull(crewItem);
            Assert.Equal(1280071, crewItem.Id);
            Assert.Equal("Editing", crewItem.Department);
            Assert.Equal("Lynne Willingham", crewItem.Name);
            Assert.Equal("Editor", crewItem.Job);
            Assert.Null(crewItem.ProfilePath);
        }
        private void TestBreakingBadSeasonOneEpisodeOneBaseProperties(TvEpisode tvEpisode)
        {
            Assert.AreEqual(62085, tvEpisode.Id);
            Assert.AreEqual(new DateTime(2008, 1, 19), tvEpisode.AirDate.Date);
            Assert.AreEqual(1, tvEpisode.EpisodeNumber);
            Assert.AreEqual("Pilot", tvEpisode.Name);
            Assert.IsNotNull(tvEpisode.Overview);
            Assert.IsNull(tvEpisode.ProductionCode);
            Assert.AreEqual(1, tvEpisode.SeasonNumber);
            Assert.IsNotNull(tvEpisode.StillPath);

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

            Assert.IsNotNull(crew);

            Assert.AreEqual(66633, crew.Id);
            Assert.AreEqual("52542275760ee313280006ce", crew.CreditId);
            Assert.AreEqual("Vince Gilligan", crew.Name);
            Assert.AreEqual("Writing", crew.Department);
            Assert.AreEqual("Writer", crew.Job);
            Assert.AreEqual("/rLSUjr725ez1cK7SKVxC9udO03Y.jpg", crew.ProfilePath);

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

            Assert.IsNotNull(star);

            Assert.AreEqual(92495, star.Id);
            Assert.AreEqual("John Koyama", star.Name);
            Assert.AreEqual("52542273760ee3132800068e", star.CreditId);
            Assert.AreEqual("Emilio Koyama", star.Character);
            Assert.AreEqual(1, star.Order);
            Assert.AreEqual("/uh4g85qbQGZZ0HH6IQI9fM9VUGS.jpg", star.ProfilePath);
        }
示例#4
0
        public async Task TestTvEpisodeSeparateExtrasCreditsAsync()
        {
            CreditsWithGuestStars credits = await TMDbClient.GetTvEpisodeCreditsAsync(IdHelper.BreakingBad, 1, 1);

            Assert.NotNull(credits);

            Cast guestStarItem = credits.GuestStars.FirstOrDefault(s => s.Id == 92495);
            Cast castItem      = credits.Cast.FirstOrDefault(s => s.Id == 17419);
            Crew crewItem      = credits.Crew.FirstOrDefault(s => s.Id == 1280071);

            await Verify(new
            {
                guestStarItem,
                castItem,
                crewItem
            });
        }
        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);
        }