Testably.Abstractions.Testing 3.2.3

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Testably.Abstractions.Testing --version 3.2.3                
NuGet\Install-Package Testably.Abstractions.Testing -Version 3.2.3                
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="Testably.Abstractions.Testing" Version="3.2.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Testably.Abstractions.Testing --version 3.2.3                
#r "nuget: Testably.Abstractions.Testing, 3.2.3"                
#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.
// Install Testably.Abstractions.Testing as a Cake Addin
#addin nuget:?package=Testably.Abstractions.Testing&version=3.2.3

// Install Testably.Abstractions.Testing as a Cake Tool
#tool nuget:?package=Testably.Abstractions.Testing&version=3.2.3                

Testably.Abstractions Nuget Build Mutation testing badge

This library contains the testing helpers for Testably.Abstractions.

MockFileSystem

Initialization

Shows how to initialize the file system:

    fileSystem.InitializeIn("current-directory")
        .WithASubdirectory()
        .WithSubdirectory("foo").Initialized(s => s
            .WithAFile())
        .WithFile("bar.txt");

Initialize the file system in "current-directory" with

  • a randomly named directory
  • a directory named "foo" which contains a randomly named file
  • a file named "bar.txt"

In order to use multiple drives on Windows (or network shares) you have to first register them:

    fileSystem.WithDrive(@"D:", drive => drive.SetTotalSize(1024));

The optional configuration allows limiting the maximum available space on the drive.

Events

All changes in the file system trigger certain events. All events can be

  • intercepted, before they occur (and e.g. an exception thrown to prevent the event from completing) on the Intercept property:
        MockFileSystem fileSystem = new();
            fileSystem.Intercept.Creating(FileSystemTypes.File,
                _ => throw new Exception("my custom exception"));
    
  • notified, after they occured to allow a test to react to changes on the MockFileSystem.Notify property: These methods return an awaitable object that
    • Removes the notification on dispose
    • Provides a blocking mechanism until the notification happens
        MockFileSystem fileSystem = new();
        fileSystem.Notify
            .OnCreated(FileSystemTypes.File, _ =>
            {
                // Do something
            })
            .ExecuteWhileWaiting(() =>
            {
                // This will trigger the callback
                fileSystem.File.Create("some-file.txt");
            })
            .Wait();
    
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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 is compatible.  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. 
.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 is compatible. 
.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 (1)

Showing the top 1 NuGet packages that depend on Testably.Abstractions.Testing:

Package Downloads
Testably.Abstractions.FluentAssertions

FluentAssertions extension methods for `Testably.Abstractions`.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.2.4 300 11/12/2024
3.2.3 1,798 8/16/2024
3.2.2 557 7/17/2024
3.2.1 1,361 5/16/2024
3.2.0 365 5/5/2024
3.1.2 570 4/9/2024
3.1.1 249 4/7/2024
3.1.0 1,133 4/1/2024
3.0.1 205 3/30/2024
3.0.0 231 3/29/2024
2.6.1 11,861 1/7/2024
2.6.0 1,302 11/16/2023
2.5.1 162 11/16/2023
2.5.0 2,502 10/7/2023
2.4.1 5,333 8/23/2023
2.4.0 156 8/23/2023
2.3.4 3,864 8/1/2023
2.3.3 727 7/24/2023
2.3.2 1,001 7/17/2023
2.3.1 1,088 5/15/2023
2.3.0 170 5/12/2023
2.2.2 9,100 4/18/2023
2.2.1 181 4/16/2023
2.2.0 216 4/10/2023
2.1.0 531 3/7/2023
2.0.1 576 2/6/2023
2.0.0 379 12/18/2022
1.0.0 370 11/18/2022