-
-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding more tests for file storage and fixing issues with scoped file…
… storage
- Loading branch information
Showing
7 changed files
with
153 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
tests/Foundatio.Tests/Storage/ScopedInMemoryFileStorageTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
using System.Threading.Tasks; | ||
using Foundatio.Storage; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace Foundatio.Tests.Storage { | ||
public class ScopedInMemoryFileStorageTests : FileStorageTestsBase { | ||
public ScopedInMemoryFileStorageTests(ITestOutputHelper output) : base(output) {} | ||
|
||
protected override IFileStorage GetStorage() { | ||
return new ScopedFileStorage(new InMemoryFileStorage { MaxFiles = 2000 }, "scoped"); | ||
} | ||
|
||
[Fact] | ||
public override Task CanGetEmptyFileListOnMissingDirectoryAsync() { | ||
return base.CanGetEmptyFileListOnMissingDirectoryAsync(); | ||
} | ||
|
||
[Fact] | ||
public override Task CanGetFileListForSingleFolderAsync() { | ||
return base.CanGetFileListForSingleFolderAsync(); | ||
} | ||
|
||
[Fact] | ||
public override Task CanGetFileListForSingleFileAsync() { | ||
return base.CanGetFileListForSingleFileAsync(); | ||
} | ||
|
||
[Fact] | ||
public override Task CanGetPagedFileListForSingleFolderAsync() { | ||
return base.CanGetPagedFileListForSingleFolderAsync(); | ||
} | ||
|
||
[Fact] | ||
public override Task CanGetFileInfoAsync() { | ||
return base.CanGetFileInfoAsync(); | ||
} | ||
|
||
[Fact] | ||
public override Task CanGetNonExistentFileInfoAsync() { | ||
return base.CanGetNonExistentFileInfoAsync(); | ||
} | ||
|
||
[Fact] | ||
public override Task CanSaveFilesAsync() { | ||
return base.CanSaveFilesAsync(); | ||
} | ||
|
||
[Fact] | ||
public override Task CanManageFilesAsync() { | ||
return base.CanManageFilesAsync(); | ||
} | ||
|
||
[Fact] | ||
public override Task CanRenameFilesAsync() { | ||
return base.CanRenameFilesAsync(); | ||
} | ||
|
||
[Fact] | ||
public override Task CanConcurrentlyManageFilesAsync() { | ||
return base.CanConcurrentlyManageFilesAsync(); | ||
} | ||
|
||
[Fact] | ||
public override void CanUseDataDirectory() { | ||
base.CanUseDataDirectory(); | ||
} | ||
|
||
[Fact] | ||
public override Task CanDeleteEntireFolderAsync() { | ||
return base.CanDeleteEntireFolderAsync(); | ||
} | ||
|
||
[Fact] | ||
public override Task CanDeleteEntireFolderWithWildcardAsync() { | ||
return base.CanDeleteEntireFolderWithWildcardAsync(); | ||
} | ||
|
||
[Fact] | ||
public override Task CanDeleteFolderWithMultiFolderWildcardsAsync() { | ||
return base.CanDeleteFolderWithMultiFolderWildcardsAsync(); | ||
} | ||
|
||
[Fact] | ||
public override Task CanDeleteSpecificFilesAsync() { | ||
return base.CanDeleteSpecificFilesAsync(); | ||
} | ||
|
||
[Fact] | ||
public override Task CanDeleteNestedFolderAsync() { | ||
return base.CanDeleteNestedFolderAsync(); | ||
} | ||
|
||
[Fact] | ||
public override Task CanDeleteSpecificFilesInNestedFolderAsync() { | ||
return base.CanDeleteSpecificFilesInNestedFolderAsync(); | ||
} | ||
|
||
[Fact] | ||
public override Task CanRoundTripSeekableStreamAsync() { | ||
return base.CanRoundTripSeekableStreamAsync(); | ||
} | ||
|
||
[Fact] | ||
public override Task WillRespectStreamOffsetAsync() { | ||
return base.WillRespectStreamOffsetAsync(); | ||
} | ||
} | ||
} |