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

Allow direct Checks on Collection size #291

Closed tpierrain closed 5 years ago

tpierrain commented 5 years ago

It would be nice to have a way to check on the collection {size|length|count} directly from the collection instance.

e.g.:

    Check.That(refData.AgentsByRole.Values).HasSizeWhich.IsStrictlyGreaterThan(42);

instead of the existing:

    Check.That(refData.AgentsByRole.Values.Count).IsStrictlyGreaterThan(42);
dupdob commented 5 years ago

I propose ‘WhichSize’ instead is HasSize

yhan commented 5 years ago

I propose ‘WhichSize’ instead is HasSize

Maybe WhoseSize is more English :)

note: edited to fix typo in quoted part

dupdob commented 5 years ago

indeed Whose is definitely better

dupdob commented 5 years ago

Started working on it. Interestingly, it requires new and improved extension points