예제 #1
0
 public async Task Test_UserCustomListsReorderPostResponseObjectJsonWriter_WriteObject_JsonWriter_Exceptions()
 {
     var traktJsonWriter = new UserCustomListsReorderPostResponseObjectJsonWriter();
     ITraktUserCustomListsReorderPostResponse traktUserCustomListsReorderPostResponse = new TraktUserCustomListsReorderPostResponse();
     Func <Task> action = () => traktJsonWriter.WriteObjectAsync(default(JsonTextWriter), traktUserCustomListsReorderPostResponse);
     await action.Should().ThrowAsync <ArgumentNullException>();
 }
예제 #2
0
        public void Test_UserCustomListsReorderPostResponseObjectJsonWriter_WriteObject_StringWriter_Exceptions()
        {
            var traktJsonWriter = new UserCustomListsReorderPostResponseObjectJsonWriter();
            ITraktUserCustomListsReorderPostResponse traktUserCustomListsReorderPostResponse = new TraktUserCustomListsReorderPostResponse();
            Func <Task <string> > action = () => traktJsonWriter.WriteObjectAsync(default(StringWriter), traktUserCustomListsReorderPostResponse);

            action.Should().Throw <ArgumentNullException>();
        }
예제 #3
0
        public async Task Test_UserCustomListsReorderPostResponseObjectJsonWriter_WriteObject_StringWriter_Only_Updated_Property()
        {
            ITraktUserCustomListsReorderPostResponse traktUserCustomListsReorderPostResponse = new TraktUserCustomListsReorderPostResponse
            {
                Updated = 6
            };

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

                json.Should().Be(@"{""updated"":6}");
            }
        }
예제 #4
0
        public async Task Test_UserCustomListsReorderPostResponseObjectJsonWriter_WriteObject_StringWriter_Only_SkippedIds_Property()
        {
            ITraktUserCustomListsReorderPostResponse traktUserCustomListsReorderPostResponse = new TraktUserCustomListsReorderPostResponse
            {
                SkippedIds = new List <uint> {
                    2
                }
            };

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

                json.Should().Be(@"{""skipped_ids"":[2]}");
            }
        }
예제 #5
0
        public async Task Test_UserCustomListsReorderPostResponseObjectJsonWriter_WriteObject_JsonWriter_Complete()
        {
            ITraktUserCustomListsReorderPostResponse traktUserCustomListsReorderPostResponse = new TraktUserCustomListsReorderPostResponse
            {
                Updated    = 6,
                SkippedIds = new List <uint> {
                    2
                }
            };

            using (var stringWriter = new StringWriter())
                using (var jsonWriter = new JsonTextWriter(stringWriter))
                {
                    var traktJsonWriter = new UserCustomListsReorderPostResponseObjectJsonWriter();
                    await traktJsonWriter.WriteObjectAsync(jsonWriter, traktUserCustomListsReorderPostResponse);

                    stringWriter.ToString().Should().Be(@"{""updated"":6,""skipped_ids"":[2]}");
                }
        }
 public void Test_UserCustomListsReorderPostResponseObjectJsonWriter_WriteObject_Object_Exceptions()
 {
     var traktJsonWriter          = new UserCustomListsReorderPostResponseObjectJsonWriter();
     Func <Task <string> > action = () => traktJsonWriter.WriteObjectAsync(default);