Exemple #1
0
        public async Task Test_SyncEpisodesLastActivitiesObjectJsonReader_ReadObject_From_Stream_Not_Valid_7()
        {
            var jsonReader = new SyncEpisodesLastActivitiesObjectJsonReader();

            using (var stream = JSON_NOT_VALID_7.ToStream())
            {
                var episodesLastActivities = await jsonReader.ReadObjectAsync(stream);

                episodesLastActivities.Should().NotBeNull();
                episodesLastActivities.WatchedAt.Should().BeNull();
                episodesLastActivities.CollectedAt.Should().BeNull();
                episodesLastActivities.RatedAt.Should().BeNull();
                episodesLastActivities.WatchlistedAt.Should().BeNull();
                episodesLastActivities.CommentedAt.Should().BeNull();
                episodesLastActivities.PausedAt.Should().BeNull();
            }
        }
Exemple #2
0
        public async Task Test_SyncEpisodesLastActivitiesObjectJsonReader_ReadObject_From_Stream_Not_Valid_6()
        {
            var jsonReader = new SyncEpisodesLastActivitiesObjectJsonReader();

            using (var stream = JSON_NOT_VALID_6.ToStream())
            {
                var episodesLastActivities = await jsonReader.ReadObjectAsync(stream);

                episodesLastActivities.Should().NotBeNull();
                episodesLastActivities.WatchedAt.Should().Be(DateTime.Parse("2014-11-20T06:51:30.305Z").ToUniversalTime());
                episodesLastActivities.CollectedAt.Should().Be(DateTime.Parse("2014-11-19T22:02:41.308Z").ToUniversalTime());
                episodesLastActivities.RatedAt.Should().Be(DateTime.Parse("2014-11-20T06:51:30.310Z").ToUniversalTime());
                episodesLastActivities.WatchlistedAt.Should().Be(DateTime.Parse("2014-11-20T06:51:30.321Z").ToUniversalTime());
                episodesLastActivities.CommentedAt.Should().Be(DateTime.Parse("2014-11-20T06:51:30.325Z").ToUniversalTime());
                episodesLastActivities.PausedAt.Should().BeNull();
            }
        }
Exemple #3
0
        public async Task Test_SyncEpisodesLastActivitiesObjectJsonReader_ReadObject_From_Stream_Incomplete_12()
        {
            var jsonReader = new SyncEpisodesLastActivitiesObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_12.ToStream())
            {
                var episodesLastActivities = await jsonReader.ReadObjectAsync(stream);

                episodesLastActivities.Should().NotBeNull();
                episodesLastActivities.WatchedAt.Should().BeNull();
                episodesLastActivities.CollectedAt.Should().BeNull();
                episodesLastActivities.RatedAt.Should().BeNull();
                episodesLastActivities.WatchlistedAt.Should().BeNull();
                episodesLastActivities.CommentedAt.Should().BeNull();
                episodesLastActivities.PausedAt.Should().Be(DateTime.Parse("2014-11-20T06:51:30.250Z").ToUniversalTime());
            }
        }
Exemple #4
0
        public async Task Test_SyncEpisodesLastActivitiesObjectJsonReader_ReadObject_From_JsonReader_Incomplete_4()
        {
            var traktJsonReader = new SyncEpisodesLastActivitiesObjectJsonReader();

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

                    episodesLastActivities.Should().NotBeNull();
                    episodesLastActivities.WatchedAt.Should().Be(DateTime.Parse("2014-11-20T06:51:30.305Z").ToUniversalTime());
                    episodesLastActivities.CollectedAt.Should().Be(DateTime.Parse("2014-11-19T22:02:41.308Z").ToUniversalTime());
                    episodesLastActivities.RatedAt.Should().Be(DateTime.Parse("2014-11-20T06:51:30.310Z").ToUniversalTime());
                    episodesLastActivities.WatchlistedAt.Should().BeNull();
                    episodesLastActivities.CommentedAt.Should().Be(DateTime.Parse("2014-11-20T06:51:30.325Z").ToUniversalTime());
                    episodesLastActivities.PausedAt.Should().Be(DateTime.Parse("2014-11-20T06:51:30.250Z").ToUniversalTime());
                }
        }
Exemple #5
0
        public async Task Test_SyncEpisodesLastActivitiesObjectJsonReader_ReadObject_From_JsonReader_Not_Valid_7()
        {
            var traktJsonReader = new SyncEpisodesLastActivitiesObjectJsonReader();

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

                    episodesLastActivities.Should().NotBeNull();
                    episodesLastActivities.WatchedAt.Should().BeNull();
                    episodesLastActivities.CollectedAt.Should().BeNull();
                    episodesLastActivities.RatedAt.Should().BeNull();
                    episodesLastActivities.WatchlistedAt.Should().BeNull();
                    episodesLastActivities.CommentedAt.Should().BeNull();
                    episodesLastActivities.PausedAt.Should().BeNull();
                }
        }
 public async Task Test_SyncEpisodesLastActivitiesObjectJsonReader_ReadObject_From_Stream_Null()
 {
     var jsonReader = new SyncEpisodesLastActivitiesObjectJsonReader();
     Func <Task <ITraktSyncEpisodesLastActivities> > episodesLastActivities = () => jsonReader.ReadObjectAsync(default(Stream));
     await episodesLastActivities.Should().ThrowAsync <ArgumentNullException>();
 }