示例#1
0
        public void S3ListBuckets2()
        {
            System.Net.S3.S3WebRequest s3WebRequest = (System.Net.S3.S3WebRequest)WebRequest.Create("s3://localhost");
            s3WebRequest.Method = "LSB";
            System.Net.S3.S3ObjectWebResponse <ListBucketsResponse> s3WebResponse = (System.Net.S3.S3ObjectWebResponse <ListBucketsResponse>)s3WebRequest.GetResponse();

            Assert.Equal(200, s3WebResponse.StatusCode);

            Assert.Equal(1, s3WebResponse.GetObject().Buckets.Count);
            Assert.Equal("bucket1", s3WebResponse.GetObject().Buckets.First().BucketName);
        }
示例#2
0
        public async Task S3ListUploadedFile()
        {
            System.Net.S3.S3WebRequest s3WebRequest = (System.Net.S3.S3WebRequest)WebRequest.Create("s3://bucket1/");
            s3WebRequest.Method = "LS";

            System.Net.S3.S3ObjectWebResponse <ListObjectsResponse> s3WebResponse =
                (System.Net.S3.S3ObjectWebResponse <ListObjectsResponse>) await s3WebRequest.GetResponseAsync();

            Assert.Equal(200, s3WebResponse.StatusCode);

            Assert.Equal(1, s3WebResponse.GetObject().S3Objects.Count);
            Assert.Equal(128 * 1024 * 1024, s3WebResponse.GetObject().S3Objects.First().Size);
        }