public void Test_EpisodeCollectionProgressObjectJsonReader_ReadObject_From_Json_String_Null()
        {
            var jsonReader = new EpisodeCollectionProgressObjectJsonReader();
            Func <Task <ITraktEpisodeCollectionProgress> > traktEpisodeCollectionProgress = () => jsonReader.ReadObjectAsync(default(string));

            traktEpisodeCollectionProgress.Should().Throw <ArgumentNullException>();
        }
        public async Task Test_EpisodeCollectionProgressObjectJsonReader_ReadObject_From_Json_String_Empty()
        {
            var jsonReader = new EpisodeCollectionProgressObjectJsonReader();

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

            traktEpisodeCollectionProgress.Should().BeNull();
        }
        public async Task Test_EpisodeCollectionProgressObjectJsonReader_ReadObject_From_JsonReader_Null()
        {
            var traktJsonReader = new EpisodeCollectionProgressObjectJsonReader();

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

            traktEpisodeCollectionProgress.Should().BeNull();
        }
        public async Task Test_TraktEpisodeCollectionProgressCollectionProgress_From_Json()
        {
            var jsonReader = new EpisodeCollectionProgressObjectJsonReader();
            var episodeCollectionProgress = await jsonReader.ReadObjectAsync(JSON) as TraktEpisodeCollectionProgress;

            episodeCollectionProgress.Should().NotBeNull();
            episodeCollectionProgress.Number.Should().Be(2);
            episodeCollectionProgress.Completed.Should().BeTrue();
            episodeCollectionProgress.CollectedAt.Should().Be(DateTime.Parse("2011-04-18T01:00:00.000Z").ToUniversalTime());
        }
        public async Task Test_EpisodeCollectionProgressObjectJsonReader_ReadObject_From_Json_String_Incomplete_6()
        {
            var jsonReader = new EpisodeCollectionProgressObjectJsonReader();

            var traktEpisodeCollectionProgress = await jsonReader.ReadObjectAsync(JSON_INCOMPLETE_6);

            traktEpisodeCollectionProgress.Should().NotBeNull();
            traktEpisodeCollectionProgress.Number.Should().BeNull();
            traktEpisodeCollectionProgress.Completed.Should().BeNull();
            traktEpisodeCollectionProgress.CollectedAt.Should().Be(DateTime.Parse("2011-04-18T01:00:00.000Z").ToUniversalTime());
        }
        public async Task Test_EpisodeCollectionProgressObjectJsonReader_ReadObject_From_Json_String_Incomplete_5()
        {
            var jsonReader = new EpisodeCollectionProgressObjectJsonReader();

            var traktEpisodeCollectionProgress = await jsonReader.ReadObjectAsync(JSON_INCOMPLETE_5);

            traktEpisodeCollectionProgress.Should().NotBeNull();
            traktEpisodeCollectionProgress.Number.Should().BeNull();
            traktEpisodeCollectionProgress.Completed.Should().BeTrue();
            traktEpisodeCollectionProgress.CollectedAt.Should().BeNull();
        }
        public async Task Test_EpisodeCollectionProgressObjectJsonReader_ReadObject_From_Json_String_Not_Valid_4()
        {
            var jsonReader = new EpisodeCollectionProgressObjectJsonReader();

            var traktEpisodeCollectionProgress = await jsonReader.ReadObjectAsync(JSON_NOT_VALID_4);

            traktEpisodeCollectionProgress.Should().NotBeNull();
            traktEpisodeCollectionProgress.Number.Should().BeNull();
            traktEpisodeCollectionProgress.Completed.Should().BeNull();
            traktEpisodeCollectionProgress.CollectedAt.Should().BeNull();
        }
        public async Task Test_EpisodeCollectionProgressObjectJsonReader_ReadObject_From_Stream_Empty()
        {
            var traktJsonReader = new EpisodeCollectionProgressObjectJsonReader();

            using (var stream = string.Empty.ToStream())
            {
                var traktEpisodeCollectionProgress = await traktJsonReader.ReadObjectAsync(stream);

                traktEpisodeCollectionProgress.Should().BeNull();
            }
        }
        public async Task Test_EpisodeCollectionProgressObjectJsonReader_ReadObject_From_JsonReader_Empty()
        {
            var traktJsonReader = new EpisodeCollectionProgressObjectJsonReader();

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

                    traktEpisodeCollectionProgress.Should().BeNull();
                }
        }
        public async Task Test_EpisodeCollectionProgressObjectJsonReader_ReadObject_From_Stream_Incomplete_5()
        {
            var traktJsonReader = new EpisodeCollectionProgressObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_5.ToStream())
            {
                var traktEpisodeCollectionProgress = await traktJsonReader.ReadObjectAsync(stream);

                traktEpisodeCollectionProgress.Should().NotBeNull();
                traktEpisodeCollectionProgress.Number.Should().BeNull();
                traktEpisodeCollectionProgress.Completed.Should().BeTrue();
                traktEpisodeCollectionProgress.CollectedAt.Should().BeNull();
            }
        }
        public async Task Test_EpisodeCollectionProgressObjectJsonReader_ReadObject_From_Stream_Incomplete_2()
        {
            var traktJsonReader = new EpisodeCollectionProgressObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_2.ToStream())
            {
                var traktEpisodeCollectionProgress = await traktJsonReader.ReadObjectAsync(stream);

                traktEpisodeCollectionProgress.Should().NotBeNull();
                traktEpisodeCollectionProgress.Number.Should().Be(2);
                traktEpisodeCollectionProgress.Completed.Should().BeNull();
                traktEpisodeCollectionProgress.CollectedAt.Should().Be(DateTime.Parse("2011-04-18T01:00:00.000Z").ToUniversalTime());
            }
        }
        public async Task Test_EpisodeCollectionProgressObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var traktJsonReader = new EpisodeCollectionProgressObjectJsonReader();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var traktEpisodeCollectionProgress = await traktJsonReader.ReadObjectAsync(stream);

                traktEpisodeCollectionProgress.Should().NotBeNull();
                traktEpisodeCollectionProgress.Number.Should().BeNull();
                traktEpisodeCollectionProgress.Completed.Should().BeNull();
                traktEpisodeCollectionProgress.CollectedAt.Should().BeNull();
            }
        }
        public async Task Test_EpisodeCollectionProgressObjectJsonReader_ReadObject_From_JsonReader_Incomplete_4()
        {
            var traktJsonReader = new EpisodeCollectionProgressObjectJsonReader();

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

                    traktEpisodeCollectionProgress.Should().NotBeNull();
                    traktEpisodeCollectionProgress.Number.Should().Be(2);
                    traktEpisodeCollectionProgress.Completed.Should().BeNull();
                    traktEpisodeCollectionProgress.CollectedAt.Should().BeNull();
                }
        }
        public async Task Test_EpisodeCollectionProgressObjectJsonReader_ReadObject_From_JsonReader_Incomplete_1()
        {
            var traktJsonReader = new EpisodeCollectionProgressObjectJsonReader();

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

                    traktEpisodeCollectionProgress.Should().NotBeNull();
                    traktEpisodeCollectionProgress.Number.Should().BeNull();
                    traktEpisodeCollectionProgress.Completed.Should().BeTrue();
                    traktEpisodeCollectionProgress.CollectedAt.Should().Be(DateTime.Parse("2011-04-18T01:00:00.000Z").ToUniversalTime());
                }
        }
        public async Task Test_EpisodeCollectionProgressObjectJsonReader_ReadObject_From_JsonReader_Not_Valid_3()
        {
            var traktJsonReader = new EpisodeCollectionProgressObjectJsonReader();

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

                    traktEpisodeCollectionProgress.Should().NotBeNull();
                    traktEpisodeCollectionProgress.Number.Should().Be(2);
                    traktEpisodeCollectionProgress.Completed.Should().BeTrue();
                    traktEpisodeCollectionProgress.CollectedAt.Should().BeNull();
                }
        }
示例#16
0
 public async Task Test_EpisodeCollectionProgressObjectJsonReader_ReadObject_From_Stream_Null()
 {
     var traktJsonReader = new EpisodeCollectionProgressObjectJsonReader();
     Func <Task <ITraktEpisodeCollectionProgress> > traktEpisodeCollectionProgress = () => traktJsonReader.ReadObjectAsync(default(Stream));
     await traktEpisodeCollectionProgress.Should().ThrowAsync <ArgumentNullException>();
 }