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>(); }
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>(); }
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}"); } }
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]}"); } }
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);