public async Task Test_UserCustomListsReorderPostResponseArrayJsonReader_ReadArray_From_Json_String_Empty()
        {
            var traktJsonReader = new UserCustomListsReorderPostResponseArrayJsonReader();
            IEnumerable <ITraktUserCustomListsReorderPostResponse> traktUserCustomListsReorderPostResponses = await traktJsonReader.ReadArrayAsync(string.Empty);

            traktUserCustomListsReorderPostResponses.Should().BeNull();
        }
Beispiel #2
0
        public async Task Test_UserCustomListsReorderPostResponseArrayJsonReader_ReadArray_From_JsonReader_Incomplete_2()
        {
            var traktJsonReader = new UserCustomListsReorderPostResponseArrayJsonReader();

            using (var reader = new StringReader(JSON_INCOMPLETE_2))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    IEnumerable <ITraktUserCustomListsReorderPostResponse> traktUserCustomListsReorderPostResponses = await traktJsonReader.ReadArrayAsync(jsonReader);

                    traktUserCustomListsReorderPostResponses.Should().NotBeNull();
                    ITraktUserCustomListsReorderPostResponse[] userCustomListsReorderPosts = traktUserCustomListsReorderPostResponses.ToArray();

                    userCustomListsReorderPosts[0].Should().NotBeNull();
                    userCustomListsReorderPosts[0].Updated.Should().BeNull();
                    userCustomListsReorderPosts[0].SkippedIds.Should().NotBeNull().And.HaveCount(1);
                    userCustomListsReorderPosts[0].SkippedIds.Should().BeEquivalentTo(new List <uint> {
                        2
                    });

                    userCustomListsReorderPosts[1].Should().NotBeNull();
                    userCustomListsReorderPosts[1].Updated.Should().Be(6);
                    userCustomListsReorderPosts[1].SkippedIds.Should().NotBeNull().And.HaveCount(1);
                    userCustomListsReorderPosts[1].SkippedIds.Should().BeEquivalentTo(new List <uint> {
                        2
                    });
                }
        }
        public async Task Test_UserCustomListsReorderPostResponseArrayJsonReader_ReadArray_From_Json_String_Empty_Array()
        {
            var traktJsonReader = new UserCustomListsReorderPostResponseArrayJsonReader();
            IEnumerable <ITraktUserCustomListsReorderPostResponse> traktUserCustomListsReorderPostResponses = await traktJsonReader.ReadArrayAsync(JSON_EMPTY_ARRAY);

            traktUserCustomListsReorderPostResponses.Should().NotBeNull().And.BeEmpty();
        }
        public void Test_UserCustomListsReorderPostResponseArrayJsonReader_ReadArray_From_JsonReader_Null()
        {
            var traktJsonReader = new UserCustomListsReorderPostResponseArrayJsonReader();
            Func <Task <IEnumerable <ITraktUserCustomListsReorderPostResponse> > > traktUserCustomListsReorderPostResponses = () => traktJsonReader.ReadArrayAsync(default(JsonTextReader));

            traktUserCustomListsReorderPostResponses.Should().Throw <ArgumentNullException>();
        }
Beispiel #5
0
        public async Task Test_UserCustomListsReorderPostResponseArrayJsonReader_ReadArray_From_Stream_Complete()
        {
            var traktJsonReader = new UserCustomListsReorderPostResponseArrayJsonReader();

            using (var stream = JSON_COMPLETE.ToStream())
            {
                IEnumerable <ITraktUserCustomListsReorderPostResponse> traktUserCustomListsReorderPostResponses = await traktJsonReader.ReadArrayAsync(stream);

                traktUserCustomListsReorderPostResponses.Should().NotBeNull();
                ITraktUserCustomListsReorderPostResponse[] userCustomListsReorderPosts = traktUserCustomListsReorderPostResponses.ToArray();

                userCustomListsReorderPosts[0].Should().NotBeNull();
                userCustomListsReorderPosts[0].Updated.Should().Be(6);
                userCustomListsReorderPosts[0].SkippedIds.Should().NotBeNull().And.HaveCount(1);
                userCustomListsReorderPosts[0].SkippedIds.Should().BeEquivalentTo(new List <uint> {
                    2
                });

                userCustomListsReorderPosts[1].Should().NotBeNull();
                userCustomListsReorderPosts[1].Updated.Should().Be(6);
                userCustomListsReorderPosts[1].SkippedIds.Should().NotBeNull().And.HaveCount(1);
                userCustomListsReorderPosts[1].SkippedIds.Should().BeEquivalentTo(new List <uint> {
                    2
                });
            }
        }
