public async Task Test_UserCustomListsReorderPostObjectJsonReader_ReadObject_From_Json_String_Empty()
        {
            var traktJsonReader = new UserCustomListsReorderPostObjectJsonReader();
            var traktUserCustomListsReorderPost = await traktJsonReader.ReadObjectAsync(string.Empty);

            traktUserCustomListsReorderPost.Should().BeNull();
        }
        public void Test_UserCustomListsReorderPostObjectJsonReader_ReadObject_From_Stream_Null()
        {
            var traktJsonReader = new UserCustomListsReorderPostObjectJsonReader();
            Func <Task <ITraktUserCustomListsReorderPost> > traktUserCustomListsReorderPost = () => traktJsonReader.ReadObjectAsync(default(Stream));

            traktUserCustomListsReorderPost.Should().Throw <ArgumentNullException>();
        }
        public async Task Test_UserCustomListsReorderPostObjectJsonReader_ReadObject_From_Json_String_Not_Valid()
        {
            var traktJsonReader = new UserCustomListsReorderPostObjectJsonReader();
            var traktUserCustomListsReorderPost = await traktJsonReader.ReadObjectAsync(JSON_NOT_VALID);

            traktUserCustomListsReorderPost.Should().NotBeNull();
            traktUserCustomListsReorderPost.Rank.Should().BeNull();
        }
        public async Task Test_TraktUserCustomListsReorderPost_From_Json()
        {
            var jsonReader = new UserCustomListsReorderPostObjectJsonReader();
            var traktUserCustomListsReorderPost = await jsonReader.ReadObjectAsync(JSON) as TraktUserCustomListsReorderPost;

            traktUserCustomListsReorderPost.Should().NotBeNull();
            traktUserCustomListsReorderPost.Rank.Should().NotBeNull().And.HaveCount(7);
            traktUserCustomListsReorderPost.Rank.Should().BeEquivalentTo(new List <uint> {
                823, 224, 88768, 356456, 245, 2, 890
            });
        }
        public async Task Test_UserCustomListsReorderPostObjectJsonReader_ReadObject_From_Stream_Empty()
        {
            var traktJsonReader = new UserCustomListsReorderPostObjectJsonReader();

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

                traktUserCustomListsReorderPost.Should().BeNull();
            }
        }
        public async Task Test_UserCustomListsReorderPostObjectJsonReader_ReadObject_From_Json_String_Complete()
        {
            var traktJsonReader = new UserCustomListsReorderPostObjectJsonReader();
            var traktUserCustomListsReorderPost = await traktJsonReader.ReadObjectAsync(JSON_COMPLETE);

            traktUserCustomListsReorderPost.Should().NotBeNull();
            traktUserCustomListsReorderPost.Rank.Should().NotBeNull().And.HaveCount(7);
            traktUserCustomListsReorderPost.Rank.Should().BeEquivalentTo(new List <uint> {
                823, 224, 88768, 356456, 245, 2, 890
            });
        }
        public async Task Test_UserCustomListsReorderPostObjectJsonReader_ReadObject_From_Stream_Not_Valid()
        {
            var traktJsonReader = new UserCustomListsReorderPostObjectJsonReader();

            using (var stream = JSON_NOT_VALID.ToStream())
            {
                var traktUserCustomListsReorderPost = await traktJsonReader.ReadObjectAsync(stream);

                traktUserCustomListsReorderPost.Should().NotBeNull();
                traktUserCustomListsReorderPost.Rank.Should().BeNull();
            }
        }
Exemple #8
0
        public async Task Test_UserCustomListsReorderPostObjectJsonReader_ReadObject_From_JsonReader_Empty()
        {
            var traktJsonReader = new UserCustomListsReorderPostObjectJsonReader();

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

                    traktUserCustomListsReorderPost.Should().BeNull();
                }
        }
Exemple #9
0
        public async Task Test_UserCustomListsReorderPostObjectJsonReader_ReadObject_From_JsonReader_Not_Valid()
        {
            var traktJsonReader = new UserCustomListsReorderPostObjectJsonReader();

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

                    traktUserCustomListsReorderPost.Should().NotBeNull();
                    traktUserCustomListsReorderPost.Rank.Should().BeNull();
                }
        }
Exemple #10
0
 public async Task Test_UserCustomListsReorderPostObjectJsonReader_ReadObject_From_JsonReader_Null()
 {
     var traktJsonReader = new UserCustomListsReorderPostObjectJsonReader();
     Func <Task <ITraktUserCustomListsReorderPost> > traktUserCustomListsReorderPost = () => traktJsonReader.ReadObjectAsync(default(JsonTextReader));
     await traktUserCustomListsReorderPost.Should().ThrowAsync <ArgumentNullException>();
 }