public void TestAsyncOperations() { var clientConfig = new OTSClientConfig( TestEndPoint, TestAccessKeyID, TestAccessKeySecret, TestInstanceName ); clientConfig.OTSDebugLogHandler = null; clientConfig.OTSErrorLogHandler = null; OTSClient = new OTSClient(clientConfig); OTSClientTestHelper.Reset(); CreateTestTableWith4PK(new CapacityUnit(0, 0)); var putRowTaskList = new List <Task <PutRowResponse> >(); for (int i = 0; i < 1000; i++) { var request = new PutRowRequest(TestTableName, new Condition(RowExistenceExpectation.IGNORE), GetPredefinedPrimaryKeyWith4PK(i), GetPredefinedAttributeWith5PK(i)); putRowTaskList.Add(OTSClient.PutRowAsync(request)); } foreach (var task in putRowTaskList) { task.Wait(); AssertCapacityUnit(new CapacityUnit(0, 1), task.Result.ConsumedCapacityUnit); } var getRowTaskList = new List <Task <GetRowResponse> >(); for (int i = 0; i < 1000; i++) { var request = new GetRowRequest(TestTableName, GetPredefinedPrimaryKeyWith4PK(i)); getRowTaskList.Add(OTSClient.GetRowAsync(request)); } for (int i = 0; i < 1000; i++) { var task = getRowTaskList[i]; task.Wait(); var response = task.Result; AssertCapacityUnit(new CapacityUnit(1, 0), response.ConsumedCapacityUnit); AssertPrimaryKey(GetPredefinedPrimaryKeyWith4PK(i), response.PrimaryKey); AssertAttribute(GetPredefinedAttributeWith5PK(i), response.Attribute); } }