tpierrain / NFluent

Smooth your .NET TDD experience with NFluent! NFluent is an ergonomic assertion library which aims to fluent your .NET TDD experience (based on simple Check.That() assertion statements). NFluent aims your tests to be fluent to write (with a super-duper-happy 'dot' auto-completion experience), fluent to read (i.e. as close as possible to plain English expression), but also fluent to troubleshoot, in a less-error-prone way comparing to the classical .NET test frameworks. NFluent is also directly inspired by the awesome Java FEST Fluent assertion/reflection library (http://fest.easytesting.org/)
Apache License 2.0
310 stars 53 forks source link

Simplify IsEqualTo for complex types #323

Closed dupdob closed 1 year ago

dupdob commented 4 years ago

Expected Behavior

NFluent could autodetect anonymous types and triggers a specific method and performs a Considering like approach in this situation

Current Behavior

With NFluent 2.x, if you want to use IsEqualTo with a custom class/type, one has to implement the Equals method or use `Considering'.

Possible Solution

  Check.That(sut).IsEqualTo(new {Field = 12, Label = "some Label");