Polaroider 2.3.0

dotnet add package Polaroider --version 2.3.0                
NuGet\Install-Package Polaroider -Version 2.3.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="Polaroider" Version="2.3.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Polaroider --version 2.3.0                
#r "nuget: Polaroider, 2.3.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 Polaroider as a Cake Addin
#addin nuget:?package=Polaroider&version=2.3.0

// Install Polaroider as a Cake Tool
#tool nuget:?package=Polaroider&version=2.3.0                

Polaroider

Automated Snapshottesting for .NET

Build status Build status

NuGet Version NuGet Version

Maintainability Rating Coverage

Codacy Badge

Simplify UnitTesting with snapshots.
Polaroider is a Approval Testing Framework that creates and compares snapshots of objects.
This makes testing of objects and their content easy and fast.

// arrange
var repository = new PersonRepository();

// act
var person = repository.LoadTestPerson(...);

// assert
person.MatchSnapshot();

Testing with Snapshots

Snashots help when testing objects or large strings

  • Snapshots ensure that object structure does not change unintendedly. When adding or removing properties in objects, these are automatically captured and asserted.
  • Sanpshots ensure the state of objects. Allways ensure the atomic state of obejcts. Any changes to the data contained in the properties of the matched object is automatically validated and asserted.
  • Simplify comparing big strings. Just create a snapshot of the string and ensure it does not change in any future testrun.

Visit https://wickedflame.github.io/Polaroider/ for the full documentation.

Troubleshooting

When having trouble generating Snapshots or the TestMethodNotFoundException is thrown, please make sure that the option for Optimize code is disabled and *.pdb files are generated. For more information visit https://wickedflame.github.io/Polaroider/troubleshooting

Update from v1 to v2

v1 was focused on simplicity. v2 is focused on flexibility while maintaining simplicity.

There are some breaking changes when updating to v2.

Mapping of simple types

  • DateTimes are mapped in the ISO 8601 format to be Culture-Independent
  • Null strings are now displayed as null
  • Empty strings are now displayed as ''

Before updating to v2 ensure that all tests are executed without errors. If some tests throw a MismatchException there are two possibilities:

  • Update the snapshots with the UpdateSnapshot Attribute
  • Set the UseBasicFormatters on the SnapshotOptions. This resets all Formatters to the same as were used in v1
SnapshotOptions.Setup(o =>
{
    o.UseBasicFormatters();
});
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 was computed.  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 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.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.3.0 306 1/22/2024
2.2.0 197 12/15/2023
2.1.0 339 4/14/2023
2.0.7 398 1/17/2023
2.0.6 773 5/27/2022
2.0.5 485 4/3/2022
2.0.4 2,071 11/26/2021
2.0.3 537 10/7/2021
2.0.2 362 9/6/2021
2.0.1 342 8/31/2021
2.0.0 379 4/22/2021
1.1.5 370 2/6/2021
1.1.4 400 1/12/2021
1.1.3 433 11/18/2020
1.1.2 550 10/24/2020
1.1.0 491 8/4/2020
1.0.3 635 3/16/2020
1.0.2 548 3/2/2020
0.4.0 530 2/17/2020
0.3.2 492 2/6/2020
0.3.1 532 2/4/2020
0.3.0 501 2/4/2020
0.2.0 471 2/2/2020
0.1.0 623 1/31/2020