protected static Stream TestDocToStream(TestDoc testDoc, bool isSchematized) { if (isSchematized) { return(testDoc.ToHybridRowStream()); } else { return(TestCommon.SerializerCore.ToStream <TestDoc>(testDoc)); } }
protected static async Task <TestDoc> CreateSchematizedTestDocAsync(Container container, object partitionKey, int?ttlInSeconds = null) { TestDoc doc = BatchTestBase.PopulateTestDoc(partitionKey); ResponseMessage createResponse = await container.CreateItemStreamAsync( doc.ToHybridRowStream(), BatchTestBase.GetPartitionKey(partitionKey), BatchTestBase.GetItemRequestOptions(doc, isSchematized: true, ttlInSeconds: ttlInSeconds)); Assert.AreEqual( HttpStatusCode.Created, createResponse.StatusCode); return(doc); }