private static void DeleteBucketMetricsAndValidate() { DeleteBucketMetricsConfigurationRequest deleteBucketMetricsConfigurationRequest = new DeleteBucketMetricsConfigurationRequest() { BucketName = bucketName, MetricsId = "configId" }; var deleteBucketMetricsConfigurationResponse = Client.DeleteBucketMetricsConfiguration(deleteBucketMetricsConfigurationRequest); var response = Client.ListObjects(new ListObjectsRequest() { BucketName = bucketName }); var successFlag = true; if (response.S3Objects.Count > 0) { successFlag = false; } Assert.IsTrue(successFlag); }