public async Task Test_UserObjectJsonReader_ReadObject_From_Stream_Not_Valid_8()
        {
            var jsonReader = new UserObjectJsonReader();

            using (var stream = JSON_NOT_VALID_8.ToStream())
            {
                var user = await jsonReader.ReadObjectAsync(stream);

                user.Should().NotBeNull();
                user.Username.Should().Be("sean");
                user.IsPrivate.Should().BeFalse();
                user.Name.Should().Be("Sean Rudford");
                user.IsVIP.Should().BeTrue();
                user.IsVIP_EP.Should().BeTrue();
                user.Ids.Should().NotBeNull();
                user.Ids.Slug.Should().Be("sean");
                user.JoinedAt.Should().HaveValue().And.Be(DateTime.Parse("2010-09-25T17:49:25.000Z").ToUniversalTime());
                user.Location.Should().BeNull();
                user.About.Should().Be("I have all your cassette tapes.");
                user.Gender.Should().Be("male");
                user.Age.Should().Be(35);
                user.Images.Should().NotBeNull();
                user.Images.Avatar.Should().NotBeNull();
                user.Images.Avatar.Full.Should().Be("https://walter-dev.trakt.tv/images/users/000/000/001/avatars/large/0ba3f72910.jpg");
            }
        }
Beispiel #2
0
        public async Task Test_StatisticsObjectJsonReader_ReadObject_From_Stream_Not_Valid_8()
        {
            var traktJsonReader = new StatisticsObjectJsonReader();

            using (var stream = JSON_NOT_VALID_8.ToStream())
            {
                var traktStatistics = await traktJsonReader.ReadObjectAsync(stream);

                traktStatistics.Should().NotBeNull();
                traktStatistics.Watchers.Should().BeNull();
                traktStatistics.Plays.Should().BeNull();
                traktStatistics.Collectors.Should().BeNull();
                traktStatistics.CollectedEpisodes.Should().BeNull();
                traktStatistics.Comments.Should().BeNull();
                traktStatistics.Lists.Should().BeNull();
                traktStatistics.Votes.Should().BeNull();
            }
        }
        public async Task Test_SyncMoviesLastActivitiesObjectJsonReader_ReadObject_From_Stream_Not_Valid_8()
        {
            var jsonReader = new SyncMoviesLastActivitiesObjectJsonReader();

            using (var stream = JSON_NOT_VALID_8.ToStream())
            {
                var moviesLastActivities = await jsonReader.ReadObjectAsync(stream);

                moviesLastActivities.Should().NotBeNull();
                moviesLastActivities.WatchedAt.Should().BeNull();
                moviesLastActivities.CollectedAt.Should().BeNull();
                moviesLastActivities.RatedAt.Should().BeNull();
                moviesLastActivities.WatchlistedAt.Should().BeNull();
                moviesLastActivities.CommentedAt.Should().BeNull();
                moviesLastActivities.PausedAt.Should().BeNull();
                moviesLastActivities.HiddenAt.Should().BeNull();
            }
        }
Beispiel #4
0
        public async Task Test_AuthorizationObjectJsonReader_ReadObject_From_Stream_Not_Valid_8()
        {
            var objectJsonReader = new AuthorizationObjectJsonReader
            {
                CompleteDeserialization = true
            };

            using (var stream = JSON_NOT_VALID_8.ToStream())
            {
                ITraktAuthorization traktAuthorization = await objectJsonReader.ReadObjectAsync(stream);

                traktAuthorization.Should().NotBeNull();
                traktAuthorization.AccessToken.Should().BeNull();
                traktAuthorization.RefreshToken.Should().BeNull();
                traktAuthorization.Scope.Should().BeNull();
                traktAuthorization.ExpiresInSeconds.Should().Be(0);
                traktAuthorization.TokenType.Should().BeNull();
                traktAuthorization.CreatedAtTimestamp.Should().Be(0);
                traktAuthorization.IgnoreExpiration.Should().BeFalse();
            }
        }