Exemplo n.º 1
0
        public void Test_PostResponseNotFoundShowObjectJsonReader_ReadObject_From_JsonReader_Null()
        {
            var traktJsonReader = new PostResponseNotFoundShowObjectJsonReader();
            Func <Task <ITraktPostResponseNotFoundShow> > postResponseNotFoundShow = () => traktJsonReader.ReadObjectAsync(default(JsonTextReader));

            postResponseNotFoundShow.Should().Throw <ArgumentNullException>();
        }
Exemplo n.º 2
0
        public async Task Test_PostResponseNotFoundShowObjectJsonReader_ReadObject_From_Json_String_Empty()
        {
            var jsonReader = new PostResponseNotFoundShowObjectJsonReader();

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

            postResponseNotFoundShow.Should().BeNull();
        }
        public async Task Test_PostResponseNotFoundShowObjectJsonReader_ReadObject_From_JsonReader_Null()
        {
            var traktJsonReader = new PostResponseNotFoundShowObjectJsonReader();

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

            postResponseNotFoundShow.Should().BeNull();
        }
Exemplo n.º 4
0
        public async Task Test_PostResponseNotFoundShowObjectJsonReader_ReadObject_From_Stream_Null()
        {
            var jsonReader = new PostResponseNotFoundShowObjectJsonReader();

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

            postResponseNotFoundShow.Should().BeNull();
        }
Exemplo n.º 5
0
        public async Task Test_PostResponseNotFoundShowObjectJsonReader_ReadObject_From_Json_String_Not_Valid()
        {
            var jsonReader = new PostResponseNotFoundShowObjectJsonReader();

            var postResponseNotFoundShow = await jsonReader.ReadObjectAsync(JSON_NOT_VALID);

            postResponseNotFoundShow.Should().NotBeNull();
            postResponseNotFoundShow.Ids.Should().BeNull();
        }
        public async Task Test_PostResponseNotFoundShowObjectJsonReader_ReadObject_From_Stream_Empty()
        {
            var jsonReader = new PostResponseNotFoundShowObjectJsonReader();

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

                postResponseNotFoundShow.Should().BeNull();
            }
        }
Exemplo n.º 7
0
        public async Task Test_PostResponseNotFoundShowObjectJsonReader_ReadObject_From_JsonReader_Empty()
        {
            var traktJsonReader = new PostResponseNotFoundShowObjectJsonReader();

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

                    postResponseNotFoundShow.Should().BeNull();
                }
        }
        public async Task Test_PostResponseNotFoundShowObjectJsonReader_ReadObject_From_Stream_Not_Valid()
        {
            var jsonReader = new PostResponseNotFoundShowObjectJsonReader();

            using (var stream = JSON_NOT_VALID.ToStream())
            {
                var postResponseNotFoundShow = await jsonReader.ReadObjectAsync(stream);

                postResponseNotFoundShow.Should().NotBeNull();
                postResponseNotFoundShow.Ids.Should().BeNull();
            }
        }
Exemplo n.º 9
0
        public async Task Test_TraktPostResponseNotFoundShow_From_Json()
        {
            var jsonReader = new PostResponseNotFoundShowObjectJsonReader();
            var postResponseNotFoundShow = await jsonReader.ReadObjectAsync(JSON) as TraktPostResponseNotFoundShow;

            postResponseNotFoundShow.Should().NotBeNull();
            postResponseNotFoundShow.Ids.Trakt.Should().Be(1390U);
            postResponseNotFoundShow.Ids.Slug.Should().Be("game-of-thrones");
            postResponseNotFoundShow.Ids.Tvdb.Should().Be(121361U);
            postResponseNotFoundShow.Ids.Imdb.Should().Be("tt0944947");
            postResponseNotFoundShow.Ids.Tmdb.Should().Be(1399U);
            postResponseNotFoundShow.Ids.TvRage.Should().Be(24493U);
        }
Exemplo n.º 10
0
        public async Task Test_PostResponseNotFoundShowObjectJsonReader_ReadObject_From_JsonReader_Not_Valid()
        {
            var traktJsonReader = new PostResponseNotFoundShowObjectJsonReader();

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

                    postResponseNotFoundShow.Should().NotBeNull();
                    postResponseNotFoundShow.Ids.Should().BeNull();
                }
        }
        public async Task Test_PostResponseNotFoundShowObjectJsonReader_ReadObject_From_Stream_Complete()
        {
            var jsonReader = new PostResponseNotFoundShowObjectJsonReader();

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

                postResponseNotFoundShow.Should().NotBeNull();
                postResponseNotFoundShow.Ids.Trakt.Should().Be(1390U);
                postResponseNotFoundShow.Ids.Slug.Should().Be("game-of-thrones");
                postResponseNotFoundShow.Ids.Tvdb.Should().Be(121361U);
                postResponseNotFoundShow.Ids.Imdb.Should().Be("tt0944947");
                postResponseNotFoundShow.Ids.Tmdb.Should().Be(1399U);
                postResponseNotFoundShow.Ids.TvRage.Should().Be(24493U);
            }
        }
Exemplo n.º 12
0
        public async Task Test_PostResponseNotFoundShowObjectJsonReader_ReadObject_From_JsonReader_Complete()
        {
            var traktJsonReader = new PostResponseNotFoundShowObjectJsonReader();

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

                    postResponseNotFoundShow.Should().NotBeNull();
                    postResponseNotFoundShow.Ids.Trakt.Should().Be(1390U);
                    postResponseNotFoundShow.Ids.Slug.Should().Be("game-of-thrones");
                    postResponseNotFoundShow.Ids.Tvdb.Should().Be(121361U);
                    postResponseNotFoundShow.Ids.Imdb.Should().Be("tt0944947");
                    postResponseNotFoundShow.Ids.Tmdb.Should().Be(1399U);
                    postResponseNotFoundShow.Ids.TvRage.Should().Be(24493U);
                }
        }
Exemplo n.º 13
0
 public async Task Test_PostResponseNotFoundShowObjectJsonReader_ReadObject_From_Json_String_Null()
 {
     var jsonReader = new PostResponseNotFoundShowObjectJsonReader();
     Func <Task <ITraktPostResponseNotFoundShow> > postResponseNotFoundShow = () => jsonReader.ReadObjectAsync(default(string));
     await postResponseNotFoundShow.Should().ThrowAsync <ArgumentNullException>();
 }