private static void TestPutGetAPM(IAmazonS3 s3EncryptionClient, IAmazonS3 s3DecryptionClient, string filePath, byte[] inputStreamBytes, string contentBody, string expectedContent, string bucketName) { PutObjectRequest request = new PutObjectRequest() { BucketName = bucketName, Key = $"key-{Guid.NewGuid()}", FilePath = filePath, InputStream = inputStreamBytes == null ? null : new MemoryStream(inputStreamBytes), ContentBody = contentBody, }; PutObjectResponse response = s3EncryptionClient.EndPutObject(s3EncryptionClient.BeginPutObject(request, null, null)); TestGetAPM(request.Key, expectedContent, s3DecryptionClient, bucketName); }