Testably.Abstractions.Testing 3.2.0

dotnet add package Testably.Abstractions.Testing --version 3.2.0
NuGet\Install-Package Testably.Abstractions.Testing -Version 3.2.0
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.0" />
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.0
#r "nuget: Testably.Abstractions.Testing, 3.2.0"
#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.0

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

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.0 53 5/5/2024
3.1.2 416 4/9/2024
3.1.1 211 4/7/2024
3.1.0 589 4/1/2024
3.0.1 173 3/30/2024
3.0.0 212 3/29/2024
2.6.1 5,302 1/7/2024
2.6.0 1,226 11/16/2023
2.5.1 130 11/16/2023
2.5.0 1,894 10/7/2023
2.4.1 3,578 8/23/2023
2.4.0 126 8/23/2023
2.3.4 2,927 8/1/2023
2.3.3 684 7/24/2023
2.3.2 966 7/17/2023
2.3.1 1,045 5/15/2023
2.3.0 139 5/12/2023
2.2.2 5,837 4/18/2023
2.2.1 157 4/16/2023
2.2.0 187 4/10/2023
2.1.0 496 3/7/2023
2.0.1 521 2/6/2023
2.0.0 342 12/18/2022
1.0.0 334 11/18/2022