Esempio n. 1
0
        public async Task Test_CalendarShowObjectJsonReader_ReadObject_From_JsonReader_Complete()
        {
            var traktJsonReader = new CalendarShowObjectJsonReader();

            using (var reader = new StringReader(JSON_COMPLETE))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    var traktCalendarShow = await traktJsonReader.ReadObjectAsync(jsonReader);

                    traktCalendarShow.Should().NotBeNull();
                    traktCalendarShow.FirstAiredInCalendar.Should().Be(DateTime.Parse("2014-07-14T01:00:00.000Z").ToUniversalTime());

                    traktCalendarShow.Show.Should().NotBeNull();
                    traktCalendarShow.Show.Title.Should().Be("Game of Thrones");
                    traktCalendarShow.Show.Year.Should().Be(2011);
                    traktCalendarShow.Show.Ids.Should().NotBeNull();
                    traktCalendarShow.Show.Ids.Trakt.Should().Be(1390U);
                    traktCalendarShow.Show.Ids.Slug.Should().Be("game-of-thrones");
                    traktCalendarShow.Show.Ids.Tvdb.Should().Be(121361U);
                    traktCalendarShow.Show.Ids.Imdb.Should().Be("tt0944947");
                    traktCalendarShow.Show.Ids.Tmdb.Should().Be(1399U);
                    traktCalendarShow.Show.Ids.TvRage.Should().Be(24493U);

                    traktCalendarShow.Episode.Should().NotBeNull();
                    traktCalendarShow.Episode.SeasonNumber.Should().Be(1);
                    traktCalendarShow.Episode.Number.Should().Be(1);
                    traktCalendarShow.Episode.Title.Should().Be("Winter Is Coming");
                    traktCalendarShow.Episode.Ids.Should().NotBeNull();
                    traktCalendarShow.Episode.Ids.Trakt.Should().Be(73640U);
                    traktCalendarShow.Episode.Ids.Tvdb.Should().Be(3254641U);
                    traktCalendarShow.Episode.Ids.Imdb.Should().Be("tt1480055");
                    traktCalendarShow.Episode.Ids.Tmdb.Should().Be(63056U);
                    traktCalendarShow.Episode.Ids.TvRage.Should().Be(1065008299U);
                }
        }
        public async Task Test_CalendarShowObjectJsonReader_ReadObject_From_Stream_Incomplete_1()
        {
            var jsonReader = new CalendarShowObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_1.ToStream())
            {
                var traktCalendarShow = await jsonReader.ReadObjectAsync(stream);

                traktCalendarShow.Should().NotBeNull();
                traktCalendarShow.FirstAiredInCalendar.Should().BeNull();

                traktCalendarShow.Show.Should().NotBeNull();
                traktCalendarShow.Show.Title.Should().Be("Game of Thrones");
                traktCalendarShow.Show.Year.Should().Be(2011);
                traktCalendarShow.Show.Ids.Should().NotBeNull();
                traktCalendarShow.Show.Ids.Trakt.Should().Be(1390U);
                traktCalendarShow.Show.Ids.Slug.Should().Be("game-of-thrones");
                traktCalendarShow.Show.Ids.Tvdb.Should().Be(121361U);
                traktCalendarShow.Show.Ids.Imdb.Should().Be("tt0944947");
                traktCalendarShow.Show.Ids.Tmdb.Should().Be(1399U);
                traktCalendarShow.Show.Ids.TvRage.Should().Be(24493U);

                traktCalendarShow.Episode.Should().NotBeNull();
                traktCalendarShow.Episode.SeasonNumber.Should().Be(1);
                traktCalendarShow.Episode.Number.Should().Be(1);
                traktCalendarShow.Episode.Title.Should().Be("Winter Is Coming");
                traktCalendarShow.Episode.Ids.Should().NotBeNull();
                traktCalendarShow.Episode.Ids.Trakt.Should().Be(73640U);
                traktCalendarShow.Episode.Ids.Tvdb.Should().Be(3254641U);
                traktCalendarShow.Episode.Ids.Imdb.Should().Be("tt1480055");
                traktCalendarShow.Episode.Ids.Tmdb.Should().Be(63056U);
                traktCalendarShow.Episode.Ids.TvRage.Should().Be(1065008299U);
            }
        }
        public async Task Test_CalendarShowObjectJsonReader_ReadObject_From_Stream_Not_Valid_3()
        {
            var jsonReader = new CalendarShowObjectJsonReader();

            using (var stream = JSON_NOT_VALID_3.ToStream())
            {
                var traktCalendarShow = await jsonReader.ReadObjectAsync(stream);

                traktCalendarShow.Should().NotBeNull();
                traktCalendarShow.FirstAiredInCalendar.Should().Be(DateTime.Parse("2014-07-14T01:00:00.000Z").ToUniversalTime());

                traktCalendarShow.Show.Should().NotBeNull();
                traktCalendarShow.Show.Title.Should().Be("Game of Thrones");
                traktCalendarShow.Show.Year.Should().Be(2011);
                traktCalendarShow.Show.Ids.Should().NotBeNull();
                traktCalendarShow.Show.Ids.Trakt.Should().Be(1390U);
                traktCalendarShow.Show.Ids.Slug.Should().Be("game-of-thrones");
                traktCalendarShow.Show.Ids.Tvdb.Should().Be(121361U);
                traktCalendarShow.Show.Ids.Imdb.Should().Be("tt0944947");
                traktCalendarShow.Show.Ids.Tmdb.Should().Be(1399U);
                traktCalendarShow.Show.Ids.TvRage.Should().Be(24493U);

                traktCalendarShow.Episode.Should().BeNull();
            }
        }
