public void Test_WatchedShowEpisodeObjectJsonReader_ReadObject_From_Json_String_Null()
        {
            var jsonReader = new WatchedShowEpisodeObjectJsonReader();
            Func <Task <ITraktWatchedShowEpisode> > traktWatchedShowEpisode = () => jsonReader.ReadObjectAsync(default(string));

            traktWatchedShowEpisode.Should().Throw <ArgumentNullException>();
        }
        public async Task Test_WatchedShowEpisodeObjectJsonReader_ReadObject_From_Json_String_Empty()
        {
            var jsonReader = new WatchedShowEpisodeObjectJsonReader();

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

            traktWatchedShowEpisode.Should().BeNull();
        }
Exemplo n.º 3
0
        public async Task Test_WatchedShowEpisodeObjectJsonReader_ReadObject_From_Stream_Null()
        {
            var jsonReader = new WatchedShowEpisodeObjectJsonReader();

            var traktWatchedShowEpisode = await jsonReader.ReadObjectAsync(default(Stream));

            traktWatchedShowEpisode.Should().BeNull();
        }
        public async Task Test_WatchedShowEpisodeObjectJsonReader_ReadObject_From_JsonReader_Null()
        {
            var traktJsonReader = new WatchedShowEpisodeObjectJsonReader();

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

            traktWatchedShowEpisode.Should().BeNull();
        }
        public async Task Test_TraktWatchedShowEpisode_From_Json()
        {
            var jsonReader         = new WatchedShowEpisodeObjectJsonReader();
            var watchedShowEpisode = await jsonReader.ReadObjectAsync(JSON) as TraktWatchedShowEpisode;

            watchedShowEpisode.Should().NotBeNull();
            watchedShowEpisode.Number.Should().Be(1);
            watchedShowEpisode.Plays.Should().Be(1);
            watchedShowEpisode.LastWatchedAt.Should().Be(DateTime.Parse("2014-10-12T17:00:54.000Z").ToUniversalTime());
        }
        public async Task Test_WatchedShowEpisodeObjectJsonReader_ReadObject_From_Json_String_Incomplete_5()
        {
            var jsonReader = new WatchedShowEpisodeObjectJsonReader();

            var traktWatchedShowEpisode = await jsonReader.ReadObjectAsync(JSON_INCOMPLETE_5);

            traktWatchedShowEpisode.Should().NotBeNull();
            traktWatchedShowEpisode.Number.Should().BeNull();
            traktWatchedShowEpisode.Plays.Should().Be(1);
            traktWatchedShowEpisode.LastWatchedAt.Should().BeNull();
        }
        public async Task Test_WatchedShowEpisodeObjectJsonReader_ReadObject_From_Json_String_Incomplete_6()
        {
            var jsonReader = new WatchedShowEpisodeObjectJsonReader();

            var traktWatchedShowEpisode = await jsonReader.ReadObjectAsync(JSON_INCOMPLETE_6);

            traktWatchedShowEpisode.Should().NotBeNull();
            traktWatchedShowEpisode.Number.Should().BeNull();
            traktWatchedShowEpisode.Plays.Should().BeNull();
            traktWatchedShowEpisode.LastWatchedAt.Should().Be(DateTime.Parse("2014-10-12T17:00:54.000Z").ToUniversalTime());
        }
        public async Task Test_WatchedShowEpisodeObjectJsonReader_ReadObject_From_Json_String_Not_Valid_4()
        {
            var jsonReader = new WatchedShowEpisodeObjectJsonReader();

            var traktWatchedShowEpisode = await jsonReader.ReadObjectAsync(JSON_NOT_VALID_4);

            traktWatchedShowEpisode.Should().NotBeNull();
            traktWatchedShowEpisode.Number.Should().BeNull();
            traktWatchedShowEpisode.Plays.Should().BeNull();
            traktWatchedShowEpisode.LastWatchedAt.Should().BeNull();
        }
        public async Task Test_WatchedShowEpisodeObjectJsonReader_ReadObject_From_Stream_Empty()
        {
            var jsonReader = new WatchedShowEpisodeObjectJsonReader();

            using (var stream = string.Empty.ToStream())
            {
                var traktWatchedShowEpisode = await jsonReader.ReadObjectAsync(stream);

                traktWatchedShowEpisode.Should().BeNull();
            }
        }
