Automated Snapshottesting for .NET
$ dotnet add package PolaroiderAutomated Snapshottesting for .NET
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();
Snashots help when testing objects or large strings
Visit https://wickedflame.github.io/Polaroider/ for the full documentation.
When having trouble generating Snapshots or the TestMethodNotFoundException is thrown, please make sure that the option for Optimize code is disabled *.pdb files are generated and that the Test does not depend on async/await. For more information visit https://wickedflame.github.io/Polaroider/troubleshooting
v1 was focused on simplicity. v2 is focused on flexibility while maintaining simplicity.
There are some breaking changes when updating to v2.
Before updating to v2 ensure that all tests are executed without errors. If some tests throw a MismatchException there are two possibilities:
SnapshotOptions.Setup(o =>
{
o.UseBasicFormatters();
});