Esempio n. 1
0
        public async Task Test_EpisodeWatchedProgressObjectJsonReader_ReadObject_From_Json_String_Empty()
        {
            var jsonReader = new EpisodeWatchedProgressObjectJsonReader();

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

            traktEpisodeWatchedProgress.Should().BeNull();
        }
Esempio n. 2
0
        public async Task Test_EpisodeWatchedProgressObjectJsonReader_ReadObject_From_Stream_Null()
        {
            var traktJsonReader = new EpisodeWatchedProgressObjectJsonReader();

            var traktEpisodeWatchedProgress = await traktJsonReader.ReadObjectAsync(default(Stream));

            traktEpisodeWatchedProgress.Should().BeNull();
        }
        public async Task Test_TraktEpisodeWatchedProgress_From_Json()
        {
            var jsonReader             = new EpisodeWatchedProgressObjectJsonReader();
            var episodeWatchedProgress = await jsonReader.ReadObjectAsync(JSON) as TraktEpisodeWatchedProgress;

            episodeWatchedProgress.Should().NotBeNull();
            episodeWatchedProgress.Number.Should().Be(2);
            episodeWatchedProgress.Completed.Should().BeFalse();
            episodeWatchedProgress.LastWatchedAt.Should().Be(DateTime.Parse("2011-04-18T01:00:00.000Z").ToUniversalTime());
        }
Esempio n. 4
0
        public async Task Test_EpisodeWatchedProgressObjectJsonReader_ReadObject_From_Stream_Empty()
        {
            var traktJsonReader = new EpisodeWatchedProgressObjectJsonReader();

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

                traktEpisodeWatchedProgress.Should().BeNull();
            }
        }
Esempio n. 5
0
        public async Task Test_EpisodeWatchedProgressObjectJsonReader_ReadObject_From_Json_String_Incomplete_6()
        {
            var jsonReader = new EpisodeWatchedProgressObjectJsonReader();

            var traktEpisodeWatchedProgress = await jsonReader.ReadObjectAsync(JSON_INCOMPLETE_6);

            traktEpisodeWatchedProgress.Should().NotBeNull();
            traktEpisodeWatchedProgress.Number.Should().BeNull();
            traktEpisodeWatchedProgress.Completed.Should().BeNull();
            traktEpisodeWatchedProgress.LastWatchedAt.Should().Be(DateTime.Parse("2011-04-18T01:00:00.000Z").ToUniversalTime());
        }
Esempio n. 6
0
        public async Task Test_EpisodeWatchedProgressObjectJsonReader_ReadObject_From_Json_String_Incomplete_5()
        {
            var jsonReader = new EpisodeWatchedProgressObjectJsonReader();

            var traktEpisodeWatchedProgress = await jsonReader.ReadObjectAsync(JSON_INCOMPLETE_5);

            traktEpisodeWatchedProgress.Should().NotBeNull();
            traktEpisodeWatchedProgress.Number.Should().BeNull();
            traktEpisodeWatchedProgress.Completed.Should().BeTrue();
            traktEpisodeWatchedProgress.LastWatchedAt.Should().BeNull();
        }
Esempio n. 7
0
        public async Task Test_EpisodeWatchedProgressObjectJsonReader_ReadObject_From_Json_String_Not_Valid_4()
        {
            var jsonReader = new EpisodeWatchedProgressObjectJsonReader();

            var traktEpisodeWatchedProgress = await jsonReader.ReadObjectAsync(JSON_NOT_VALID_4);

            traktEpisodeWatchedProgress.Should().NotBeNull();
            traktEpisodeWatchedProgress.Number.Should().BeNull();
            traktEpisodeWatchedProgress.Completed.Should().BeNull();
            traktEpisodeWatchedProgress.LastWatchedAt.Should().BeNull();
        }
        public async Task Test_EpisodeWatchedProgressObjectJsonReader_ReadObject_From_JsonReader_Empty()
        {
            var traktJsonReader = new EpisodeWatchedProgressObjectJsonReader();

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

                    traktEpisodeWatchedProgress.Should().BeNull();
                }
        }
