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

Add ...OrEqual comparisons for numerical types #332

Closed dupdob closed 1 year ago

dupdob commented 3 years ago

Feature request: As of now, the only explicitly available comparison for numerical types are IsStrictlyGreaterThan and IsStrictlyLessThan. If one needs <= or >= comparison, one can use IsBefore or IsAfter, but those are not intuitive

Expected Behavior

NFluent should provide IsGreaterOrEqualThan and IsLessOrEqualThan for clarity.

krischik commented 3 years ago

Indeed I was just looking for an IsGreaterOrEqualThan and IsLessOrEqualThan. Checking the code IsBefore or IsAfter is not actually the solution as both will fail on equality.

To be precise what I really need is IsInRange or IsBetween. Sure you can do that with an And but that's rather clunky.

Which leaves me with the question: When will Version 3.0.0 be delivered? I'm currently only seeing Version 2.7.2.

dupdob commented 3 years ago

hello thanks for pointing out the error regarding IsBefore and IsAfter. V 3.0 is currently available in pre release (alpha status), which is production ready, with the following caveat:

  1. new features' API are not stable yet (signature may change)
  2. it is not feature complete yet
  3. it is as thoroughly tested as normal release (or beta for that matter)
dupdob commented 3 years ago

you should open an issue asking for a new check (IsInRange or IsBetween) so we can discuss the finer details there.