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

Not keyword erase sut name #259

Closed dupdob closed 6 years ago

dupdob commented 6 years ago

When one uses Not and As to rename the sut, the custom naming is lost. As an example, this test does not generate the expected error message:

            Check.That((string) "foo")
                .As($"foo")
                .Not.IsEqualTo("foo");

gives this error message:

The checked string is equal to the given one whereas it must not.
The expected string: different from
    ["foo"]

instead of:

The checked [foo] is equal to the given one whereas it must not.
The expected [foo]: different from
    ["foo"]