private static async Task VerifyServerRequestCreationsByCountAsync( int expectedOperationCount, int operationCount, int docSizeInBytes) { int maxServerRequestBodyLength = int.MaxValue; int maxServerRequestOperationCount = expectedOperationCount; (PartitionKeyRangeServerBatchRequest request, ArraySegment <ItemBatchOperation> overflow) = await PartitionKeyRangeServerBatchRequestTests.GetBatchWithCreateOperationsAsync(operationCount, maxServerRequestBodyLength, maxServerRequestOperationCount, docSizeInBytes); Assert.AreEqual(expectedOperationCount, request.Operations.Count); Assert.AreEqual(overflow.Count, operationCount - request.Operations.Count); }
private static async Task VerifyServerRequestCreationsBySizeAsync( int expectedOperationCount, int operationCount, int docSizeInBytes) { const int perRequestOverheadEstimateInBytes = 30; const int perDocOverheadEstimateInBytes = 50; int maxServerRequestBodyLength = ((docSizeInBytes + perDocOverheadEstimateInBytes) * expectedOperationCount) + perRequestOverheadEstimateInBytes; int maxServerRequestOperationCount = int.MaxValue; (PartitionKeyRangeServerBatchRequest request, ArraySegment <ItemBatchOperation> overflow) = await PartitionKeyRangeServerBatchRequestTests.GetBatchWithCreateOperationsAsync(operationCount, maxServerRequestBodyLength, maxServerRequestOperationCount, docSizeInBytes); Assert.AreEqual(expectedOperationCount, request.Operations.Count); Assert.AreEqual(overflow.Count, operationCount - request.Operations.Count); }