title: How to test amazon s3 in sandbox environment with AmazonS3Client
body: <p>How do you test S3 in a sandbox environment when your code uses an AmazonS3Client?</p>
  
  <pre><code>IAmazonS3 amazonS3Client =
             Amazon.AWSClientFactory.CreateAmazonS3Client(s3AccessKey, s3SecretKey, config);
  
  var request = new PutObjectRequest()
  {
      BucketName = "bucketname",
      Key = "filename",
      ContentType = "application/json",
      ContentBody = "body"
  };
  
  amazonS3Client.PutObject(request);
  </code></pre>
  
  <p>I've tried S3Ninja and FakeS3 but the AmazonS3Client didn't hit them, which leads me to believe that an AmazonS3Client doesn't behave like a normal rest client.</p>
  
  <p>The only solution I can think of is to convert the code to use a rest client and manually build the requests and headers just so that I can use S3Ninja or FakeS3.</p>