SwissLife-OSS / snapshooter

Snapshooter is a snapshot testing tool for .NET Core and .NET Framework
https://swisslife-oss.github.io/snapshooter/
MIT License
302 stars 29 forks source link

Add support for lambda expressions instead of json path for ignore and accept #154

Closed TimHolzherr closed 1 year ago

TimHolzherr commented 2 years ago

This PR is a work in progress

We can now accept and ignore fields in a type safe way.

Open point: We have 3 syntax how we can assert a snapshot.

Due to limitations with generics we cannot support lambda expressions for both the MatchSnapshot and the fluent assertion way. The current state of the pr only supports lambda expressions for fluent assertions and for static snapshot matches. We could support lambda expressions for all 3 ways if we would perform a rename. E.g. person.Should().MatchSnapshot() would need to become person.Shoult().Match(). Not sure if this is an acceptable solution or if we should just not support lambda expressions for the MatchSnapshot extension syntax.

swisslife-bot commented 2 years ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.