Esempio n. 4
0
        public async Task Test_CalendarShowObjectJsonReader_ReadObject_From_JsonReader_Incomplete_5()
        {
            var traktJsonReader = new CalendarShowObjectJsonReader();

            using (var reader = new StringReader(JSON_INCOMPLETE_5))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    var traktCalendarShow = await traktJsonReader.ReadObjectAsync(jsonReader);

                    traktCalendarShow.Should().NotBeNull();
                    traktCalendarShow.FirstAiredInCalendar.Should().BeNull();

                    traktCalendarShow.Show.Should().NotBeNull();
                    traktCalendarShow.Show.Title.Should().Be("Game of Thrones");
                    traktCalendarShow.Show.Year.Should().Be(2011);
                    traktCalendarShow.Show.Ids.Should().NotBeNull();
                    traktCalendarShow.Show.Ids.Trakt.Should().Be(1390U);
                    traktCalendarShow.Show.Ids.Slug.Should().Be("game-of-thrones");
                    traktCalendarShow.Show.Ids.Tvdb.Should().Be(121361U);
                    traktCalendarShow.Show.Ids.Imdb.Should().Be("tt0944947");
                    traktCalendarShow.Show.Ids.Tmdb.Should().Be(1399U);
                    traktCalendarShow.Show.Ids.TvRage.Should().Be(24493U);

                    traktCalendarShow.Episode.Should().BeNull();
                }
        }
        public void Test_CalendarShowObjectJsonReader_ReadObject_From_Json_String_Null()
        {
            var jsonReader = new CalendarShowObjectJsonReader();
            Func <Task <ITraktCalendarShow> > traktCalendarShow = () => jsonReader.ReadObjectAsync(default(string));

            traktCalendarShow.Should().Throw <ArgumentNullException>();
        }
Esempio n. 6
0
        public async Task Test_CalendarShowObjectJsonReader_ReadObject_From_JsonReader_Incomplete_6()
        {
            var traktJsonReader = new CalendarShowObjectJsonReader();

            using (var reader = new StringReader(JSON_INCOMPLETE_6))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    var traktCalendarShow = await traktJsonReader.ReadObjectAsync(jsonReader);

                    traktCalendarShow.Should().NotBeNull();
                    traktCalendarShow.FirstAiredInCalendar.Should().BeNull();
                    traktCalendarShow.Show.Should().BeNull();

                    traktCalendarShow.Episode.Should().NotBeNull();
                    traktCalendarShow.Episode.SeasonNumber.Should().Be(1);
                    traktCalendarShow.Episode.Number.Should().Be(1);
                    traktCalendarShow.Episode.Title.Should().Be("Winter Is Coming");
                    traktCalendarShow.Episode.Ids.Should().NotBeNull();
                    traktCalendarShow.Episode.Ids.Trakt.Should().Be(73640U);
                    traktCalendarShow.Episode.Ids.Tvdb.Should().Be(3254641U);
                    traktCalendarShow.Episode.Ids.Imdb.Should().Be("tt1480055");
                    traktCalendarShow.Episode.Ids.Tmdb.Should().Be(63056U);
                    traktCalendarShow.Episode.Ids.TvRage.Should().Be(1065008299U);
                }
        }
