Skip to content

Releases: tpierrain/NFluent

V 3.0.3

12 Jan 07:48
Compare
Choose a tag to compare

This release contains an important fix (#343) regarding null returning methods and functions with Check.ThatCode.
Fix issues #342 and #343.

NFluent V3.0.1

09 Jun 09:38
Compare
Choose a tag to compare

V 3.0.1

Fix

  • Fix Check.ThatCode not awaiting Task returning lambdas in V3.0.0. Note that Task<T> returning lambdas do work in V3.0.0
  • an InvalidOperation is thrown when using Check.ThatCode on an async void method/lambda (as those cannot be awaited)

NFluent V3

09 Jun 09:37
Compare
Choose a tag to compare

Major changes

  • You can execute multiple check as a single batch and get every failures, instead of the first one. This can be achieved using:
    • Check.StartBatch: stores the result of each subsequent check(s) and notifies all the errors when the returned object is disposed. Such as
      using(Check.StartBatch()) { Check.That(sut)..... Check.That(sut).... }
      Note that any actual exception thrown during the check phase will prevent any subsequent check from behind executed (1) and may not be reported as it may be replaced by an assertion failure exception.
      This comes from C# exeption handling logic.
  • You can provide anonymous types and tuples when using IsEqualTo against any type. The check will be made against all
    sut's propertie.
  • NFluent supports Net 3.5 SP1, Net. 4.5.2 +, Net Standard 2.0+. Dropped support for Net Framework 2.0, 3.0, and 4.0, as well Net Standard<2.0.
    If you can't upgrade your framework version to a supported one, please use NFluent 2.7.1.

New Checks

  • Is: Checks if sut == expected. This is a strongly typed equivalent to IsEqualTo.
  • IsGreaterOrEqualThan: Checks if sut >= expected.
  • IsLessOrEqualThan: Checks if sut <= expected.

New feautres

  • You can provide custom comparer for any type, using Check.RegisterComparer like this Check.Register<MyType>(MyCustomComparer).
    You can also use RegisterLocalComparer to limit its usage to a declaration scope.

Breaking changes

  • Equality logic changed for IDictionary: dictionaries are considered equals if they have the same keys and
    the same values for each key. In NFluent V2, entries needed to be declared in the some order or else they were considered as different but equivalent.
  • You need to specify
  • IsAnInstanceOf<nullableType>(null) now fails (with an appropriate message). Previously, it did succeed. But,
    as captured in issue #68, this behavior was triggered by a bug and kept due to a poor error message when fixed.
  • The IStructCheck<T> interface has been removed as well as associated extensibility helper. Those were dedicated
    to value types, you can migrate your existing extensions to the ICheck<T> type instead. Please open an issue if
    you need help.

Fixes

  • HasFieldWithSameValues resulted in false positive when string fields had the same value.
  • IsNotEqualTo now properly preserves expected type
  • Improved rerporting of differences for enumerations and dictionaries to make them more consistent and fixed some inaccuracies.

The one that supports PCL and fixes lots of thing

16 Jun 21:00
Compare
Choose a tag to compare

The one that is signed

14 Feb 01:00
Compare
Choose a tag to compare

New feature(s):

  • Now supports IsNull() and IsNotNull() checks for nullables (thanks to Mendel Monteiro Beckerman for that).
  • Check.ThatCode(...): New entry point for checks on code (Action and Func). It supersedes the equivalent Check.That signature.

Change(s):

  • Improves error messages for string comparisons (e.g. visually indicates the presence of tab char with <>, or distinguish <> and <>, properly handles long strings, ...)
  • Check.That(Func) and Check.That(Action) are now obsolete.
  • The HasFieldsEqualToThose() check is now obsolete and should be replaced by HasFieldsWithSameValues() which now support anonymous classes as expected parameter.
  • The HasFieldsNotEqualToThose() check is now obsolete and should be replaced by HasNotFieldsWithSameValues()
  • Simplification of extensibility
  • We are so proud of this 1.1 version of NFuent; we decided to sign it.

Bug Fixe(s):

The one that is the v 1.0

31 Dec 01:20
Compare
Choose a tag to compare

New feature(s):

  • NFluent is now also shipped with its .NET 4.0 version (to support dynamic for extensibility)
  • Adds recursion to the HasFieldsEqualToThose() check on object

Change(s):

  • You can now easily link your own checks by using the And operator thanks to the IChecker.ReturnValueForLinkage property (if you don't want to rely on the ExtensibilityHelper class).

Bug Fixe(s):

  • IsAfter() check was throwing an exception when the givenValue type (considered as a IComparable instead of a number ;-( was not the same as the checked value.

The one that corrects the situation.

03 Nov 10:43
Compare
Choose a tag to compare

Allowing Check.That(4L).IsEqualTo(4) to work, and introducing the IsNull() and IsNotNull() checks.

The one before the 1.0

06 Jul 11:12
Compare
Choose a tag to compare

New features:

  • Now, the Equals() method of the ICheck<T> instances is a real fluent check method (instead of the default object.Equals() one).
  • New extensible syntax for Check.That(IEnumerable xxx).Contains(...) that permits to add suffixes narrowing the conditions (e.g.: Check.That(IEnumerable xxx).Contains(...).InThatOrder()). Possible suffixes are (Only, Once or InThatOrder)
  • Adds check methods for IDictionary
  • Adds more check methods to the IEnumerable (e.g. IsNullOrEmpty)

Changes:

  • New error message structure that clearly states what is wrong.
  • Renames the ContainsOnly() method to IsOnlyMadeOf().
  • Replaces IFluentAssertion by ICheck; and IChainableFluentAssertion by ICheckLink so that it improves the IntelliSense experience.