示例#1
0
        public async Task Test_StatisticsObjectJsonReader_ReadObject_From_Stream_Incomplete_14()
        {
            var traktJsonReader = new StatisticsObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_14.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().Be(9274);
            }
        }
        public async Task Test_SyncMoviesLastActivitiesObjectJsonReader_ReadObject_From_Stream_Incomplete_14()
        {
            var jsonReader = new SyncMoviesLastActivitiesObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_14.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().Be(DateTime.Parse("2014-11-20T06:51:30.250Z").ToUniversalTime());
            }
        }
示例#3
0
        public async Task Test_AuthorizationObjectJsonReader_ReadObject_From_Stream_Incomplete_14()
        {
            var objectJsonReader = new AuthorizationObjectJsonReader
            {
                CompleteDeserialization = true
            };

            using (var stream = JSON_INCOMPLETE_14.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().BeTrue();
            }
        }
        public async Task Test_UserObjectJsonReader_ReadObject_From_Stream_Incomplete_14()
        {
            var jsonReader = new UserObjectJsonReader();

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

                user.Should().NotBeNull();
                user.Username.Should().BeNull();
                user.IsPrivate.Should().BeFalse();
                user.Name.Should().BeNull();
                user.IsVIP.Should().BeNull();
                user.IsVIP_EP.Should().BeNull();
                user.Ids.Should().BeNull();
                user.JoinedAt.Should().BeNull();
                user.Location.Should().BeNull();
                user.About.Should().BeNull();
                user.Gender.Should().BeNull();
                user.Age.Should().BeNull();
                user.Images.Should().BeNull();
            }
        }