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_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_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_JsonReader_Null() { var traktJsonReader = new UserCustomListsReorderPostResponseArrayJsonReader(); Func <Task <IEnumerable <ITraktUserCustomListsReorderPostResponse> > > traktUserCustomListsReorderPostResponses = () => traktJsonReader.ReadArrayAsync(default(JsonTextReader)); await traktUserCustomListsReorderPostResponses.Should().ThrowAsync <ArgumentNullException>(); }
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(); }
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 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 }); } }
public void Test_UserCustomListsReorderPostResponseArrayJsonReader_ReadArray_From_Stream_Null() { var traktJsonReader = new UserCustomListsReorderPostResponseArrayJsonReader(); Func <Task <IEnumerable <ITraktUserCustomListsReorderPostResponse> > > traktUserCustomListsReorderPostResponses = () => traktJsonReader.ReadArrayAsync(default(Stream)); traktUserCustomListsReorderPostResponses.Should().Throw <ArgumentNullException>(); }
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(); } }