예제 #1
0
        public void AmazonS3_GetFileAndCheckContent()
        {
            var fileProvider = new S3FileProvider(getS3Service(), bucketName);
            var fileInfo     = fileProvider.GetFileInfo("/folder-1/folder-1-a/ContentTest.txt");

            Assert.Equal(true, fileInfo.Exists);

            using (var textReader = new StreamReader(fileInfo.CreateReadStream()))
                Assert.Equal("Foo Bar", textReader.ReadToEnd());
        }
예제 #2
0
        public void AmazonS3_GetFileAndCheckInformation()
        {
            var fileProvider = new S3FileProvider(getS3Service(), bucketName);
            var fileInfo     = fileProvider.GetFileInfo("/dummy.pdf");

            Assert.Equal(true, fileInfo.Exists);
            Assert.Equal(false, fileInfo.IsDirectory);
            Assert.Equal(new DateTime(2017, 5, 13, 15, 25, 10, 0, DateTimeKind.Utc), fileInfo.LastModified);
            Assert.Equal("dummy.pdf", fileInfo.Name);
            Assert.Equal("s3-us-west-2.amazonaws.com/evorine-engine-fileproviders-s3-test/dummy.pdf", fileInfo.PhysicalPath);
            Assert.Equal(88929, fileInfo.Length);
        }