![]() |
VOOZH | about |
dotnet add package OwlCore.Storage.CommonTests --version 0.6.3
NuGet\Install-Package OwlCore.Storage.CommonTests -Version 0.6.3
<PackageReference Include="OwlCore.Storage.CommonTests" Version="0.6.3" />
<PackageVersion Include="OwlCore.Storage.CommonTests" Version="0.6.3" />Directory.Packages.props
<PackageReference Include="OwlCore.Storage.CommonTests" />Project file
paket add OwlCore.Storage.CommonTests --version 0.6.3
#r "nuget: OwlCore.Storage.CommonTests, 0.6.3"
#:package OwlCore.Storage.CommonTests@0.6.3
#addin nuget:?package=OwlCore.Storage.CommonTests&version=0.6.3Install as a Cake Addin
#tool nuget:?package=OwlCore.Storage.CommonTests&version=0.6.3Install as a Cake Tool
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:
[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 file for more details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.6.3 | 146 | 3/9/2026 |
| 0.6.2 | 173 | 3/1/2026 |
| 0.6.1 | 135 | 3/1/2026 |
| 0.6.0 | 142 | 2/13/2026 |
| 0.5.2 | 403 | 6/20/2024 |
| 0.5.1 | 578 | 3/18/2024 |
| 0.5.0 | 296 | 3/18/2024 |
| 0.4.1 | 512 | 2/22/2023 |
| 0.4.0 | 411 | 2/22/2023 |
| 0.3.0 | 617 | 1/31/2023 |
| 0.2.3 | 441 | 1/31/2023 |
| 0.2.2 | 473 | 1/13/2023 |
| 0.2.1 | 471 | 12/25/2022 |
| 0.2.0 | 454 | 12/25/2022 |
| 0.1.0 | 662 | 9/13/2022 |
| 0.0.0 | 615 | 9/13/2022 |
--- 0.6.3 ---
[Improvements]
Moved PropertyWatcher_ValueUpdated_FiresOnContentChange to CommonIFileTests where it can account for implementations that don't support file writing.
Updated all dependencies to latest version and migrated corresponding code.
--- 0.6.2 ---
[Improvements]
Updated Microsoft.Bcl.AsyncInterfaces to 10.0.3.
Updated System.Linq.Async to 7.0.0. Removed the net10.0 exclusion condition - the LINQ async operators are not built into the runtime and must be referenced on all TFMs.
Updated OwlCore.Extensions to 0.11.1.
--- 0.6.1 ---
[Breaking]
CommonIModifiableFolderTests: CreateFileInFolderWithTimestampsAsync now returns CreateFileInFolderWithTimestampsResult instead of IFile?. Update abstract method implementations accordingly. CopyMovePropertyPreservation and CrossImplementationCopyMove updated to use the new return type.
[Improvements]
Added net8.0 and net9.0 as target frameworks. System.Linq.Async and Microsoft.Bcl.AsyncInterfaces are now conditioned to exclude net10.0+, where these APIs are built into the runtime.
Updated OwlCore.Extensions to 0.11.0.
[New]
Add virtual member for property watcher test timeout in CommonIModifiableFolderTests.
Add CommonIModifiableFolderTests.TimestampIsolation: four new tests asserting that setting one timestamp property (LastModifiedAt, LastAccessedAt, CreatedAt) does not silently update the others as a side effect. Motivated by Linux platform behavior: .NET's FileInfo setters call utimensat(2) without UTIME_OMIT, so setting LastAccessedAt also writes back the cached mtime and vice versa; additionally, on Linux SetCreationTime has no native creation-time syscall and routes through SetLastWriteTime, overwriting mtime as a side effect.
CommonIModifiableFolderTests.ImplicitTimestampUpdates: add OpenFileWrite_UpdatesLastAccessedAt_AtOpenTime test asserting that atime is updated when the file is opened (not when the stream is closed). Promote AreTimestampsEqual helper from private to protected for use across partials.
CommonIModifiableFolderTests: add LastAccessedAtUpdateBehavior property alongside LastModifiedAtUpdateBehavior.
Add PolySharp package reference for polyfill support.
--- 0.6.0 ---
[Breaking]
CommonIModifiableFolderTests, CommonIFileTests, and CommonIFolderTests are now declared as partial classes.
CommonIFileTests: added three new abstract factory methods — CreateFileWithCreatedAtAsync, CreateFileWithLastModifiedAtAsync, and CreateFileWithLastAccessedAtAsync. Return null to signal that the implementation cannot seed that property.
CommonIFolderTests: same pattern — added CreateFolderWithCreatedAtAsync, CreateFolderWithLastModifiedAtAsync, and CreateFolderWithLastAccessedAtAsync.
CommonIModifiableFolderTests: added two new abstract factory methods — CreateFileInFolderWithLastModifiedAtAsync and CreateFileInFolderWithTimestampsAsync. Return null to opt out of tests that require pre-seeded timestamps.
OwlCore.Extensions dependency bumped from 0.7.0 to 0.10.0. MSTest.TestFramework bumped from 3.2.2 to 3.7.3. Removed MSTest.TestAdapter and Microsoft.NET.Test.Sdk from package dependencies (consumers supply these).
[New]
Updated to OwlCore.Storage 0.15.0 for datetime storage property support.
Added PropertyValueAvailability enum (Always, Maybe, Never) to describe whether a timestamp property is expected to return a value for a given implementation.
Added PropertyUpdateBehavior enum (Immediate, Eventual, Never) to describe when a timestamp property is expected to reflect changes after a triggering operation.
CommonIFileTests and CommonIFolderTests: added virtual properties CreatedAtAvailability, LastModifiedAtAvailability, LastAccessedAtAvailability, CreatedAtUpdateBehavior, LastModifiedAtUpdateBehavior, and LastAccessedAtUpdateBehavior. All default to Always / Immediate; override to loosen assertions for cloud or immutable backends. Timestamp partial files (CreatedAt, LastModifiedAt, LastAccessedAt, and their Offset variants) now use these properties to gate and adjust assertions.
Added CommonIModifiableFolderTests.FilePropertyPersistence: tests that calling UpdateValueAsync on ICreatedAt, ILastModifiedAt, and ILastAccessedAt (and their Offset variants) for a file round-trips the value correctly.
Added CommonIModifiableFolderTests.FolderPropertyPersistence: same as above for folders.
Added CommonIModifiableFolderTests.ImplicitTimestampUpdates: tests that storage operations implicitly update the expected timestamp — OpenFileRead_UpdatesLastAccessedAt, OpenFileWrite_UpdatesLastAccessedAt, WriteFile_UpdatesLastModifiedAt, FolderIteration_UpdatesLastAccessedAt, CreateFileInFolder_UpdatesFolderLastModifiedAt, CreateFolderInFolder_UpdatesFolderLastModifiedAt, DeleteFileFromFolder_UpdatesFolderLastModifiedAt, and DeleteFolderFromFolder_UpdatesFolderLastModifiedAt.
Added CommonIModifiableFolderTests.CopyMovePropertyPreservation: tests that CreateCopyOfAsync does not preserve CreatedAt or LastAccessedAt (new file gets current time) but does preserve LastModifiedAt, and that MoveFromAsync preserves all three timestamps.
Added CommonIModifiableFolderTests.CrossImplementationCopyMove: tests copy/move between a real implementation and a mock (and vice versa), confirming timestamp semantics hold regardless of which side supplies or receives the file.
Added CommonIModifiableFolderTests.PropertyWatcher: tests for IPropertyWatcher — GetWatcherAsync_ReturnsNonNullWatcher, ValueUpdated_FiresOnPropertyUpdate, ValueUpdated_FiresOnContentChange, Dispose_StopsEvents, DisposeAsync_StopsEvents, MultipleWatchers_AllReceiveEvents, CrossInstance_Notification, DisposeOne_OthersStillWork, CreatedAt_ValueUpdated_Fires, and LastAccessedAt_ValueUpdated_Fires.
Added MockStorageFile, MockStorageFolder, and MockModifiableProperty — in-memory mock implementations used by CrossImplementationCopyMove tests and available to consumers for the same purpose.
Added AssertEx with ThrowsException{T} and ThrowsExceptionAsync{T} helpers that accept any base type T, catching derived exception types rather than requiring an exact match (unlike the built-in MSTest Assert.ThrowsException).
--- 0.5.2 ---
[Fix]
Fixed an issue where Assert.ThrowsException explicitly checks for an OperationCanceledException, not the exceptions that derive from it. Some libraries throw a TaskCanceledException instead of an OperationCanceledException, which may cause issues with tests.
--- 0.5.1 ---
[Improvements]
Added detailed error messages for why CommonIModifiableFolder tests fail and where to check your code for issues.
--- 0.5.0 ---
[Breaking]
Inherited breaking changes and adjusts tests for OwlCore.Storage 0.10.0.
[Fixes]
Fixes an issue with CommonIModifiableFolderTests where Move wasn't being tested properly.
--- 0.4.1 ---
[Fixes]
Inherited fixes from OwlCore.Storage 0.8.2.
--- 0.4.0 ---
[Breaking]
Inherited breaking changes from OwlCore.Storage 0.8.0.
--- 0.3.0 ---
[Breaking]
Renamed IModifiableFolderTests to CommonIModifiableFolderTests. This was a typo and has been corrected.
[Improvements]
Added CommonIFileTests.SupportsWriting boolean to handle testing read-only file sources.
[Fixes]
Fixed crashing file tests for implementations that return a stream which that doesn't support checking the position property.
--- 0.2.3 ---
[Improvements]
Updated all NuGet package dependencies for upstream bug fixes.
--- 0.2.2 ---
[New]
Added new unit test for IModifiableFolder to make sure a subfolder with items doesn't throw when deleted.
--- 0.2.1 ---
[Improvements]
Updated all NuGet package dependencies. Fixes an issue where tests decorated with DataRowAttribute weren't visible to consuming projects.
[Fixes]
Fixed a test failure caused by usage of the method Assert.AreSame().
--- 0.2.0 ---
[New]
Added CommonIModifiableFolderTests.
--- 0.1.0 ---
[Breaking]
Fixed the namespace for CommonIFileTests and CommonIFolderTests. They now reside under OwlCore.Storage.CommonTests, instead of OwlCore.Storage.Tests.CommonTests.
--- 0.0.0 ---
[New]
Initial release of OwlCore.Storage.CommonTests.