Example #1
0
        private async Task <GetObjectResponse> GetObjectAsync(S3FileKey key)
        {
            var request = new GetObjectRequest
            {
                BucketName = BucketNameConstructor.GetBucketName(key),
                Key        = key.Key,
                VersionId  = key.VersionId
            };

            return(await AmazonS3.GetObjectAsync(request));
        }
Example #2
0
        public async Task S3Service_Should_Upload_A_File_To_A_Bucket()
        {
            var bucketName = Guid.NewGuid().ToString();

            await CreateTestBucket(bucketName);
            await UploadTestFile(bucketName : bucketName, key : Key);

            GetObjectResponse getObjectResponse = await AmazonS3.GetObjectAsync(bucketName, Key);

            Assert.Equal(HttpStatusCode.OK, getObjectResponse.HttpStatusCode);
        }