Common tests that should pass for all implementations of OwlCore.Storage.
Published releases are available on NuGet. To install, run the following command in the Package Manager Console.
PM> Install-Package OwlCore.Storage.CommonTests
Or using dotnet
> dotnet add package OwlCore.Storage.CommonTests
This library should be used with MSTest.
The classes provided in this package are abstract. To use them:
- Implement a provided class
- Override and provide an implementation for the required methods
- Add a
[TestClass]
attribute to your new class.
Tests defined in the base class will be picked up by MSTest.
[TestClass]
public class IFolderTests : CommonIFolderTests
{
public override Task<IFolder> CreateFolderAsync()
{
var directoryInfo = Directory.CreateDirectory(Path.GetTempPath());
return Task.FromResult<IFolder>(new SystemFolder(directoryInfo.FullName));
}
public override Task<IFolder> CreateFolderWithItems(int fileCount, int folderCount)
{
var tempFolder = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
Directory.CreateDirectory(tempFolder);
for (var i = 0; i < fileCount; i++)
{
var path = Path.Combine(tempFolder, $"File.{i}.tmp");
using var _ = File.Create(path);
}
for (var i = 0; i < folderCount; i++)
{
var path = Path.Combine(tempFolder, $"Folder.{i}");
Directory.CreateDirectory(path);
}
return Task.FromResult<IFolder>(new SystemFolder(tempFolder));
}
}
We accept donations here and here, and we do not have any active bug bounties.
Version numbering follows the Semantic versioning approach. However, if the major version is 0
, the code is considered alpha and breaking changes may occur as a minor update.
All OwlCore code is licensed under the MIT License. OwlCore is licensed under the MIT License. See the LICENSE file for more details.