Esempio n. 7
0
        public async Task Test_CalendarShowObjectJsonReader_ReadObject_From_JsonReader_Not_Valid_1()
        {
            var traktJsonReader = new CalendarShowObjectJsonReader();

            using (var reader = new StringReader(JSON_NOT_VALID_1))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    var traktCalendarShow = await traktJsonReader.ReadObjectAsync(jsonReader);

                    traktCalendarShow.Should().NotBeNull();
                    traktCalendarShow.FirstAiredInCalendar.Should().BeNull();

                    traktCalendarShow.Show.Should().NotBeNull();
                    traktCalendarShow.Show.Title.Should().Be("Game of Thrones");
                    traktCalendarShow.Show.Year.Should().Be(2011);
                    traktCalendarShow.Show.Ids.Should().NotBeNull();
                    traktCalendarShow.Show.Ids.Trakt.Should().Be(1390U);
                    traktCalendarShow.Show.Ids.Slug.Should().Be("game-of-thrones");
                    traktCalendarShow.Show.Ids.Tvdb.Should().Be(121361U);
                    traktCalendarShow.Show.Ids.Imdb.Should().Be("tt0944947");
                    traktCalendarShow.Show.Ids.Tmdb.Should().Be(1399U);
                    traktCalendarShow.Show.Ids.TvRage.Should().Be(24493U);

                    traktCalendarShow.Episode.Should().NotBeNull();
                    traktCalendarShow.Episode.SeasonNumber.Should().Be(1);
                    traktCalendarShow.Episode.Number.Should().Be(1);
                    traktCalendarShow.Episode.Title.Should().Be("Winter Is Coming");
                    traktCalendarShow.Episode.Ids.Should().NotBeNull();
                    traktCalendarShow.Episode.Ids.Trakt.Should().Be(73640U);
                    traktCalendarShow.Episode.Ids.Tvdb.Should().Be(3254641U);
                    traktCalendarShow.Episode.Ids.Imdb.Should().Be("tt1480055");
                    traktCalendarShow.Episode.Ids.Tmdb.Should().Be(63056U);
                    traktCalendarShow.Episode.Ids.TvRage.Should().Be(1065008299U);
                }
        }
Esempio n. 8
0
        public async Task Test_CalendarShowObjectJsonReader_ReadObject_From_JsonReader_Not_Valid_2()
        {
            var traktJsonReader = new CalendarShowObjectJsonReader();

            using (var reader = new StringReader(JSON_NOT_VALID_2))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    var traktCalendarShow = await traktJsonReader.ReadObjectAsync(jsonReader);

                    traktCalendarShow.Should().NotBeNull();
                    traktCalendarShow.FirstAiredInCalendar.Should().Be(DateTime.Parse("2014-07-14T01:00:00.000Z").ToUniversalTime());

                    traktCalendarShow.Show.Should().BeNull();

                    traktCalendarShow.Episode.Should().NotBeNull();
                    traktCalendarShow.Episode.SeasonNumber.Should().Be(1);
                    traktCalendarShow.Episode.Number.Should().Be(1);
                    traktCalendarShow.Episode.Title.Should().Be("Winter Is Coming");
                    traktCalendarShow.Episode.Ids.Should().NotBeNull();
                    traktCalendarShow.Episode.Ids.Trakt.Should().Be(73640U);
                    traktCalendarShow.Episode.Ids.Tvdb.Should().Be(3254641U);
                    traktCalendarShow.Episode.Ids.Imdb.Should().Be("tt1480055");
                    traktCalendarShow.Episode.Ids.Tmdb.Should().Be(63056U);
                    traktCalendarShow.Episode.Ids.TvRage.Should().Be(1065008299U);
                }
        }
        public async Task Test_CalendarShowObjectJsonReader_ReadObject_From_Stream_Incomplete_2()
        {
            var jsonReader = new CalendarShowObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_2.ToStream())
            {
                var traktCalendarShow = await jsonReader.ReadObjectAsync(stream);

                traktCalendarShow.Should().NotBeNull();
                traktCalendarShow.FirstAiredInCalendar.Should().Be(DateTime.Parse("2014-07-14T01:00:00.000Z").ToUniversalTime());

                traktCalendarShow.Show.Should().BeNull();

                traktCalendarShow.Episode.Should().NotBeNull();
                traktCalendarShow.Episode.SeasonNumber.Should().Be(1);
                traktCalendarShow.Episode.Number.Should().Be(1);
                traktCalendarShow.Episode.Title.Should().Be("Winter Is Coming");
                traktCalendarShow.Episode.Ids.Should().NotBeNull();
                traktCalendarShow.Episode.Ids.Trakt.Should().Be(73640U);
                traktCalendarShow.Episode.Ids.Tvdb.Should().Be(3254641U);
                traktCalendarShow.Episode.Ids.Imdb.Should().Be("tt1480055");
                traktCalendarShow.Episode.Ids.Tmdb.Should().Be(63056U);
                traktCalendarShow.Episode.Ids.TvRage.Should().Be(1065008299U);
            }
        }
        public async Task Test_CalendarShowObjectJsonReader_ReadObject_From_Json_String_Empty()
        {
            var jsonReader = new CalendarShowObjectJsonReader();

            var traktCalendarShow = await jsonReader.ReadObjectAsync(string.Empty);

            traktCalendarShow.Should().BeNull();
        }
