Пример #1
0
        public void delete_all_revisions_hard_delete()
        {
            CreateBucketWithTwoFileRevisions();

            bucket.DeleteAllRevisions(testfile, mode: DeleteMode.Hard);

            var fileEntries = GridUtility.EnumerateFileEntries(bucket, testfile)
                              .ToList();

            fileEntries.Should().BeEmpty();
        }
Пример #2
0
        public void delete_all_revisions_soft_delete()
        {
            CreateBucketWithTwoFileRevisions();

            bucket.DeleteAllRevisions(testfile, mode: DeleteMode.Soft);


            var fileEntries = GridUtility.EnumerateFileEntries(bucket, testfile)
                              .ToList();

            foreach (var fileInfo in fileEntries)
            {
                fileInfo.Status.Should().Be(Status.Deleted);
            }
        }
Пример #3
0
        public void hard_delete_test()
        {
            CreateBucketWithOneFileTwoChunks();

            var file = bucket.GetFileInfoByName(testfile);

            //soft delete
            bucket.DeleteRevision(file.Id, mode: DeleteMode.Hard);

            var fileEntries = GridUtility.EnumerateFileEntries(bucket, testfile)
                              .ToList();

            fileEntries.Should().BeEmpty();


            var chunks = GridUtility.EnumerateChunks(bucket, file.Id)
                         .ToList();

            chunks.Should().BeEmpty();
        }
Пример #4
0
        public void soft_delete_test()
        {
            CreateBucketWithOneFileTwoChunks();

            var file = bucket.GetFileInfoByName(testfile);

            //soft delete
            bucket.DeleteRevision(file.Id, mode: DeleteMode.Soft);

            Action act = () => file = bucket.GetFileInfoByName(testfile);

            act.ShouldThrow <FileNotFoundException>();

            var deletedFile = GridUtility.EnumerateFileEntries(bucket, testfile, Status.Deleted)
                              .FirstOrDefault();

            deletedFile.Should().NotBeNull();

            file.Id.Should().Be(deletedFile.Id);
        }