public async Task Test_SyncRecommendationsPostResponseGroupObjectJsonWriter_WriteObject_StringWriter_Exceptions()
 {
     var traktJsonWriter = new SyncRecommendationsPostResponseGroupObjectJsonWriter();
     ITraktSyncRecommendationsPostResponseGroup traktSyncRecommendationsPostResponseGroup = new TraktSyncRecommendationsPostResponseGroup();
     Func <Task <string> > action = () => traktJsonWriter.WriteObjectAsync(default(StringWriter), traktSyncRecommendationsPostResponseGroup);
     await action.Should().ThrowAsync <ArgumentNullException>();
 }
        public async Task Test_SyncRecommendationsPostResponseGroupObjectJsonWriter_WriteObject_StringWriter_Complete()
        {
            ITraktSyncRecommendationsPostResponseGroup traktSyncRecommendationsPostResponseGroup = new TraktSyncRecommendationsPostResponseGroup
            {
                Movies = 1,
                Shows  = 2
            };

            using var stringWriter = new StringWriter();
            var    traktJsonWriter = new SyncRecommendationsPostResponseGroupObjectJsonWriter();
            string json            = await traktJsonWriter.WriteObjectAsync(stringWriter, traktSyncRecommendationsPostResponseGroup);

            json.Should().Be(@"{""movies"":1,""shows"":2}");
        }
Beispiel #3
0
 public async Task Test_SyncRecommendationsPostResponseGroupObjectJsonWriter_WriteObject_Object_Exceptions()
 {
     var traktJsonWriter          = new SyncRecommendationsPostResponseGroupObjectJsonWriter();
     Func <Task <string> > action = () => traktJsonWriter.WriteObjectAsync(default);