Polaroider 2.0.7

There is a newer version of this package available.
See the version list below for details.
dotnet add package Polaroider --version 2.0.7                
NuGet\Install-Package Polaroider -Version 2.0.7                
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.0.7" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Polaroider --version 2.0.7                
#r "nuget: Polaroider, 2.0.7"                
#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.0.7

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

Polaroider

Automated Snapshottesting for .NET

Build status Build status

NuGet Version NuGet Version

Quality Gate Status 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 objects don't change. When adding or removing properties insid objects, these are automatically captured and asserted in the tests
  • Sanpshots ensure the state of objects. All data and property values of objects are validated and asserted
  • Simplify testing that big strings are be same. Just create a snapshot of the string and compare them in any further 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 278 1/22/2024
2.2.0 188 12/15/2023
2.1.0 324 4/14/2023
2.0.7 395 1/17/2023
2.0.6 769 5/27/2022
2.0.5 483 4/3/2022
2.0.4 2,069 11/26/2021
2.0.3 535 10/7/2021
2.0.2 360 9/6/2021
2.0.1 340 8/31/2021
2.0.0 376 4/22/2021
1.1.5 368 2/6/2021
1.1.4 398 1/12/2021
1.1.3 428 11/18/2020
1.1.2 546 10/24/2020
1.1.0 487 8/4/2020
1.0.3 631 3/16/2020
1.0.2 544 3/2/2020
0.4.0 526 2/17/2020
0.3.2 488 2/6/2020
0.3.1 528 2/4/2020
0.3.0 497 2/4/2020
0.2.0 466 2/2/2020
0.1.0 618 1/31/2020