Ejemplo n.º 1
0
 public async Task Test_UserCustomListsReorderPostObjectJsonWriter_WriteObject_StringWriter_Exceptions()
 {
     var traktJsonWriter = new UserCustomListsReorderPostObjectJsonWriter();
     ITraktUserCustomListsReorderPost traktUserCustomListsReorderPost = new TraktUserCustomListsReorderPost();
     Func <Task <string> >            action = () => traktJsonWriter.WriteObjectAsync(default(StringWriter), traktUserCustomListsReorderPost);
     await action.Should().ThrowAsync <ArgumentNullException>();
 }
Ejemplo n.º 2
0
        public void Test_UserCustomListsReorderPostObjectJsonWriter_WriteObject_JsonWriter_Exceptions()
        {
            var traktJsonWriter = new UserCustomListsReorderPostObjectJsonWriter();
            ITraktUserCustomListsReorderPost traktUserCustomListsReorderPost = new TraktUserCustomListsReorderPost();
            Func <Task> action = () => traktJsonWriter.WriteObjectAsync(default(JsonTextWriter), traktUserCustomListsReorderPost);

            action.Should().Throw <ArgumentNullException>();
        }
Ejemplo n.º 3
0
        public async Task Test_UserCustomListsReorderPostObjectJsonWriter_WriteObject_StringWriter_Complete()
        {
            ITraktUserCustomListsReorderPost traktUserCustomListsReorderPost = new TraktUserCustomListsReorderPost
            {
                Rank = new List <uint> {
                    823, 224, 88768, 356456, 245, 2, 890
                }
            };

            using (var stringWriter = new StringWriter())
            {
                var    traktJsonWriter = new UserCustomListsReorderPostObjectJsonWriter();
                string json            = await traktJsonWriter.WriteObjectAsync(stringWriter, traktUserCustomListsReorderPost);

                json.Should().Be(@"{""rank"":[823,224,88768,356456,245,2,890]}");
            }
        }