Esempio n. 11
0
        public async Task Test_CalendarShowObjectJsonReader_ReadObject_From_Stream_Null()
        {
            var jsonReader = new CalendarShowObjectJsonReader();

            var traktCalendarShow = await jsonReader.ReadObjectAsync(default(Stream));

            traktCalendarShow.Should().BeNull();
        }
Esempio n. 12
0
        public async Task Test_CalendarShowObjectJsonReader_ReadObject_From_JsonReader_Null()
        {
            var traktJsonReader = new CalendarShowObjectJsonReader();

            var traktCalendarShow = await traktJsonReader.ReadObjectAsync(default(JsonTextReader));

            traktCalendarShow.Should().BeNull();
        }
        public async Task Test_CalendarShowObjectJsonReader_ReadObject_From_Json_String_Incomplete_4()
        {
            var jsonReader = new CalendarShowObjectJsonReader();

            var traktCalendarShow = await jsonReader.ReadObjectAsync(JSON_INCOMPLETE_4);

            traktCalendarShow.Should().NotBeNull();
            traktCalendarShow.FirstAiredInCalendar.Should().Be(DateTime.Parse("2014-07-14T01:00:00.000Z").ToUniversalTime());
            traktCalendarShow.Show.Should().BeNull();
            traktCalendarShow.Episode.Should().BeNull();
        }
        public async Task Test_CalendarShowObjectJsonReader_ReadObject_From_Json_String_Not_Valid_4()
        {
            var jsonReader = new CalendarShowObjectJsonReader();

            var traktCalendarShow = await jsonReader.ReadObjectAsync(JSON_NOT_VALID_4);

            traktCalendarShow.Should().NotBeNull();
            traktCalendarShow.FirstAiredInCalendar.Should().BeNull();
            traktCalendarShow.Show.Should().BeNull();
            traktCalendarShow.Episode.Should().BeNull();
        }
        public async Task Test_CalendarShowObjectJsonReader_ReadObject_From_Stream_Empty()
        {
            var jsonReader = new CalendarShowObjectJsonReader();

            using (var stream = string.Empty.ToStream())
            {
                var traktCalendarShow = await jsonReader.ReadObjectAsync(stream);

                traktCalendarShow.Should().BeNull();
            }
        }
        public async Task Test_CalendarShowObjectJsonReader_ReadObject_From_JsonReader_Empty()
        {
            var traktJsonReader = new CalendarShowObjectJsonReader();

            using (var reader = new StringReader(string.Empty))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    var traktCalendarShow = await traktJsonReader.ReadObjectAsync(jsonReader);

                    traktCalendarShow.Should().BeNull();
                }
        }
        public async Task Test_CalendarShowObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var jsonReader = new CalendarShowObjectJsonReader();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var traktCalendarShow = await jsonReader.ReadObjectAsync(stream);

                traktCalendarShow.Should().NotBeNull();
                traktCalendarShow.FirstAiredInCalendar.Should().BeNull();
                traktCalendarShow.Show.Should().BeNull();
                traktCalendarShow.Episode.Should().BeNull();
            }
        }
        public async Task Test_CalendarShowObjectJsonReader_ReadObject_From_JsonReader_Not_Valid_4()
        {
            var traktJsonReader = new CalendarShowObjectJsonReader();

            using (var reader = new StringReader(JSON_NOT_VALID_4))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    var traktCalendarShow = await traktJsonReader.ReadObjectAsync(jsonReader);

                    traktCalendarShow.Should().NotBeNull();
                    traktCalendarShow.FirstAiredInCalendar.Should().BeNull();
                    traktCalendarShow.Show.Should().BeNull();
                    traktCalendarShow.Episode.Should().BeNull();
                }
        }
        public async Task Test_CalendarShowObjectJsonReader_ReadObject_From_Json_String_Incomplete_3()
        {
            var jsonReader = new CalendarShowObjectJsonReader();

            var traktCalendarShow = await jsonReader.ReadObjectAsync(JSON_INCOMPLETE_3);

            traktCalendarShow.Should().NotBeNull();
            traktCalendarShow.FirstAiredInCalendar.Should().Be(DateTime.Parse("2014-07-14T01:00:00.000Z").ToUniversalTime());

            traktCalendarShow.Show.Should().NotBeNull();
            traktCalendarShow.Show.Title.Should().Be("Game of Thrones");
            traktCalendarShow.Show.Year.Should().Be(2011);
            traktCalendarShow.Show.Ids.Should().NotBeNull();
            traktCalendarShow.Show.Ids.Trakt.Should().Be(1390U);
            traktCalendarShow.Show.Ids.Slug.Should().Be("game-of-thrones");
            traktCalendarShow.Show.Ids.Tvdb.Should().Be(121361U);
            traktCalendarShow.Show.Ids.Imdb.Should().Be("tt0944947");
            traktCalendarShow.Show.Ids.Tmdb.Should().Be(1399U);
            traktCalendarShow.Show.Ids.TvRage.Should().Be(24493U);

            traktCalendarShow.Episode.Should().BeNull();
        }
 public async Task Test_CalendarShowObjectJsonReader_ReadObject_From_JsonReader_Null()
 {
     var traktJsonReader = new CalendarShowObjectJsonReader();
     Func <Task <ITraktCalendarShow> > traktCalendarShow = () => traktJsonReader.ReadObjectAsync(default(JsonTextReader));
     await traktCalendarShow.Should().ThrowAsync <ArgumentNullException>();
 }
