aweXpect.Testably 3.0.0-pre.4

Prefix Reserved
This is a prerelease version of aweXpect.Testably.
There is a newer version of this package available.
See the version list below for details.
dotnet add package aweXpect.Testably --version 3.0.0-pre.4
                    
NuGet\Install-Package aweXpect.Testably -Version 3.0.0-pre.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="aweXpect.Testably" Version="3.0.0-pre.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="aweXpect.Testably" Version="3.0.0-pre.4" />
                    
Directory.Packages.props
<PackageReference Include="aweXpect.Testably" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add aweXpect.Testably --version 3.0.0-pre.4
                    
#r "nuget: aweXpect.Testably, 3.0.0-pre.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package aweXpect.Testably@3.0.0-pre.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=aweXpect.Testably&version=3.0.0-pre.4&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=aweXpect.Testably&version=3.0.0-pre.4&prerelease
                    
Install as a Cake Tool

aweXpect.Testably

Changelog

Nuget Coverage Mutation testing badge

Expectations for the file system and time system mocks from Testably.Abstractions for aweXpect.

Installation

dotnet add package aweXpect.Testably

It does not include aweXpect itself.

At a glance

using aweXpect.Chronology; // from the aweXpect.Chronology package
using static aweXpect.Expect;

MockFileSystem fileSystem = new();
fileSystem.File.WriteAllText("let-it-be.txt", "let it be");

// verify that a file exists, together with its content
await That(fileSystem).HasFile("let-it-be.txt").WithContent("LET IT BE").IgnoringCase();

// verify the properties of the found file
await That(fileSystem).HasFile("let-it-be.txt").Which.HasLength(9);

// verify that a file does not exist
await That(fileSystem).DoesNotHaveFile("yesterday.txt");

// verify the notifications the file system raised
await That(fileSystem).TriggeredNotification(c => c.Name == "let-it-be.txt");

// verify the method calls the file system recorded
await That(fileSystem.Statistics).Recorded().File.WriteAllText().Once();

// verify how often the callback of a timer from a MockTimeSystem was executed
MockTimeSystem timeSystem = new();
ITimerMock timer = (ITimerMock)timeSystem.Timer.New(_ => { }, null, TimeSpan.Zero, 10.Milliseconds());
await That(timer).Executed().AtLeast(3.Times()).Within(5.Seconds());

A failing expectation on the file system names the path it looked for. If the file was never written, HasFile("yesterday.txt") would fail with:

Expected that fileSystem
has file "yesterday.txt",
but it did not exist

Overview

Expectations for IFileSystem:

Expectation Negated Summary
HasFile DoesNotHaveFile contains the file, optionally with its content and timestamps
HasDirectory DoesNotHaveDirectory contains the directory, optionally with its files and subdirectories
HasDrive DoesNotHaveDrive contains the drive

Expectations for IFileInfo:

Expectation Negated Summary
Exists DoesNotExist the file exists
HasName has the expected name
HasExtension has the expected extension
HasLength has the expected length
HasContent HasContent().NotEqualTo has the expected string or binary content
IsReadOnly IsNotReadOnly the file is read-only
HasAttribute DoesNotHaveAttribute has the attribute flag
HasCreationTime has the expected creation time, optionally within a tolerance
HasLastAccessTime has the expected last access time, optionally within a tolerance
HasLastWriteTime has the expected last write time, optionally within a tolerance
WhoseParent the containing directory meets expectations (.NET 10 or later)

Expectations for IDirectoryInfo:

Expectation Negated Summary
Exists DoesNotExist the directory exists
HasName has the expected name
IsEmpty IsNotEmpty contains no files or subdirectories
HasFile DoesNotHaveFile contains the file
HasDirectory DoesNotHaveDirectory contains the subdirectory
HasAttribute DoesNotHaveAttribute has the attribute flag
HasCreationTime has the expected creation time, optionally within a tolerance
HasLastAccessTime has the expected last access time, optionally within a tolerance
HasLastWriteTime has the expected last write time, optionally within a tolerance
WhoseParent the parent directory meets expectations (.NET 10 or later)

Expectations for IDriveInfo:

Expectation Negated Summary
IsReady IsNotReady the drive is ready
HasName has the expected name
HasVolumeLabel has the expected volume label
HasDriveFormat has the expected drive format
HasDriveType has the expected drive type
HasTotalSize has the expected total size
HasTotalFreeSpace has the expected total free space
HasAvailableFreeSpace has the expected available free space

Expectations for IFileVersionInfo:

Expectation Negated Summary
HasCompanyName, HasFileMajorPart, IsDebug, … IsNotDebug, … one expectation per property

Expectations for MockFileSystem:

Expectation Negated Summary
TriggeredNotification DidNotTriggerNotification the file system raised a matching notification

Expectations for IFileSystemWatcher:

Expectation Negated Summary
Triggered DidNotTrigger the watcher raised a matching event

Expectations for ChangeDescription:

Expectation Negated Summary
HasChangeType DoesNotHaveChangeType has the change type flag
HasFileSystemType DoesNotHaveFileSystemType has the file system type flag
HasNotifyFilters DoesNotHaveNotifyFilters has the notify filters flag
HasName has the expected name
HasPath has the expected path
HasOldName has the expected old name of a renamed file or directory
HasOldPath has the expected old path of a renamed file or directory

Expectations for IFileSystemStatistics:

Expectation Negated Summary
Recorded .Never() a method was called or a property was accessed

Expectations for ITimerMock:

Expectation Negated Summary
Executed .Never() the timer callback was executed

Documentation

The full documentation is available at docs.testably.org:

  • File system: files, directories and drives of an IFileSystem, and the expectations on IFileInfo, IDirectoryInfo, IDriveInfo and IFileVersionInfo
  • Notifications and recorded calls: file-system notifications, watcher events, change descriptions and the calls recorded in IFileSystemStatistics
  • Time system: the execution of ITimerMock timers
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on aweXpect.Testably:

Repository Stars
TestableIO/System.IO.Abstractions
Just like System.Web.Abstractions, but for System.IO. Yay for testable IO access!
Version Downloads Last Updated
3.0.0 102 11/11/2026
3.0.0-pre.4 119 11/10/2026
3.0.0-pre.3 595 10/29/2026
3.0.0-pre.1 61 10/28/2026
2.1.0 816 10/16/2026
2.0.0 474 10/10/2026
2.0.0-pre.2 68 10/8/2026
2.0.0-pre.1 69 9/28/2026
1.1.0 551 9/5/2026
1.0.0 741 6/4/2026
0.15.0 2,443 5/19/2026
0.14.0 200 5/18/2026
0.13.0 5,288 10/25/2025
0.12.0 1,913 9/10/2025
0.11.0 1,511 7/12/2025
0.10.0 828 6/30/2025
0.9.0 2,017 3/17/2025
0.8.0 1,079 3/2/2025
0.7.0 510 3/1/2025
0.6.0 232 2/16/2025
Loading failed