public void S3ExistsKeyDoesNotExist() { if (!IsEmpty) { S3KeyExists task = new S3KeyExists() { AccessKeyId = AccessKeyId, BucketName = BucketName, Key = Guid.NewGuid().ToString(), SecretAccessKeyId = SecretAccessKeyId, UseSsl = UseSsl }; task.Execute(); Assert.IsFalse(task.Exists); } }
public void S3ExistsKeyExists() { if (!IsEmpty) { string key = Guid.NewGuid().ToString() + ".js"; PutObjectRequest request = new PutObjectRequest() .WithBucketName(BucketName) .WithKey(key) .WithFilePath(@"script\jquery.min.js"); using (PutObjectResponse response = Client.PutObject(request)) { cleanupKeys.Add(key); } S3KeyExists task = new S3KeyExists() { AccessKeyId = AccessKeyId, BucketName = BucketName, Key = key, SecretAccessKeyId = SecretAccessKeyId, UseSsl = UseSsl }; task.Execute(); Assert.IsTrue(task.Exists); } }