public async Task Test_IdsArrayJsonReader_ReadArray_From_Stream_Not_Valid_1() { var jsonReader = new ArrayJsonReader <ITraktIds>(); using (var stream = JSON_NOT_VALID_1.ToStream()) { IEnumerable <ITraktIds> multipleTraktIds = await jsonReader.ReadArrayAsync(stream); multipleTraktIds.Should().NotBeNull(); ITraktIds[] ids = multipleTraktIds.ToArray(); ids[0].Should().NotBeNull(); ids[0].Trakt.Should().Be(0); ids[0].Slug.Should().Be("game-of-thrones"); ids[0].Tvdb.Should().Be(121361U); ids[0].Imdb.Should().Be("tt0944947"); ids[0].Tmdb.Should().Be(1399U); ids[0].TvRage.Should().Be(24493U); ids[1].Should().NotBeNull(); ids[1].Trakt.Should().Be(1390); ids[1].Slug.Should().Be("game-of-thrones"); ids[1].Tvdb.Should().Be(121361U); ids[1].Imdb.Should().Be("tt0944947"); ids[1].Tmdb.Should().Be(1399U); ids[1].TvRage.Should().Be(24493U); } }
public async Task Test_UserSettingsObjectJsonReader_ReadObject_From_Stream_Not_Valid_1() { var jsonReader = new UserSettingsObjectJsonReader(); using (var stream = JSON_NOT_VALID_1.ToStream()) { var userSettings = await jsonReader.ReadObjectAsync(stream); userSettings.Should().NotBeNull(); userSettings.User.Should().BeNull(); userSettings.Account.Should().NotBeNull(); userSettings.Account.TimeZoneId.Should().Be("America/Los_Angeles"); userSettings.Account.Time24Hr.Should().BeTrue(); userSettings.Account.CoverImage.Should().Be("https://walter.trakt.us/images/movies/000/001/545/fanarts/original/0abb604492.jpg?1406095042"); userSettings.Account.Token.Should().Be("60fa34c4f5e7f093ecc5a2d16d691e24"); userSettings.Connections.Should().NotBeNull(); userSettings.Connections.Twitter.Should().BeTrue(); userSettings.Connections.Google.Should().BeTrue(); userSettings.Connections.Tumblr.Should().BeTrue(); userSettings.Connections.Medium.Should().BeTrue(); userSettings.Connections.Slack.Should().BeTrue(); userSettings.SharingText.Should().NotBeNull(); userSettings.SharingText.Watching.Should().Be("I'm watching [item]"); userSettings.SharingText.Watched.Should().Be("I just watched [item]"); } }
public async Task Test_CollectionMovieObjectJsonReader_ReadObject_From_Stream_Not_Valid_1() { var jsonReader = new CollectionMovieObjectJsonReader(); using (var stream = JSON_NOT_VALID_1.ToStream()) { var traktCollectionMovie = await jsonReader.ReadObjectAsync(stream); traktCollectionMovie.Should().NotBeNull(); traktCollectionMovie.CollectedAt.Should().BeNull(); traktCollectionMovie.UpdatedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); traktCollectionMovie.Movie.Should().NotBeNull(); traktCollectionMovie.Movie.Title.Should().Be("Star Wars: The Force Awakens"); traktCollectionMovie.Movie.Year.Should().Be(2015); traktCollectionMovie.Movie.Ids.Should().NotBeNull(); traktCollectionMovie.Movie.Ids.Trakt.Should().Be(94024U); traktCollectionMovie.Movie.Ids.Slug.Should().Be("star-wars-the-force-awakens-2015"); traktCollectionMovie.Movie.Ids.Imdb.Should().Be("tt2488496"); traktCollectionMovie.Movie.Ids.Tmdb.Should().Be(140607U); traktCollectionMovie.Metadata.Should().NotBeNull(); traktCollectionMovie.Metadata.MediaType.Should().Be(TraktMediaType.Bluray); traktCollectionMovie.Metadata.MediaResolution.Should().Be(TraktMediaResolution.HD_1080p); traktCollectionMovie.Metadata.Audio.Should().Be(TraktMediaAudio.DTS); traktCollectionMovie.Metadata.AudioChannels.Should().Be(TraktMediaAudioChannel.Channels_6_1); traktCollectionMovie.Metadata.ThreeDimensional.Should().BeFalse(); } }
public async Task Test_DeviceArrayJsonReader_ReadObject_From_Stream_Not_Valid_1() { var objectJsonReader = new ArrayJsonReader <ITraktDevice>(); using (var stream = JSON_NOT_VALID_1.ToStream()) { IEnumerable <ITraktDevice> traktDevices = await objectJsonReader.ReadArrayAsync(stream); traktDevices.Should().NotBeNull(); ITraktDevice[] items = traktDevices.ToArray(); items[0].Should().NotBeNull(); items[0].DeviceCode.Should().BeNull(); items[0].UserCode.Should().Be("mockUserCode1"); items[0].VerificationUrl.Should().Be("mockUrl1"); items[0].ExpiresInSeconds.Should().Be(7200U); items[0].IntervalInSeconds.Should().Be(600U); items[1].Should().NotBeNull(); items[1].DeviceCode.Should().Be("mockDeviceCode2"); items[1].UserCode.Should().Be("mockUserCode2"); items[1].VerificationUrl.Should().Be("mockUrl2"); items[1].ExpiresInSeconds.Should().Be(7200U); items[1].IntervalInSeconds.Should().Be(600U); } }
public async Task Test_PersonMovieCreditsCastItemArrayJsonReader_ReadObject_From_Stream_Not_Valid_1() { var jsonReader = new PersonMovieCreditsCastItemArrayJsonReader(); using (var stream = JSON_NOT_VALID_1.ToStream()) { var movieCreditsCastItems = await jsonReader.ReadArrayAsync(stream); movieCreditsCastItems.Should().NotBeNull(); var items = movieCreditsCastItems.ToArray(); items[0].Should().NotBeNull(); items[0].Character.Should().BeNull(); items[0].Movie.Should().NotBeNull(); items[0].Movie.Title.Should().Be("Star Wars: The Force Awakens"); items[0].Movie.Year.Should().Be(2015); items[0].Movie.Ids.Should().NotBeNull(); items[0].Movie.Ids.Trakt.Should().Be(94024U); items[0].Movie.Ids.Slug.Should().Be("star-wars-the-force-awakens-2015"); items[0].Movie.Ids.Imdb.Should().Be("tt2488496"); items[0].Movie.Ids.Tmdb.Should().Be(140607U); items[1].Should().NotBeNull(); items[1].Character.Should().Be("Sam Flynn"); items[1].Movie.Should().NotBeNull(); items[1].Movie.Title.Should().Be("TRON: Legacy"); items[1].Movie.Year.Should().Be(2010); items[1].Movie.Ids.Should().NotBeNull(); items[1].Movie.Ids.Trakt.Should().Be(12601U); items[1].Movie.Ids.Slug.Should().Be("tron-legacy-2010"); items[1].Movie.Ids.Imdb.Should().Be("tt1104001"); items[1].Movie.Ids.Tmdb.Should().Be(20526U); } }
public async Task Test_EpisodeWatchedProgressArrayJsonReader_ReadArray_From_Stream_Not_Valid_1() { var traktJsonReader = new EpisodeWatchedProgressArrayJsonReader(); using (var stream = JSON_NOT_VALID_1.ToStream()) { var traktEpisodeWatchedProgresses = await traktJsonReader.ReadArrayAsync(stream); traktEpisodeWatchedProgresses.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(3); var watchedProgress = traktEpisodeWatchedProgresses.ToArray(); watchedProgress[0].Number.Should().BeNull(); watchedProgress[0].Completed.Should().BeTrue(); watchedProgress[0].LastWatchedAt.Should().Be(DateTime.Parse("2011-04-18T01:00:00.000Z").ToUniversalTime()); watchedProgress[1].Number.Should().Be(2); watchedProgress[1].Completed.Should().BeTrue(); watchedProgress[1].LastWatchedAt.Should().Be(DateTime.Parse("2011-04-18T01:00:00.000Z").ToUniversalTime()); watchedProgress[2].Number.Should().Be(3); watchedProgress[2].Completed.Should().BeTrue(); watchedProgress[2].LastWatchedAt.Should().Be(DateTime.Parse("2011-04-18T01:00:00.000Z").ToUniversalTime()); } }
public async Task Test_UserFollowRequestObjectJsonReader_ReadObject_From_Stream_Not_Valid_1() { var jsonReader = new UserFollowRequestObjectJsonReader(); using (var stream = JSON_NOT_VALID_1.ToStream()) { var userFollowRequest = await jsonReader.ReadObjectAsync(stream); userFollowRequest.Should().NotBeNull(); userFollowRequest.Id.Should().Be(0U); userFollowRequest.RequestedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); userFollowRequest.User.Should().NotBeNull(); userFollowRequest.User.Username.Should().Be("sean"); userFollowRequest.User.IsPrivate.Should().BeFalse(); userFollowRequest.User.Name.Should().Be("Sean Rudford"); userFollowRequest.User.IsVIP.Should().BeTrue(); userFollowRequest.User.IsVIP_EP.Should().BeTrue(); userFollowRequest.User.Ids.Should().NotBeNull(); userFollowRequest.User.Ids.Slug.Should().Be("sean"); userFollowRequest.User.JoinedAt.Should().HaveValue().And.Be(DateTime.Parse("2010-09-25T17:49:25.000Z").ToUniversalTime()); userFollowRequest.User.Location.Should().Be("SF"); userFollowRequest.User.About.Should().Be("I have all your cassette tapes."); userFollowRequest.User.Gender.Should().Be("male"); userFollowRequest.User.Age.Should().Be(35); userFollowRequest.User.Images.Should().NotBeNull(); userFollowRequest.User.Images.Avatar.Should().NotBeNull(); userFollowRequest.User.Images.Avatar.Full.Should().Be("https://walter-dev.trakt.tv/images/users/000/000/001/avatars/large/0ba3f72910.jpg"); } }
public async Task Test_UserCustomListsReorderPostResponseArrayJsonReader_ReadArray_From_Stream_Not_Valid_1() { var traktJsonReader = new UserCustomListsReorderPostResponseArrayJsonReader(); using (var stream = JSON_NOT_VALID_1.ToStream()) { IEnumerable <ITraktUserCustomListsReorderPostResponse> traktUserCustomListsReorderPostResponses = await traktJsonReader.ReadArrayAsync(stream); traktUserCustomListsReorderPostResponses.Should().NotBeNull(); ITraktUserCustomListsReorderPostResponse[] userCustomListsReorderPosts = traktUserCustomListsReorderPostResponses.ToArray(); userCustomListsReorderPosts[0].Should().NotBeNull(); userCustomListsReorderPosts[0].Updated.Should().Be(6); userCustomListsReorderPosts[0].SkippedIds.Should().NotBeNull().And.HaveCount(1); userCustomListsReorderPosts[0].SkippedIds.Should().BeEquivalentTo(new List <uint> { 2 }); userCustomListsReorderPosts[1].Should().NotBeNull(); userCustomListsReorderPosts[1].Updated.Should().BeNull(); userCustomListsReorderPosts[1].SkippedIds.Should().NotBeNull().And.HaveCount(1); userCustomListsReorderPosts[1].SkippedIds.Should().BeEquivalentTo(new List <uint> { 2 }); } }
public async Task Test_StatisticsArrayJsonReader_ReadArray_From_Stream_Not_Valid_1() { var jsonReader = new ArrayJsonReader <ITraktStatistics>(); using (var stream = JSON_NOT_VALID_1.ToStream()) { IEnumerable <ITraktStatistics> traktStatisticss = await jsonReader.ReadArrayAsync(stream); traktStatisticss.Should().NotBeNull(); ITraktStatistics[] statistics = traktStatisticss.ToArray(); statistics[0].Should().NotBeNull(); statistics[0].Watchers.Should().BeNull(); statistics[0].Plays.Should().Be(3563853); statistics[0].Collectors.Should().Be(49711); statistics[0].CollectedEpisodes.Should().Be(1310350); statistics[0].Comments.Should().Be(96); statistics[0].Lists.Should().Be(49468); statistics[0].Votes.Should().Be(9274); statistics[1].Should().NotBeNull(); statistics[1].Watchers.Should().Be(129920); statistics[1].Plays.Should().Be(3563853); statistics[1].Collectors.Should().Be(49711); statistics[1].CollectedEpisodes.Should().Be(1310350); statistics[1].Comments.Should().Be(96); statistics[1].Lists.Should().Be(49468); statistics[1].Votes.Should().Be(9274); } }
public async Task Test_CollectionShowSeasonObjectJsonReader_ReadObject_From_Stream_Not_Valid_1() { var jsonReader = new CollectionShowSeasonObjectJsonReader(); using (var stream = JSON_NOT_VALID_1.ToStream()) { var traktCollectionShowSeason = await jsonReader.ReadObjectAsync(stream); traktCollectionShowSeason.Should().NotBeNull(); traktCollectionShowSeason.Number.Should().BeNull(); traktCollectionShowSeason.Episodes.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(2); var traktCollectionShowSeasonEpisodes = traktCollectionShowSeason.Episodes.ToArray(); traktCollectionShowSeasonEpisodes[0].Number.Should().Be(1); traktCollectionShowSeasonEpisodes[0].CollectedAt.Should().Be(DateTime.Parse("2014-07-14T01:00:00.000Z").ToUniversalTime()); traktCollectionShowSeasonEpisodes[0].Metadata.Should().NotBeNull(); traktCollectionShowSeasonEpisodes[0].Metadata.MediaType.Should().Be(TraktMediaType.Digital); traktCollectionShowSeasonEpisodes[0].Metadata.MediaResolution.Should().Be(TraktMediaResolution.HD_720p); traktCollectionShowSeasonEpisodes[0].Metadata.Audio.Should().Be(TraktMediaAudio.AAC); traktCollectionShowSeasonEpisodes[0].Metadata.AudioChannels.Should().Be(TraktMediaAudioChannel.Channels_5_1); traktCollectionShowSeasonEpisodes[0].Metadata.ThreeDimensional.Should().BeTrue(); traktCollectionShowSeasonEpisodes[1].Number.Should().Be(2); traktCollectionShowSeasonEpisodes[1].CollectedAt.Should().Be(DateTime.Parse("2014-07-15T01:00:00.000Z").ToUniversalTime()); traktCollectionShowSeasonEpisodes[1].Metadata.Should().NotBeNull(); traktCollectionShowSeasonEpisodes[1].Metadata.MediaType.Should().Be(TraktMediaType.Digital); traktCollectionShowSeasonEpisodes[1].Metadata.MediaResolution.Should().Be(TraktMediaResolution.HD_720p); traktCollectionShowSeasonEpisodes[1].Metadata.Audio.Should().Be(TraktMediaAudio.AAC); traktCollectionShowSeasonEpisodes[1].Metadata.AudioChannels.Should().Be(TraktMediaAudioChannel.Channels_5_1); traktCollectionShowSeasonEpisodes[1].Metadata.ThreeDimensional.Should().BeFalse(); } }
public async Task Test_EpisodeTranslationArrayJsonReader_ReadArray_From_Stream_Not_Valid_1() { var traktJsonReader = new ArrayJsonReader <ITraktEpisodeTranslation>(); using (var stream = JSON_NOT_VALID_1.ToStream()) { var traktEpisodeTranslations = await traktJsonReader.ReadArrayAsync(stream); traktEpisodeTranslations.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(3); var translations = traktEpisodeTranslations.ToArray(); translations[0].Title.Should().BeNull(); translations[0].Overview.Should().Be("Translation Overview 1"); translations[0].LanguageCode.Should().Be("Translation Language 1"); translations[1].Title.Should().Be("Translation 2"); translations[1].Overview.Should().Be("Translation Overview 2"); translations[1].LanguageCode.Should().Be("Translation Language 2"); translations[2].Title.Should().Be("Translation 3"); translations[2].Overview.Should().Be("Translation Overview 3"); translations[2].LanguageCode.Should().Be("Translation Language 3"); } }
public async Task Test_MovieCheckinPostResponseObjectJsonReader_ReadObject_From_Stream_Not_Valid_1() { var jsonReader = new MovieCheckinPostResponseObjectJsonReader(); using (var stream = JSON_NOT_VALID_1.ToStream()) { var checkinMovieResponse = await jsonReader.ReadObjectAsync(stream); checkinMovieResponse.Should().NotBeNull(); checkinMovieResponse.Id.Should().Be(0UL); checkinMovieResponse.WatchedAt.Should().Be(DateTime.Parse("2014-08-06T06:54:36.859Z").ToUniversalTime()); checkinMovieResponse.Sharing.Should().NotBeNull(); checkinMovieResponse.Sharing.Facebook.Should().BeTrue(); checkinMovieResponse.Sharing.Twitter.Should().BeTrue(); checkinMovieResponse.Sharing.Google.Should().BeTrue(); checkinMovieResponse.Sharing.Tumblr.Should().BeTrue(); checkinMovieResponse.Sharing.Medium.Should().BeTrue(); checkinMovieResponse.Sharing.Slack.Should().BeTrue(); checkinMovieResponse.Movie.Should().NotBeNull(); checkinMovieResponse.Movie.Title.Should().Be("Star Wars: The Force Awakens"); checkinMovieResponse.Movie.Year.Should().Be(2015); checkinMovieResponse.Movie.Ids.Should().NotBeNull(); checkinMovieResponse.Movie.Ids.Trakt.Should().Be(94024U); checkinMovieResponse.Movie.Ids.Slug.Should().Be("star-wars-the-force-awakens-2015"); checkinMovieResponse.Movie.Ids.Imdb.Should().Be("tt2488496"); checkinMovieResponse.Movie.Ids.Tmdb.Should().Be(140607U); } }
public async Task Test_EpisodeIdsArrayJsonReader_ReadArray_From_Stream_Not_Valid_1() { var traktJsonReader = new ArrayJsonReader <ITraktEpisodeIds>(); using (var stream = JSON_NOT_VALID_1.ToStream()) { var traktEpisodeIds = await traktJsonReader.ReadArrayAsync(stream); traktEpisodeIds.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(2); var episodeIds = traktEpisodeIds.ToArray(); episodeIds[0].Should().NotBeNull(); episodeIds[0].Trakt.Should().Be(0); episodeIds[0].Tvdb.Should().Be(3254641U); episodeIds[0].Imdb.Should().Be("tt1480055"); episodeIds[0].Tmdb.Should().Be(63056U); episodeIds[0].TvRage.Should().Be(1065008299U); episodeIds[0].HasAnyId.Should().BeTrue(); episodeIds[1].Should().NotBeNull(); episodeIds[1].Trakt.Should().Be(73640); episodeIds[1].Tvdb.Should().Be(3254641U); episodeIds[1].Imdb.Should().Be("tt1480055"); episodeIds[1].Tmdb.Should().Be(63056U); episodeIds[1].TvRage.Should().Be(1065008299U); episodeIds[1].HasAnyId.Should().BeTrue(); } }
public async Task Test_UserRatingsStatisticsObjectJsonReader_ReadObject_From_Stream_Not_Valid_1() { var jsonReader = new UserRatingsStatisticsObjectJsonReader(); using (var stream = JSON_NOT_VALID_1.ToStream()) { var userRatingsStatistics = await jsonReader.ReadObjectAsync(stream); userRatingsStatistics.Should().NotBeNull(); userRatingsStatistics.Total.Should().BeNull(); userRatingsStatistics.Distribution.Should().NotBeNull(); userRatingsStatistics.Distribution.Should().NotBeEmpty(); userRatingsStatistics.Distribution.Should().HaveCount(10); userRatingsStatistics.Distribution.Should().Contain(new Dictionary <string, int> { ["1"] = 78, ["2"] = 45, ["3"] = 55, ["4"] = 96, ["5"] = 183, ["6"] = 545, ["7"] = 1361, ["8"] = 2259, ["9"] = 1772, ["10"] = 2863 }); } }
public async Task Test_MovieScrobblePostResponseObjectJsonReader_ReadObject_From_Stream_Not_Valid_1() { var jsonReader = new MovieScrobblePostResponseObjectJsonReader(); using (var stream = JSON_NOT_VALID_1.ToStream()) { var movieScrobbleResponse = await jsonReader.ReadObjectAsync(stream); movieScrobbleResponse.Should().NotBeNull(); movieScrobbleResponse.Id.Should().Be(0UL); movieScrobbleResponse.Action.Should().Be(TraktScrobbleActionType.Stop); movieScrobbleResponse.Progress.Should().Be(85.9f); movieScrobbleResponse.Sharing.Should().NotBeNull(); movieScrobbleResponse.Sharing.Twitter.Should().BeTrue(); movieScrobbleResponse.Sharing.Google.Should().BeTrue(); movieScrobbleResponse.Sharing.Tumblr.Should().BeTrue(); movieScrobbleResponse.Sharing.Medium.Should().BeTrue(); movieScrobbleResponse.Sharing.Slack.Should().BeTrue(); movieScrobbleResponse.Movie.Should().NotBeNull(); movieScrobbleResponse.Movie.Title.Should().Be("Star Wars: The Force Awakens"); movieScrobbleResponse.Movie.Year.Should().Be(2015); movieScrobbleResponse.Movie.Ids.Should().NotBeNull(); movieScrobbleResponse.Movie.Ids.Trakt.Should().Be(94024U); movieScrobbleResponse.Movie.Ids.Slug.Should().Be("star-wars-the-force-awakens-2015"); movieScrobbleResponse.Movie.Ids.Imdb.Should().Be("tt2488496"); movieScrobbleResponse.Movie.Ids.Tmdb.Should().Be(140607U); } }
public async Task Test_AuthorizationArrayJsonReader_ReadObject_From_Stream_Not_Valid_1() { var objectJsonReader = new AuthorizationArrayJsonReader { CompleteDeserialization = true }; using (var stream = JSON_NOT_VALID_1.ToStream()) { IEnumerable <ITraktAuthorization> traktAuthorizations = await objectJsonReader.ReadArrayAsync(stream); traktAuthorizations.Should().NotBeNull(); ITraktAuthorization[] items = traktAuthorizations.ToArray(); items[0].Should().NotBeNull(); items[0].AccessToken.Should().BeNull(); items[0].RefreshToken.Should().Be("mockRefreshToken1"); items[0].Scope.Should().Be(TraktAccessScope.Public); items[0].ExpiresInSeconds.Should().Be(7200U); items[0].TokenType.Should().Be(TraktAccessTokenType.Bearer); items[0].CreatedAtTimestamp.Should().Be(1506271312UL); items[0].IgnoreExpiration.Should().BeTrue(); items[1].Should().NotBeNull(); items[1].AccessToken.Should().Be("mockAccessToken2"); items[1].RefreshToken.Should().Be("mockRefreshToken2"); items[1].Scope.Should().Be(TraktAccessScope.Public); items[1].ExpiresInSeconds.Should().Be(7200U); items[1].TokenType.Should().Be(TraktAccessTokenType.Bearer); items[1].CreatedAtTimestamp.Should().Be(1506271312UL); items[1].IgnoreExpiration.Should().BeTrue(); } }
public async Task Test_CalendarShowObjectJsonReader_ReadObject_From_Stream_Not_Valid_1() { var jsonReader = new CalendarShowObjectJsonReader(); using (var stream = JSON_NOT_VALID_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_RatingObjectJsonReader_ReadObject_From_Stream_Not_Valid_1() { var traktJsonReader = new RatingObjectJsonReader(); using (var stream = JSON_NOT_VALID_1.ToStream()) { var traktRating = await traktJsonReader.ReadObjectAsync(stream); traktRating.Should().NotBeNull(); traktRating.Rating.Should().BeNull(); traktRating.Votes.Should().Be(9274); traktRating.Distribution.Should().NotBeNull(); traktRating.Distribution.Should().NotBeEmpty(); traktRating.Distribution.Should().HaveCount(10); traktRating.Distribution.Should().Contain(new Dictionary <string, int> { ["1"] = 78, ["2"] = 45, ["3"] = 55, ["4"] = 96, ["5"] = 183, ["6"] = 545, ["7"] = 1361, ["8"] = 2259, ["9"] = 1772, ["10"] = 2863 }); } }
public async Task Test_MostPWCShowObjectJsonReader_ReadObject_From_Stream_Not_Valid_1() { var traktJsonReader = new MostPWCShowObjectJsonReader(); using (var stream = JSON_NOT_VALID_1.ToStream()) { var traktMostPWCShow = await traktJsonReader.ReadObjectAsync(stream); traktMostPWCShow.Should().NotBeNull(); traktMostPWCShow.WatcherCount.Should().BeNull(); traktMostPWCShow.PlayCount.Should().Be(7100); traktMostPWCShow.CollectedCount.Should().Be(1348); traktMostPWCShow.CollectorCount.Should().Be(7964); traktMostPWCShow.Show.Should().NotBeNull(); traktMostPWCShow.Show.Title.Should().Be("Game of Thrones"); traktMostPWCShow.Show.Year.Should().Be(2011); traktMostPWCShow.Show.Ids.Should().NotBeNull(); traktMostPWCShow.Show.Ids.Trakt.Should().Be(1390U); traktMostPWCShow.Show.Ids.Slug.Should().Be("game-of-thrones"); traktMostPWCShow.Show.Ids.Tvdb.Should().Be(121361U); traktMostPWCShow.Show.Ids.Imdb.Should().Be("tt0944947"); traktMostPWCShow.Show.Ids.Tmdb.Should().Be(1399U); traktMostPWCShow.Show.Ids.TvRage.Should().Be(24493U); } }
public async Task Test_SharingArrayJsonReader_ReadArray_From_Stream_Not_Valid_1() { var jsonReader = new ArrayJsonReader <ITraktSharing>(); using (var stream = JSON_NOT_VALID_1.ToStream()) { IEnumerable <ITraktSharing> traktSharings = await jsonReader.ReadArrayAsync(stream); traktSharings.Should().NotBeNull(); ITraktSharing[] sharings = traktSharings.ToArray(); sharings[0].Should().NotBeNull(); sharings[0].Twitter.Should().BeTrue(); sharings[0].Google.Should().BeTrue(); sharings[0].Tumblr.Should().BeTrue(); sharings[0].Medium.Should().BeTrue(); sharings[0].Slack.Should().BeTrue(); sharings[1].Should().NotBeNull(); sharings[1].Twitter.Should().BeNull(); sharings[1].Google.Should().BeTrue(); sharings[1].Tumblr.Should().BeTrue(); sharings[1].Medium.Should().BeTrue(); sharings[1].Slack.Should().BeTrue(); } }
public async Task Test_WatchedShowEpisodeArrayJsonReader_ReadArray_From_Stream_Not_Valid_1() { var jsonReader = new ArrayJsonReader <ITraktWatchedShowEpisode>(); using (var stream = JSON_NOT_VALID_1.ToStream()) { var traktWatchedShowEpisodes = await jsonReader.ReadArrayAsync(stream); traktWatchedShowEpisodes.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(3); var watchedShowEpisodes = traktWatchedShowEpisodes.ToArray(); watchedShowEpisodes[0].Should().NotBeNull(); watchedShowEpisodes[0].Number.Should().BeNull(); watchedShowEpisodes[0].Plays.Should().Be(1); watchedShowEpisodes[0].LastWatchedAt.Should().Be(DateTime.Parse("2014-10-12T17:00:54.000Z").ToUniversalTime()); watchedShowEpisodes[1].Should().NotBeNull(); watchedShowEpisodes[1].Number.Should().Be(2); watchedShowEpisodes[1].Plays.Should().Be(1); watchedShowEpisodes[1].LastWatchedAt.Should().Be(DateTime.Parse("2014-10-12T17:00:54.000Z").ToUniversalTime()); watchedShowEpisodes[2].Should().NotBeNull(); watchedShowEpisodes[2].Number.Should().Be(3); watchedShowEpisodes[2].Plays.Should().Be(1); watchedShowEpisodes[2].LastWatchedAt.Should().Be(DateTime.Parse("2014-10-12T17:00:54.000Z").ToUniversalTime()); } }
public async Task Test_CertificationsArrayJsonReader_ReadArray_From_Stream_Not_Valid_1() { var jsonReader = new ArrayJsonReader <ITraktCertifications>(); using (var stream = JSON_NOT_VALID_1.ToStream()) { IEnumerable <ITraktCertifications> multipleTraktCertifications = await jsonReader.ReadArrayAsync(stream); multipleTraktCertifications.Should().NotBeNull(); ITraktCertifications[] traktCertifications = multipleTraktCertifications.ToArray(); traktCertifications[0].Should().NotBeNull(); traktCertifications[0].US.Should().BeNull(); traktCertifications[1].Should().NotBeNull(); traktCertifications[1].US.Should().NotBeNull(); traktCertifications[1].US.Should().NotBeEmpty().And.HaveCount(2); ITraktCertification[] certifications = traktCertifications[1].US.ToArray(); certifications[0].Should().NotBeNull(); certifications[0].Name.Should().Be("PG"); certifications[0].Slug.Should().Be("pg"); certifications[0].Description.Should().Be("Parental Guidance Suggested"); certifications[1].Should().NotBeNull(); certifications[1].Name.Should().Be("PG-13"); certifications[1].Slug.Should().Be("pg-13"); certifications[1].Description.Should().Be("Parents Strongly Cautioned - Ages 13+ Recommended"); } }
public async Task Test_CrewMemberArrayJsonReader_ReadObject_From_Stream_Not_Valid_1() { var jsonReader = new CrewMemberArrayJsonReader(); using (var stream = JSON_NOT_VALID_1.ToStream()) { var traktCrewMembers = await jsonReader.ReadArrayAsync(stream); traktCrewMembers.Should().NotBeNull(); var items = traktCrewMembers.ToArray(); items[0].Should().NotBeNull(); items[0].Job.Should().BeNull(); items[0].Person.Should().NotBeNull(); items[0].Person.Name.Should().Be("Bryan Cranston"); items[0].Person.Ids.Should().NotBeNull(); items[0].Person.Ids.Trakt.Should().Be(297737U); items[0].Person.Ids.Slug.Should().Be("bryan-cranston"); items[0].Person.Ids.Imdb.Should().Be("nm0186505"); items[0].Person.Ids.Tmdb.Should().Be(17419U); items[0].Person.Ids.TvRage.Should().Be(1797U); items[1].Should().NotBeNull(); items[1].Job.Should().Be("Director"); items[1].Person.Should().NotBeNull(); items[1].Person.Name.Should().Be("Samuel L.Jackson"); items[1].Person.Ids.Should().NotBeNull(); items[1].Person.Ids.Trakt.Should().Be(9486U); items[1].Person.Ids.Slug.Should().Be("samuel-l-jackson"); items[1].Person.Ids.Imdb.Should().Be("nm0000168"); items[1].Person.Ids.Tmdb.Should().Be(2231U); items[1].Person.Ids.TvRage.Should().Be(55720U); } }
public async Task Test_SeasonCollectionProgressObjectJsonReader_ReadObject_From_Stream_Not_Valid_1() { var traktJsonReader = new SeasonCollectionProgressObjectJsonReader(); using (var stream = JSON_NOT_VALID_1.ToStream()) { var traktSeasonCollectionProgress = await traktJsonReader.ReadObjectAsync(stream); traktSeasonCollectionProgress.Should().NotBeNull(); traktSeasonCollectionProgress.Number.Should().BeNull(); traktSeasonCollectionProgress.Aired.Should().Be(3); traktSeasonCollectionProgress.Completed.Should().Be(2); traktSeasonCollectionProgress.Episodes.Should().NotBeNull().And.HaveCount(2); var episodesCollectionProgress = traktSeasonCollectionProgress.Episodes.ToArray(); episodesCollectionProgress[0].Should().NotBeNull(); episodesCollectionProgress[0].Number.Should().Be(1); episodesCollectionProgress[0].Completed.Should().BeTrue(); episodesCollectionProgress[0].CollectedAt.Should().Be(DateTime.Parse("2011-04-18T01:00:00.000Z").ToUniversalTime()); episodesCollectionProgress[1].Should().NotBeNull(); episodesCollectionProgress[1].Number.Should().Be(2); episodesCollectionProgress[1].Completed.Should().BeTrue(); episodesCollectionProgress[1].CollectedAt.Should().Be(DateTime.Parse("2011-04-19T02:00:00.000Z").ToUniversalTime()); } }
public async Task Test_CommentLikeArrayJsonReader_ReadArray_From_Stream_Not_Valid_1() { var jsonReader = new ArrayJsonReader <ITraktCommentLike>(); using (var stream = JSON_NOT_VALID_1.ToStream()) { IEnumerable <ITraktCommentLike> traktCommentLikes = await jsonReader.ReadArrayAsync(stream); traktCommentLikes.Should().NotBeNull(); ITraktCommentLike[] commentLikes = traktCommentLikes.ToArray(); commentLikes[0].Should().NotBeNull(); commentLikes[0].LikedAt.Should().BeNull(); commentLikes[0].User.Should().NotBeNull(); commentLikes[0].User.Username.Should().Be("sean"); commentLikes[0].User.IsPrivate.Should().BeFalse(); commentLikes[0].User.Name.Should().Be("Sean Rudford"); commentLikes[0].User.IsVIP.Should().BeTrue(); commentLikes[0].User.IsVIP_EP.Should().BeFalse(); commentLikes[0].User.Ids.Should().NotBeNull(); commentLikes[0].User.Ids.Slug.Should().Be("sean"); commentLikes[1].Should().NotBeNull(); commentLikes[1].LikedAt.Should().Be(DateTime.Parse("2014-10-11T17:00:54.000Z").ToUniversalTime()); commentLikes[1].User.Should().NotBeNull(); commentLikes[1].User.Username.Should().Be("sean"); commentLikes[1].User.IsPrivate.Should().BeFalse(); commentLikes[1].User.Name.Should().Be("Sean Rudford"); commentLikes[1].User.IsVIP.Should().BeTrue(); commentLikes[1].User.IsVIP_EP.Should().BeFalse(); commentLikes[1].User.Ids.Should().NotBeNull(); commentLikes[1].User.Ids.Slug.Should().Be("sean"); } }
public async Task Test_WatchedShowObjectJsonReader_ReadObject_From_Stream_Not_Valid_1() { var jsonReader = new WatchedShowObjectJsonReader(); using (var stream = JSON_NOT_VALID_1.ToStream()) { var traktWatchedShow = await jsonReader.ReadObjectAsync(stream); traktWatchedShow.Should().NotBeNull(); traktWatchedShow.Plays.Should().BeNull(); traktWatchedShow.LastWatchedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); traktWatchedShow.Show.Should().NotBeNull(); traktWatchedShow.Show.Title.Should().Be("Game of Thrones"); traktWatchedShow.Show.Year.Should().Be(2011); traktWatchedShow.Show.Ids.Should().NotBeNull(); traktWatchedShow.Show.Ids.Trakt.Should().Be(1390U); traktWatchedShow.Show.Ids.Slug.Should().Be("game-of-thrones"); traktWatchedShow.Show.Ids.Tvdb.Should().Be(121361U); traktWatchedShow.Show.Ids.Imdb.Should().Be("tt0944947"); traktWatchedShow.Show.Ids.Tmdb.Should().Be(1399U); traktWatchedShow.Show.Ids.TvRage.Should().Be(24493U); traktWatchedShow.WatchedSeasons.Should().NotBeNull().And.HaveCount(2); var seasons = traktWatchedShow.WatchedSeasons.ToArray(); seasons[0].Should().NotBeNull(); seasons[0].Number.Should().Be(1); seasons[0].Episodes.Should().NotBeNull().And.HaveCount(2); var episodes = seasons[0].Episodes.ToArray(); episodes[0].Should().NotBeNull(); episodes[0].Number.Should().Be(1); episodes[0].Plays.Should().Be(1); episodes[0].LastWatchedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); episodes[1].Should().NotBeNull(); episodes[1].Number.Should().Be(2); episodes[1].Plays.Should().Be(1); episodes[1].LastWatchedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); seasons[1].Should().NotBeNull(); seasons[1].Number.Should().Be(2); seasons[1].Episodes.Should().NotBeNull().And.HaveCount(2); episodes = seasons[1].Episodes.ToArray(); episodes[0].Should().NotBeNull(); episodes[0].Number.Should().Be(1); episodes[0].Plays.Should().Be(1); episodes[0].LastWatchedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); episodes[1].Should().NotBeNull(); episodes[1].Number.Should().Be(2); episodes[1].Plays.Should().Be(1); episodes[1].LastWatchedAt.Should().Be(DateTime.Parse("2014-09-01T09:10:11.000Z").ToUniversalTime()); } }
public async Task Test_CalendarShowArrayJsonReader_ReadArray_From_Stream_Not_Valid_1() { var jsonReader = new ArrayJsonReader <ITraktCalendarShow>(); using (var stream = JSON_NOT_VALID_1.ToStream()) { IEnumerable <ITraktCalendarShow> traktCalendarShows = await jsonReader.ReadArrayAsync(stream); traktCalendarShows.Should().NotBeNull(); ITraktCalendarShow[] calendarShows = traktCalendarShows.ToArray(); calendarShows[0].Should().NotBeNull(); calendarShows[0].FirstAiredInCalendar.Should().Be(DateTime.Parse("2014-07-14T01:00:00.000Z").ToUniversalTime()); calendarShows[0].Show.Should().NotBeNull(); calendarShows[0].Show.Title.Should().Be("Game of Thrones"); calendarShows[0].Show.Year.Should().Be(2011); calendarShows[0].Show.Ids.Should().NotBeNull(); calendarShows[0].Show.Ids.Trakt.Should().Be(1390U); calendarShows[0].Show.Ids.Slug.Should().Be("game-of-thrones"); calendarShows[0].Show.Ids.Tvdb.Should().Be(121361U); calendarShows[0].Show.Ids.Imdb.Should().Be("tt0944947"); calendarShows[0].Show.Ids.Tmdb.Should().Be(1399U); calendarShows[0].Show.Ids.TvRage.Should().Be(24493U); calendarShows[0].Episode.Should().NotBeNull(); calendarShows[0].Episode.SeasonNumber.Should().Be(1); calendarShows[0].Episode.Number.Should().Be(1); calendarShows[0].Episode.Title.Should().Be("Winter Is Coming"); calendarShows[0].Episode.Ids.Should().NotBeNull(); calendarShows[0].Episode.Ids.Trakt.Should().Be(73640U); calendarShows[0].Episode.Ids.Tvdb.Should().Be(3254641U); calendarShows[0].Episode.Ids.Imdb.Should().Be("tt1480055"); calendarShows[0].Episode.Ids.Tmdb.Should().Be(63056U); calendarShows[0].Episode.Ids.TvRage.Should().Be(1065008299U); calendarShows[1].Should().NotBeNull(); calendarShows[1].FirstAiredInCalendar.Should().BeNull(); calendarShows[1].Show.Should().NotBeNull(); calendarShows[1].Show.Title.Should().Be("Game of Thrones"); calendarShows[1].Show.Year.Should().Be(2011); calendarShows[1].Show.Ids.Should().NotBeNull(); calendarShows[1].Show.Ids.Trakt.Should().Be(1390U); calendarShows[1].Show.Ids.Slug.Should().Be("game-of-thrones"); calendarShows[1].Show.Ids.Tvdb.Should().Be(121361U); calendarShows[1].Show.Ids.Imdb.Should().Be("tt0944947"); calendarShows[1].Show.Ids.Tmdb.Should().Be(1399U); calendarShows[1].Show.Ids.TvRage.Should().Be(24493U); calendarShows[1].Episode.Should().NotBeNull(); calendarShows[1].Episode.SeasonNumber.Should().Be(1); calendarShows[1].Episode.Number.Should().Be(1); calendarShows[1].Episode.Title.Should().Be("Winter Is Coming"); calendarShows[1].Episode.Ids.Should().NotBeNull(); calendarShows[1].Episode.Ids.Trakt.Should().Be(73640U); calendarShows[1].Episode.Ids.Tvdb.Should().Be(3254641U); calendarShows[1].Episode.Ids.Imdb.Should().Be("tt1480055"); calendarShows[1].Episode.Ids.Tmdb.Should().Be(63056U); calendarShows[1].Episode.Ids.TvRage.Should().Be(1065008299U); } }
public async Task Test_UserStatisticsObjectJsonReader_ReadObject_From_Stream_Not_Valid_1() { var jsonReader = new UserStatisticsObjectJsonReader(); using (var stream = JSON_NOT_VALID_1.ToStream()) { var userStatistics = await jsonReader.ReadObjectAsync(stream); userStatistics.Should().NotBeNull(); userStatistics.Movies.Should().BeNull(); userStatistics.Shows.Should().NotBeNull(); userStatistics.Shows.Watched.Should().Be(534); userStatistics.Shows.Collected.Should().Be(117); userStatistics.Shows.Ratings.Should().Be(64); userStatistics.Shows.Comments.Should().Be(14); userStatistics.Seasons.Should().NotBeNull(); userStatistics.Seasons.Ratings.Should().Be(6); userStatistics.Seasons.Comments.Should().Be(1); userStatistics.Episodes.Should().NotBeNull(); userStatistics.Episodes.Plays.Should().Be(552); userStatistics.Episodes.Watched.Should().Be(534); userStatistics.Episodes.Minutes.Should().Be(17330); userStatistics.Episodes.Collected.Should().Be(117); userStatistics.Episodes.Ratings.Should().Be(64); userStatistics.Episodes.Comments.Should().Be(14); userStatistics.Network.Should().NotBeNull(); userStatistics.Network.Friends.Should().Be(1); userStatistics.Network.Followers.Should().Be(4); userStatistics.Network.Following.Should().Be(11); userStatistics.Ratings.Should().NotBeNull(); userStatistics.Ratings.Total.Should().Be(9257); userStatistics.Ratings.Distribution.Should().NotBeNull(); userStatistics.Ratings.Distribution.Should().NotBeEmpty(); userStatistics.Ratings.Distribution.Should().HaveCount(10); userStatistics.Ratings.Distribution.Should().Contain(new Dictionary <string, int> { ["1"] = 78, ["2"] = 45, ["3"] = 55, ["4"] = 96, ["5"] = 183, ["6"] = 545, ["7"] = 1361, ["8"] = 2259, ["9"] = 1772, ["10"] = 2863 }); } }
public async Task Test_RatingArrayJsonReader_ReadArray_From_Stream_Not_Valid_1() { var jsonReader = new ArrayJsonReader <ITraktRating>(); using (var stream = JSON_NOT_VALID_1.ToStream()) { IEnumerable <ITraktRating> traktRatings = await jsonReader.ReadArrayAsync(stream); traktRatings.Should().NotBeNull(); ITraktRating[] ratings = traktRatings.ToArray(); ratings[0].Should().NotBeNull(); ratings[0].Rating.Should().BeNull(); ratings[0].Votes.Should().Be(9274); ratings[0].Distribution.Should().NotBeNull(); ratings[0].Distribution.Should().NotBeEmpty(); ratings[0].Distribution.Should().HaveCount(10); ratings[0].Distribution.Should().Contain(new Dictionary <string, int> { ["1"] = 78, ["2"] = 45, ["3"] = 55, ["4"] = 96, ["5"] = 183, ["6"] = 545, ["7"] = 1361, ["8"] = 2259, ["9"] = 1772, ["10"] = 2863 }); ratings[1].Should().NotBeNull(); ratings[1].Rating.Should().Be(8.32715f); ratings[1].Votes.Should().Be(9274); ratings[1].Distribution.Should().NotBeNull(); ratings[1].Distribution.Should().NotBeEmpty(); ratings[1].Distribution.Should().HaveCount(10); ratings[1].Distribution.Should().Contain(new Dictionary <string, int> { ["1"] = 78, ["2"] = 45, ["3"] = 55, ["4"] = 96, ["5"] = 183, ["6"] = 545, ["7"] = 1361, ["8"] = 2259, ["9"] = 1772, ["10"] = 2863 }); } }
public async Task Test_CommentArrayJsonReader_ReadArray_From_Stream_Not_Valid_1() { var jsonReader = new ArrayJsonReader <ITraktComment>(); using (var stream = JSON_NOT_VALID_1.ToStream()) { IEnumerable <ITraktComment> traktComments = await jsonReader.ReadArrayAsync(stream); traktComments.Should().NotBeNull(); ITraktComment[] comments = traktComments.ToArray(); comments[0].Should().NotBeNull(); comments[0].Id.Should().Be(0U); comments[0].ParentId.Should().Be(1234U); comments[0].CreatedAt.Should().Be(DateTime.Parse("2016-04-01T12:44:40Z").ToUniversalTime()); comments[0].UpdatedAt.Should().Be(DateTime.Parse("2016-04-03T08:23:38Z").ToUniversalTime()); comments[0].Comment.Should().Be("I hate they made The flash a kids show. Could else be much better. And with a better flash offcourse."); comments[0].Spoiler.Should().BeFalse(); comments[0].Review.Should().BeFalse(); comments[0].Replies.Should().Be(1); comments[0].Likes.Should().Be(2); comments[0].UserRating.Should().Be(7.3f); comments[0].User.Should().NotBeNull(); comments[0].User.Username.Should().Be("sean"); comments[0].User.IsPrivate.Should().BeFalse(); comments[0].User.Name.Should().Be("Sean Rudford"); comments[0].User.IsVIP.Should().BeTrue(); comments[0].User.IsVIP_EP.Should().BeTrue(); comments[0].User.Ids.Should().NotBeNull(); comments[0].User.Ids.Slug.Should().Be("sean"); comments[1].Should().NotBeNull(); comments[1].Id.Should().Be(76957U); comments[1].ParentId.Should().Be(1234U); comments[1].CreatedAt.Should().Be(DateTime.Parse("2016-04-01T12:44:40Z").ToUniversalTime()); comments[1].UpdatedAt.Should().Be(DateTime.Parse("2016-04-03T08:23:38Z").ToUniversalTime()); comments[1].Comment.Should().Be("I hate they made The flash a kids show. Could else be much better. And with a better flash offcourse."); comments[1].Spoiler.Should().BeFalse(); comments[1].Review.Should().BeFalse(); comments[1].Replies.Should().Be(1); comments[1].Likes.Should().Be(2); comments[1].UserRating.Should().Be(7.3f); comments[1].User.Should().NotBeNull(); comments[1].User.Username.Should().Be("sean"); comments[1].User.IsPrivate.Should().BeFalse(); comments[1].User.Name.Should().Be("Sean Rudford"); comments[1].User.IsVIP.Should().BeTrue(); comments[1].User.IsVIP_EP.Should().BeTrue(); comments[1].User.Ids.Should().NotBeNull(); comments[1].User.Ids.Slug.Should().Be("sean"); } }