Beispiel #6
0
        public async Task Test_UserCustomListsReorderPostResponseArrayJsonReader_ReadArray_From_Stream_Empty_Array()
        {
            var traktJsonReader = new UserCustomListsReorderPostResponseArrayJsonReader();

            using (var stream = JSON_EMPTY_ARRAY.ToStream())
            {
                IEnumerable <ITraktUserCustomListsReorderPostResponse> traktUserCustomListsReorderPostResponses = await traktJsonReader.ReadArrayAsync(stream);

                traktUserCustomListsReorderPostResponses.Should().NotBeNull().And.BeEmpty();
            }
        }
Beispiel #7
0
        public async Task Test_UserCustomListsReorderPostResponseArrayJsonReader_ReadArray_From_JsonReader_Empty()
        {
            var traktJsonReader = new UserCustomListsReorderPostResponseArrayJsonReader();

            using (var reader = new StringReader(string.Empty))
                using (var jsonReader = new JsonTextReader(reader))
                {
                    IEnumerable <ITraktUserCustomListsReorderPostResponse> traktUserCustomListsReorderPostResponses = await traktJsonReader.ReadArrayAsync(jsonReader);

                    traktUserCustomListsReorderPostResponses.Should().BeNull();
                }
        }
        public async Task Test_UserCustomListsReorderPostResponseArrayJsonReader_ReadArray_From_Json_String_Not_Valid_1()
        {
            var traktJsonReader = new UserCustomListsReorderPostResponseArrayJsonReader();
            IEnumerable <ITraktUserCustomListsReorderPostResponse> traktUserCustomListsReorderPostResponses = await traktJsonReader.ReadArrayAsync(JSON_NOT_VALID_1);

            traktUserCustomListsReorderPostResponses.Should().NotBeNull();
            ITraktUserCustomListsReorderPostResponse[] userCustomListsReorderPosts = traktUserCustomListsReorderPostResponses.ToArray();

            userCustomListsReorderPosts[0].Should().NotBeNull();
            userCustomListsReorderPosts[0].Updated.Should().Be(6);
            userCustomListsReorderPosts[0].SkippedIds.Should().NotBeNull().And.HaveCount(1);
            userCustomListsReorderPosts[0].SkippedIds.Should().BeEquivalentTo(new List <uint> {
                2
            });

            userCustomListsReorderPosts[1].Should().NotBeNull();
            userCustomListsReorderPosts[1].Updated.Should().BeNull();
            userCustomListsReorderPosts[1].SkippedIds.Should().NotBeNull().And.HaveCount(1);
            userCustomListsReorderPosts[1].SkippedIds.Should().BeEquivalentTo(new List <uint> {
                2
            });
        }
 public async Task Test_UserCustomListsReorderPostResponseArrayJsonReader_ReadArray_From_Json_String_Null()
 {
     var traktJsonReader = new UserCustomListsReorderPostResponseArrayJsonReader();
     Func <Task <IEnumerable <ITraktUserCustomListsReorderPostResponse> > > traktUserCustomListsReorderPostResponses = () => traktJsonReader.ReadArrayAsync(default(string));
     await traktUserCustomListsReorderPostResponses.Should().ThrowAsync <ArgumentNullException>();
 }