public void AmazonS3_GetContentsOfEmptySubFolder() { var fileProvider = new S3FileProvider(getS3Service(), bucketName); var folderInfo1 = fileProvider.GetDirectoryContents("/folder-1/folder-1-b"); var folderInfo2 = fileProvider.GetDirectoryContents("/folder-1/folder-1-b/"); Assert.Equal(true, folderInfo1.Exists); Assert.Equal(true, folderInfo2.Exists); Assert.Equal(0, folderInfo1.Count()); Assert.Equal(0, folderInfo2.Count()); }
public void AmazonS3_GetContentsOfNotExistingSubFolder() { var fileProvider = new S3FileProvider(getS3Service(), bucketName); var folderInfo1 = fileProvider.GetDirectoryContents("/folder-1-not-exists"); var folderInfo2 = fileProvider.GetDirectoryContents("/folder-1/folder-1-a/not-exists"); var folderInfo3 = fileProvider.GetDirectoryContents("/not-exists"); Assert.Equal(false, folderInfo1.Exists); Assert.Equal(false, folderInfo2.Exists); Assert.Equal(false, folderInfo3.Exists); Assert.Equal(0, folderInfo1.Count()); Assert.Equal(0, folderInfo2.Count()); Assert.Equal(0, folderInfo3.Count()); }
public void AmazonS3_GetRootContents() { var fileProvider = new S3FileProvider(getS3Service(), bucketName); var folderInfo = fileProvider.GetDirectoryContents("/"); Assert.Equal(true, folderInfo.Exists); Assert.Equal(2, folderInfo.Count()); Assert.True(folderInfo.Any(x => x.Name == "dummy.pdf")); Assert.True(folderInfo.Any(x => x.Name == "folder-1")); }
public void AmazonS3_GetContentsOfSubFolder() { var fileProvider = new S3FileProvider(getS3Service(), bucketName); var folderInfo1 = fileProvider.GetDirectoryContents("/folder-1"); var folderInfo2 = fileProvider.GetDirectoryContents("/folder-1/"); Assert.Equal(true, folderInfo1.Exists); Assert.Equal(true, folderInfo2.Exists); Assert.Equal(4, folderInfo1.Count()); Assert.Equal(4, folderInfo2.Count()); Assert.True(folderInfo1.Any(x => x.Name == "folder-1-a")); Assert.True(folderInfo2.Any(x => x.Name == "folder-1-a")); Assert.True(folderInfo1.Any(x => x.Name == "folder-1-b")); Assert.True(folderInfo2.Any(x => x.Name == "folder-1-b")); Assert.True(folderInfo1.Any(x => x.Name == "aws.png")); Assert.True(folderInfo2.Any(x => x.Name == "aws.png")); Assert.True(folderInfo1.Any(x => x.Name == "dummy.pdf")); Assert.True(folderInfo2.Any(x => x.Name == "dummy.pdf")); }