private static void FailureRetryRequests(int totalRequests, int retryRequests, int extraRequests, AmazonS3Client client) { for (int i = 0; i < totalRequests; i++) { try { var response = client.ListObjects("CapacityManagerTests"); } catch (Exception) { if (i == totalRequests - 1) { Assert.AreEqual(retryRequests * 2, requestCount - extraRequests); } continue; } } } }