Exemplo n.º 10
0
        public async Task Test_WatchedShowEpisodeObjectJsonReader_ReadObject_From_JsonReader_Empty()
        {
            var traktJsonReader = new WatchedShowEpisodeObjectJsonReader();

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

                    traktWatchedShowEpisode.Should().BeNull();
                }
        }
        public async Task Test_WatchedShowEpisodeObjectJsonReader_ReadObject_From_Stream_Complete()
        {
            var jsonReader = new WatchedShowEpisodeObjectJsonReader();

            using (var stream = JSON_COMPLETE.ToStream())
            {
                var traktWatchedShowEpisode = await jsonReader.ReadObjectAsync(stream);

                traktWatchedShowEpisode.Should().NotBeNull();
                traktWatchedShowEpisode.Number.Should().Be(1);
                traktWatchedShowEpisode.Plays.Should().Be(1);
                traktWatchedShowEpisode.LastWatchedAt.Should().Be(DateTime.Parse("2014-10-12T17:00:54.000Z").ToUniversalTime());
            }
        }
        public async Task Test_WatchedShowEpisodeObjectJsonReader_ReadObject_From_Stream_Not_Valid_4()
        {
            var jsonReader = new WatchedShowEpisodeObjectJsonReader();

            using (var stream = JSON_NOT_VALID_4.ToStream())
            {
                var traktWatchedShowEpisode = await jsonReader.ReadObjectAsync(stream);

                traktWatchedShowEpisode.Should().NotBeNull();
                traktWatchedShowEpisode.Number.Should().BeNull();
                traktWatchedShowEpisode.Plays.Should().BeNull();
                traktWatchedShowEpisode.LastWatchedAt.Should().BeNull();
            }
        }
        public async Task Test_WatchedShowEpisodeObjectJsonReader_ReadObject_From_Stream_Incomplete_5()
        {
            var jsonReader = new WatchedShowEpisodeObjectJsonReader();

            using (var stream = JSON_INCOMPLETE_5.ToStream())
            {
                var traktWatchedShowEpisode = await jsonReader.ReadObjectAsync(stream);

                traktWatchedShowEpisode.Should().NotBeNull();
                traktWatchedShowEpisode.Number.Should().BeNull();
                traktWatchedShowEpisode.Plays.Should().Be(1);
                traktWatchedShowEpisode.LastWatchedAt.Should().BeNull();
            }
        }
Exemplo n.º 14
0
        public async Task Test_WatchedShowEpisodeObjectJsonReader_ReadObject_From_JsonReader_Incomplete_4()
        {
            var traktJsonReader = new WatchedShowEpisodeObjectJsonReader();

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

                    traktWatchedShowEpisode.Should().NotBeNull();
                    traktWatchedShowEpisode.Number.Should().Be(1);
                    traktWatchedShowEpisode.Plays.Should().BeNull();
                    traktWatchedShowEpisode.LastWatchedAt.Should().BeNull();
                }
        }
Exemplo n.º 15
0
        public async Task Test_WatchedShowEpisodeObjectJsonReader_ReadObject_From_JsonReader_Incomplete_2()
        {
            var traktJsonReader = new WatchedShowEpisodeObjectJsonReader();

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

                    traktWatchedShowEpisode.Should().NotBeNull();
                    traktWatchedShowEpisode.Number.Should().Be(1);
                    traktWatchedShowEpisode.Plays.Should().BeNull();
                    traktWatchedShowEpisode.LastWatchedAt.Should().Be(DateTime.Parse("2014-10-12T17:00:54.000Z").ToUniversalTime());
                }
        }
Exemplo n.º 16
0
        public async Task Test_WatchedShowEpisodeObjectJsonReader_ReadObject_From_JsonReader_Not_Valid_3()
        {
            var traktJsonReader = new WatchedShowEpisodeObjectJsonReader();

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

                    traktWatchedShowEpisode.Should().NotBeNull();
                    traktWatchedShowEpisode.Number.Should().Be(1);
                    traktWatchedShowEpisode.Plays.Should().Be(1);
                    traktWatchedShowEpisode.LastWatchedAt.Should().BeNull();
                }
        }
Exemplo n.º 17
0
 public async Task Test_WatchedShowEpisodeObjectJsonReader_ReadObject_From_JsonReader_Null()
 {
     var traktJsonReader = new WatchedShowEpisodeObjectJsonReader();
     Func <Task <ITraktWatchedShowEpisode> > traktWatchedShowEpisode = () => traktJsonReader.ReadObjectAsync(default(JsonTextReader));
     await traktWatchedShowEpisode.Should().ThrowAsync <ArgumentNullException>();
 }