Esempio n. 9
0
        public async Task Test_EpisodeWatchedProgressObjectJsonReader_ReadObject_From_Stream_Incomplete_5()
        {
            var traktJsonReader = new EpisodeWatchedProgressObjectJsonReader();

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

                traktEpisodeWatchedProgress.Should().NotBeNull();
                traktEpisodeWatchedProgress.Number.Should().BeNull();
                traktEpisodeWatchedProgress.Completed.Should().BeTrue();
                traktEpisodeWatchedProgress.LastWatchedAt.Should().BeNull();
            }
        }
Esempio n. 10
0
        public async Task Test_EpisodeWatchedProgressObjectJsonReader_ReadObject_From_Stream_Incomplete_2()
        {
            var traktJsonReader = new EpisodeWatchedProgressObjectJsonReader();

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

                traktEpisodeWatchedProgress.Should().NotBeNull();
                traktEpisodeWatchedProgress.Number.Should().Be(2);
                traktEpisodeWatchedProgress.Completed.Should().BeNull();
                traktEpisodeWatchedProgress.LastWatchedAt.Should().Be(DateTime.Parse("2011-04-18T01:00:00.000Z").ToUniversalTime());
            }
        }
Esempio n. 11
0
        public async Task Test_EpisodeWatchedProgressObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var traktJsonReader = new EpisodeWatchedProgressObjectJsonReader();

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

                traktEpisodeWatchedProgress.Should().NotBeNull();
                traktEpisodeWatchedProgress.Number.Should().BeNull();
                traktEpisodeWatchedProgress.Completed.Should().BeNull();
                traktEpisodeWatchedProgress.LastWatchedAt.Should().BeNull();
            }
        }
        public async Task Test_EpisodeWatchedProgressObjectJsonReader_ReadObject_From_JsonReader_Incomplete_4()
        {
            var traktJsonReader = new EpisodeWatchedProgressObjectJsonReader();

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

                    traktEpisodeWatchedProgress.Should().NotBeNull();
                    traktEpisodeWatchedProgress.Number.Should().Be(2);
                    traktEpisodeWatchedProgress.Completed.Should().BeNull();
                    traktEpisodeWatchedProgress.LastWatchedAt.Should().BeNull();
                }
        }
        public async Task Test_EpisodeWatchedProgressObjectJsonReader_ReadObject_From_JsonReader_Incomplete_1()
        {
            var traktJsonReader = new EpisodeWatchedProgressObjectJsonReader();

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

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

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

                    traktEpisodeWatchedProgress.Should().NotBeNull();
                    traktEpisodeWatchedProgress.Number.Should().Be(2);
                    traktEpisodeWatchedProgress.Completed.Should().BeTrue();
                    traktEpisodeWatchedProgress.LastWatchedAt.Should().BeNull();
                }
        }
Esempio n. 15
0
 public async Task Test_EpisodeWatchedProgressObjectJsonReader_ReadObject_From_Stream_Null()
 {
     var traktJsonReader = new EpisodeWatchedProgressObjectJsonReader();
     Func <Task <ITraktEpisodeWatchedProgress> > traktEpisodeWatchedProgress = () => traktJsonReader.ReadObjectAsync(default(Stream));
     await traktEpisodeWatchedProgress.Should().ThrowAsync <ArgumentNullException>();
 }
Esempio n. 16
0
        public void Test_EpisodeWatchedProgressObjectJsonReader_ReadObject_From_Json_String_Null()
        {
            var jsonReader = new EpisodeWatchedProgressObjectJsonReader();
            Func <Task <ITraktEpisodeWatchedProgress> > traktEpisodeWatchedProgress = () => jsonReader.ReadObjectAsync(default(string));

            traktEpisodeWatchedProgress.Should().Throw <ArgumentNullException>();
        }