Esempio n. 21
0
        public async Task Test_TraktCalendarShow_From_Minimal_Json()
        {
            var jsonReader   = new CalendarShowObjectJsonReader();
            var calendarShow = await jsonReader.ReadObjectAsync(MINIMAL_JSON) as TraktCalendarShow;

            calendarShow.Should().NotBeNull();
            calendarShow.FirstAiredInCalendar.Should().Be(DateTime.Parse("2014-07-14T01:00:00.000Z").ToUniversalTime());

            calendarShow.Show.Should().NotBeNull();
            calendarShow.Show.Title.Should().Be("Game of Thrones");
            calendarShow.Show.Year.Should().Be(2011);
            calendarShow.Show.Airs.Should().BeNull();
            calendarShow.Show.AvailableTranslationLanguageCodes.Should().BeNull();
            calendarShow.Show.Ids.Should().NotBeNull();
            calendarShow.Show.Ids.Trakt.Should().Be(1390U);
            calendarShow.Show.Ids.Slug.Should().Be("game-of-thrones");
            calendarShow.Show.Ids.Tvdb.Should().Be(121361U);
            calendarShow.Show.Ids.Imdb.Should().Be("tt0944947");
            calendarShow.Show.Ids.Tmdb.Should().Be(1399U);
            calendarShow.Show.Ids.TvRage.Should().Be(24493U);
            calendarShow.Show.Genres.Should().BeNull();
            calendarShow.Show.Seasons.Should().BeNull();
            calendarShow.Show.Overview.Should().BeNullOrEmpty();
            calendarShow.Show.FirstAired.Should().NotHaveValue();
            calendarShow.Show.Runtime.Should().NotHaveValue();
            calendarShow.Show.Certification.Should().BeNullOrEmpty();
            calendarShow.Show.Network.Should().BeNullOrEmpty();
            calendarShow.Show.CountryCode.Should().BeNullOrEmpty();
            calendarShow.Show.UpdatedAt.Should().NotHaveValue();
            calendarShow.Show.Trailer.Should().BeNullOrEmpty();
            calendarShow.Show.Homepage.Should().BeNullOrEmpty();
            calendarShow.Show.Status.Should().BeNull();
            calendarShow.Show.Rating.Should().NotHaveValue();
            calendarShow.Show.Votes.Should().NotHaveValue();
            calendarShow.Show.LanguageCode.Should().BeNullOrEmpty();
            calendarShow.Show.AiredEpisodes.Should().NotHaveValue();

            calendarShow.Title.Should().Be("Game of Thrones");
            calendarShow.Year.Should().Be(2011);
            calendarShow.Airs.Should().BeNull();
            calendarShow.AvailableTranslationLanguageCodes.Should().BeNull();
            calendarShow.Ids.Should().NotBeNull();
            calendarShow.Ids.Trakt.Should().Be(1390U);
            calendarShow.Ids.Slug.Should().Be("game-of-thrones");
            calendarShow.Ids.Tvdb.Should().Be(121361U);
            calendarShow.Ids.Imdb.Should().Be("tt0944947");
            calendarShow.Ids.Tmdb.Should().Be(1399U);
            calendarShow.Ids.TvRage.Should().Be(24493U);
            calendarShow.Genres.Should().BeNull();
            calendarShow.Seasons.Should().BeNull();
            calendarShow.Overview.Should().BeNullOrEmpty();
            calendarShow.FirstAired.Should().NotHaveValue();
            calendarShow.Runtime.Should().NotHaveValue();
            calendarShow.Certification.Should().BeNullOrEmpty();
            calendarShow.Network.Should().BeNullOrEmpty();
            calendarShow.CountryCode.Should().BeNullOrEmpty();
            calendarShow.UpdatedAt.Should().NotHaveValue();
            calendarShow.Trailer.Should().BeNullOrEmpty();
            calendarShow.Homepage.Should().BeNullOrEmpty();
            calendarShow.Status.Should().BeNull();
            calendarShow.Rating.Should().NotHaveValue();
            calendarShow.Votes.Should().NotHaveValue();
            calendarShow.LanguageCode.Should().BeNullOrEmpty();
            calendarShow.AiredEpisodes.Should().NotHaveValue();

            calendarShow.Episode.Should().NotBeNull();
            calendarShow.Episode.SeasonNumber.Should().Be(1);
            calendarShow.Episode.Number.Should().Be(1);
            calendarShow.Episode.Title.Should().Be("Winter Is Coming");
            calendarShow.Episode.Ids.Should().NotBeNull();
            calendarShow.Episode.Ids.Trakt.Should().Be(73640U);
            calendarShow.Episode.Ids.Tvdb.Should().Be(3254641U);
            calendarShow.Episode.Ids.Imdb.Should().Be("tt1480055");
            calendarShow.Episode.Ids.Tmdb.Should().Be(63056U);
            calendarShow.Episode.Ids.TvRage.Should().Be(1065008299U);
            calendarShow.Episode.NumberAbsolute.Should().NotHaveValue();
            calendarShow.Episode.Overview.Should().BeNullOrEmpty();
            calendarShow.Episode.Runtime.Should().NotHaveValue();
            calendarShow.Episode.Rating.Should().NotHaveValue();
            calendarShow.Episode.Votes.Should().NotHaveValue();
            calendarShow.Episode.FirstAired.Should().NotHaveValue();
            calendarShow.Episode.UpdatedAt.Should().NotHaveValue();
            calendarShow.Episode.AvailableTranslationLanguageCodes.Should().BeNull();
            calendarShow.Episode.Translations.Should().BeNull();

            calendarShow.Should().NotBeNull();
            calendarShow.SeasonNumber.Should().Be(1);
            calendarShow.EpisodeNumber.Should().Be(1);
            calendarShow.EpisodeTitle.Should().Be("Winter Is Coming");
            calendarShow.EpisodeIds.Should().NotBeNull();
            calendarShow.EpisodeIds.Trakt.Should().Be(73640U);
            calendarShow.EpisodeIds.Tvdb.Should().Be(3254641U);
            calendarShow.EpisodeIds.Imdb.Should().Be("tt1480055");
            calendarShow.EpisodeIds.Tmdb.Should().Be(63056U);
            calendarShow.EpisodeIds.TvRage.Should().Be(1065008299U);
            calendarShow.AbsoluteEpisodeNumber.Should().NotHaveValue();
            calendarShow.EpisodeOverview.Should().BeNullOrEmpty();
            calendarShow.EpisodeRuntime.Should().NotHaveValue();
            calendarShow.EpisodeRating.Should().NotHaveValue();
            calendarShow.EpisodeVotes.Should().NotHaveValue();
            calendarShow.EpisodeAiredFirstAt.Should().NotHaveValue();
            calendarShow.EpisodeUpdatedAt.Should().NotHaveValue();
            calendarShow.AvailableEpisodeTranslationLanguageCodes.Should().BeNull();
            calendarShow.EpisodeTranslations.Should().BeNull();
        }
Esempio n. 22
0
        public async Task Test_TraktCalendarShow_From_Full_Json()
        {
            var jsonReader   = new CalendarShowObjectJsonReader();
            var calendarShow = await jsonReader.ReadObjectAsync(FULL_JSON) as TraktCalendarShow;

            calendarShow.Should().NotBeNull();
            calendarShow.FirstAiredInCalendar.Should().Be(DateTime.Parse("2014-07-14T01:00:00.000Z").ToUniversalTime());

            calendarShow.Show.Should().NotBeNull();
            calendarShow.Show.Title.Should().Be("Game of Thrones");
            calendarShow.Show.Year.Should().Be(2011);
            calendarShow.Show.Airs.Should().NotBeNull();
            calendarShow.Show.Airs.Day.Should().Be("Sunday");
            calendarShow.Show.Airs.Time.Should().Be("21:00");
            calendarShow.Show.Airs.TimeZoneId.Should().Be("America/New_York");
            calendarShow.Show.AvailableTranslationLanguageCodes.Should().NotBeNull().And.HaveCount(4).And.Contain("en", "fr", "it", "de");
            calendarShow.Show.Ids.Should().NotBeNull();
            calendarShow.Show.Ids.Trakt.Should().Be(1390U);
            calendarShow.Show.Ids.Slug.Should().Be("game-of-thrones");
            calendarShow.Show.Ids.Tvdb.Should().Be(121361U);
            calendarShow.Show.Ids.Imdb.Should().Be("tt0944947");
            calendarShow.Show.Ids.Tmdb.Should().Be(1399U);
            calendarShow.Show.Ids.TvRage.Should().Be(24493U);
            calendarShow.Show.Genres.Should().NotBeNull().And.HaveCount(5).And.Contain("drama", "fantasy", "science-fiction", "action", "adventure");
            calendarShow.Show.Seasons.Should().BeNull();
            calendarShow.Show.Overview.Should().Be("Seven noble families fight for control of the mythical land of Westeros. Friction between the houses leads to full-scale war. All while a very ancient evil awakens in the farthest north. Amidst the war, a neglected military order of misfits, the Night's Watch, is all that stands between the realms of men and the icy horrors beyond.");
            calendarShow.Show.FirstAired.Should().Be(DateTime.Parse("2011-04-17T07:00:00Z").ToUniversalTime());
            calendarShow.Show.Runtime.Should().Be(60);
            calendarShow.Show.Certification.Should().Be("TV-MA");
            calendarShow.Show.Network.Should().Be("HBO");
            calendarShow.Show.CountryCode.Should().Be("us");
            calendarShow.Show.UpdatedAt.Should().Be(DateTime.Parse("2016-04-06T10:39:11Z").ToUniversalTime());
            calendarShow.Show.Trailer.Should().Be("http://youtube.com/watch?v=F9Bo89m2f6g");
            calendarShow.Show.Homepage.Should().Be("http://www.hbo.com/game-of-thrones");
            calendarShow.Show.Status.Should().Be(TraktShowStatus.ReturningSeries);
            calendarShow.Show.Rating.Should().Be(9.38327f);
            calendarShow.Show.Votes.Should().Be(44773);
            calendarShow.Show.LanguageCode.Should().Be("en");
            calendarShow.Show.AiredEpisodes.Should().Be(50);

            calendarShow.Title.Should().Be("Game of Thrones");
            calendarShow.Year.Should().Be(2011);
            calendarShow.Airs.Should().NotBeNull();
            calendarShow.Airs.Day.Should().Be("Sunday");
            calendarShow.Airs.Time.Should().Be("21:00");
            calendarShow.Airs.TimeZoneId.Should().Be("America/New_York");
            calendarShow.AvailableTranslationLanguageCodes.Should().NotBeNull().And.HaveCount(4).And.Contain("en", "fr", "it", "de");
            calendarShow.Ids.Should().NotBeNull();
            calendarShow.Ids.Trakt.Should().Be(1390U);
            calendarShow.Ids.Slug.Should().Be("game-of-thrones");
            calendarShow.Ids.Tvdb.Should().Be(121361U);
            calendarShow.Ids.Imdb.Should().Be("tt0944947");
            calendarShow.Ids.Tmdb.Should().Be(1399U);
            calendarShow.Ids.TvRage.Should().Be(24493U);
            calendarShow.Genres.Should().NotBeNull().And.HaveCount(5).And.Contain("drama", "fantasy", "science-fiction", "action", "adventure");
            calendarShow.Seasons.Should().BeNull();
            calendarShow.Overview.Should().Be("Seven noble families fight for control of the mythical land of Westeros. Friction between the houses leads to full-scale war. All while a very ancient evil awakens in the farthest north. Amidst the war, a neglected military order of misfits, the Night's Watch, is all that stands between the realms of men and the icy horrors beyond.");
            calendarShow.FirstAired.Should().Be(DateTime.Parse("2011-04-17T07:00:00Z").ToUniversalTime());
            calendarShow.Runtime.Should().Be(60);
            calendarShow.Certification.Should().Be("TV-MA");
            calendarShow.Network.Should().Be("HBO");
            calendarShow.CountryCode.Should().Be("us");
            calendarShow.UpdatedAt.Should().Be(DateTime.Parse("2016-04-06T10:39:11Z").ToUniversalTime());
            calendarShow.Trailer.Should().Be("http://youtube.com/watch?v=F9Bo89m2f6g");
            calendarShow.Homepage.Should().Be("http://www.hbo.com/game-of-thrones");
            calendarShow.Status.Should().Be(TraktShowStatus.ReturningSeries);
            calendarShow.Rating.Should().Be(9.38327f);
            calendarShow.Votes.Should().Be(44773);
            calendarShow.LanguageCode.Should().Be("en");
            calendarShow.AiredEpisodes.Should().Be(50);

            calendarShow.Episode.Should().NotBeNull();
            calendarShow.Episode.SeasonNumber.Should().Be(1);
            calendarShow.Episode.Number.Should().Be(1);
            calendarShow.Episode.Title.Should().Be("Winter Is Coming");
            calendarShow.Episode.Ids.Should().NotBeNull();
            calendarShow.Episode.Ids.Trakt.Should().Be(73640U);
            calendarShow.Episode.Ids.Tvdb.Should().Be(3254641U);
            calendarShow.Episode.Ids.Imdb.Should().Be("tt1480055");
            calendarShow.Episode.Ids.Tmdb.Should().Be(63056U);
            calendarShow.Episode.Ids.TvRage.Should().Be(1065008299U);
            calendarShow.Episode.NumberAbsolute.Should().Be(50);
            calendarShow.Episode.Overview.Should().Be("Ned Stark, Lord of Winterfell learns that his mentor, Jon Arryn, has died and that King Robert is on his way north to offer Ned Arryn’s position as the King’s Hand. Across the Narrow Sea in Pentos, Viserys Targaryen plans to wed his sister Daenerys to the nomadic Dothraki warrior leader, Khal Drogo to forge an alliance to take the throne.");
            calendarShow.Episode.Runtime.Should().Be(55);
            calendarShow.Episode.Rating.Should().Be(9.0f);
            calendarShow.Episode.Votes.Should().Be(111);
            calendarShow.Episode.FirstAired.Should().Be(DateTime.Parse("2011-04-18T01:00:00.000Z").ToUniversalTime());
            calendarShow.Episode.UpdatedAt.Should().Be(DateTime.Parse("2014-08-29T23:16:39.000Z").ToUniversalTime());
            calendarShow.Episode.AvailableTranslationLanguageCodes.Should().NotBeNull().And.HaveCount(2).And.Contain("en", "es");
            calendarShow.Episode.Translations.Should().NotBeNull().And.HaveCount(2);

            var translations = calendarShow.Episode.Translations.ToArray();

            translations[0].Should().NotBeNull();
            translations[0].Title.Should().Be("Winter Is Coming");
            translations[0].Overview.Should().Be("Jon Arryn, the Hand of the King, is dead. King Robert Baratheon plans to ask his oldest friend, Eddard Stark, to take Jon's place. Across the sea, Viserys Targaryen plans to wed his sister to a nomadic warlord in exchange for an army.");
            translations[0].LanguageCode.Should().Be("en");

            translations[1].Should().NotBeNull();
            translations[1].Title.Should().Be("Se acerca el invierno");
            translations[1].Overview.Should().Be("El Lord Ned Stark está preocupado por los perturbantes reportes de un desertor del Nights Watch; El Rey Robert y los Lannisters llegan a Winterfell; el exiliado Viserys Targaryen forja una nueva y poderosa alianza.");
            translations[1].LanguageCode.Should().Be("es");

            calendarShow.Should().NotBeNull();
            calendarShow.SeasonNumber.Should().Be(1);
            calendarShow.EpisodeNumber.Should().Be(1);
            calendarShow.EpisodeTitle.Should().Be("Winter Is Coming");
            calendarShow.EpisodeIds.Should().NotBeNull();
            calendarShow.EpisodeIds.Trakt.Should().Be(73640U);
            calendarShow.EpisodeIds.Tvdb.Should().Be(3254641U);
            calendarShow.EpisodeIds.Imdb.Should().Be("tt1480055");
            calendarShow.EpisodeIds.Tmdb.Should().Be(63056U);
            calendarShow.EpisodeIds.TvRage.Should().Be(1065008299U);
            calendarShow.AbsoluteEpisodeNumber.Should().Be(50);
            calendarShow.EpisodeOverview.Should().Be("Ned Stark, Lord of Winterfell learns that his mentor, Jon Arryn, has died and that King Robert is on his way north to offer Ned Arryn’s position as the King’s Hand. Across the Narrow Sea in Pentos, Viserys Targaryen plans to wed his sister Daenerys to the nomadic Dothraki warrior leader, Khal Drogo to forge an alliance to take the throne.");
            calendarShow.EpisodeRuntime.Should().Be(55);
            calendarShow.EpisodeRating.Should().Be(9.0f);
            calendarShow.EpisodeVotes.Should().Be(111);
            calendarShow.EpisodeAiredFirstAt.Should().Be(DateTime.Parse("2011-04-18T01:00:00.000Z").ToUniversalTime());
            calendarShow.EpisodeUpdatedAt.Should().Be(DateTime.Parse("2014-08-29T23:16:39.000Z").ToUniversalTime());
            calendarShow.AvailableEpisodeTranslationLanguageCodes.Should().NotBeNull().And.HaveCount(2).And.Contain("en", "es");
            calendarShow.EpisodeTranslations.Should().NotBeNull().And.HaveCount(2);

            translations = calendarShow.EpisodeTranslations.ToArray();

            translations[0].Should().NotBeNull();
            translations[0].Title.Should().Be("Winter Is Coming");
            translations[0].Overview.Should().Be("Jon Arryn, the Hand of the King, is dead. King Robert Baratheon plans to ask his oldest friend, Eddard Stark, to take Jon's place. Across the sea, Viserys Targaryen plans to wed his sister to a nomadic warlord in exchange for an army.");
            translations[0].LanguageCode.Should().Be("en");

            translations[1].Should().NotBeNull();
            translations[1].Title.Should().Be("Se acerca el invierno");
            translations[1].Overview.Should().Be("El Lord Ned Stark está preocupado por los perturbantes reportes de un desertor del Nights Watch; El Rey Robert y los Lannisters llegan a Winterfell; el exiliado Viserys Targaryen forja una nueva y poderosa alianza.");
            translations[1].LanguageCode.Should().Be("es");
        }