dupdobnightly - NFluent 2.4.0-beta-0183

NFluent is an ergonomic check library which aims to fluent your .NET TDD experience (based on simple Check.That() check statements). NFluent aims your tests to be fluent to write (with an 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 directly, but also freely, inspired by the awesome Java FEST fluent check/reflection library (http://fest.easytesting.org/).

PM> Install-Package NFluent -Version 2.4.0-beta-0183 -Source https://www.myget.org/F/dupdobnightly/api/v3/index.json

Copy to clipboard

> nuget.exe install NFluent -Version 2.4.0-beta-0183 -Source https://www.myget.org/F/dupdobnightly/api/v3/index.json

Copy to clipboard

> dotnet add package NFluent --version 2.4.0-beta-0183 --source https://www.myget.org/F/dupdobnightly/api/v3/index.json

Copy to clipboard
<PackageReference Include="NFluent" Version="2.4.0-beta-0183" />
Copy to clipboard
source https://www.myget.org/F/dupdobnightly/api/v3/index.json

nuget NFluent  ~> 2.4.0-beta-0183
Copy to clipboard

> choco install NFluent --version 2.4.0-beta-0183 --source https://www.myget.org/F/dupdobnightly/api/v2

Copy to clipboard
Import-Module PowerShellGet
Register-PSRepository -Name "dupdobnightly" -SourceLocation "https://www.myget.org/F/dupdobnightly/api/v2"
Install-Module -Name "NFluent" -RequiredVersion "2.4.0-beta-0183" -Repository "dupdobnightly" -AllowPreRelease
Copy to clipboard

V 2.4.0 (beta)


Main feature: Custom explicit error message

You can now provides explicit error messages for each check, thanks to WithCustomMessage. E.g:

Check.WithCustomMessage("Ticket must be valid at this stage").That(ticket.Status).IsEqualTo(Status.Valid);

This feature has often been requested, we are happy to finaly deliver it, but please keep on properly

naming your test methods.

Feature is alpha at this stage, final naming may change.

New checks

  • IsInAscendingOrder: checks if an IEnumerable is sorted in ascending orders, it accepts an optional comparer instance

  • IsInDescendingOrder: checks if an IEnumerable is sorted in descending orders, it accepts an optional comparer instance

  • IsSubSetOf: checks if an IEnumerable is a subset of another collection.

Fixes

  • Exception when using HasElementThatMatches or ContainsOnlyElementsThatMatch on arrays, and possibly

other enumerable types.

  • Exception when using multidimensional arrays (such as int[2,5]) with Considering/HasFiedsWithSameValueAs.

  • false Negative when comparing multimensionnal arrays, e.g.: int[3,5] was equal to int[5,3] and with int[15].

GitHub Issues

  • #255, #38, #166

V 2.3.1


Fixes

  • NullReferenceException on failed check using xUnit and NetCore

GitHub Issues

  • #251

V 2.3.0


Main feature: redesigned extensibility

One of the fundamental features of NFluent is that you can add your own checks.

Articles explained how to do that, but syntax was still too cumbersome

for our taste. This version brings major improvements detailed here:

  • Simplified support for creating custom checks thanks to new helper methods

and classes (see https://github.com/tpierrain/NFluent/wiki/Extensibility)

  • Customization of error reporting: by default, any check failure is reported

by raising an exception. You can now provide your own reporting system. You need to provide an implementation

of IErrorReporter interface, and specify you want to use it by setting the Check.Reporter interface.

Other New features(s)

  • IsNullOrWhiteSpace: checks if a string is null, empty or contains only white space(s).

  • IReadOnlyDictionary (Net 4.5+)

  • ContainsKey, ContainsValue, ContainsPair are supported.

  • async method/delegates

  • Check.ThatCode now supports async methods/delegates transparently.

  • Check expression now provides the result as a string. I.e Check.That(true).IsTrue().ToString() returns "Success".

  • New check: IsDefaultValue, which fails if the sut is not the default value for its type: null for ref types, 0 for value types.

  • New check: ContainsNoDuplicateItem for enumerable, that fails of it contains a dupe.

  • New check: IsEquivalentTo for enumerable, that checks if its contents match an expected content, disregarding order.

  • New check: DoesNotContainNull for enumerable, that fails if an entry is null.

  • New check: IsAnInstanceOfOneOf that checks if the sut is of one of exptected types.

  • New check: IsNotAnInstanceOfThese that checks if the sut type is different from a list of forbidden types.

  • New check: DueToAnyFrom(...) that checks that an exception has been triggered by another exception from a list of possible types.

Fixes

  • Check.ThatCode(...).Not.Throws<T>() may throw an InvalidCastException when thrown exception is not T.

  • Extension checks to Throw<>, ThrowType or ThrowAny raise an exception when used with Not as it does not make sense.

  • Which() raises an exception when used on a negated check (Not).

  • Fix exception when using Considering and indexed properties.

  • Fix loss of type when using Contains and ContainsExactly. This restores fluentness for IEnumerable

Fixed error messages for double (and float) equality check that reported checked value in place of the expected one.

  • Fixed error messages for Check.That(TimeSpan).IsGreaterThan

  • False positive whith Considering() or HasFieldsWithSameValues when haing ints and enum attributes with the same value.

Changes

  • Improved error messages

  • ContainsOnlyElementsThatMatch: now provides the index and value of the first failing value.

  • IsOnlyMadeOf: improved error messages

  • DateTime checks: revamped all messages

  • Enum: error message on enum types now use 'enum' instead of 'value'.

  • IsInstanceOf: be more specific regarding types

  • Considering()...IsNull/IsNotNull: error messages specify member triggering the failure.

  • Breaking

  • Added automatic conversion between decimal and other numerical types. Check.That(100M).IsEqualTo(100) no longer fails.

  • Removed Failure method from IChecker interface

GitHub Issues

  • #228, #227, #222, #223, #217, #230, #232,

  • #236, #238, #242, #243, #244, #245, #246,

  • #231, #247, #161, #249


  • .NETFramework 2.0: 2.0.0.0
  • .NETFramework 3.0: 3.0.0.0
  • .NETFramework 3.5: 3.5.0.0
  • .NETFramework 4.0: 4.0.0.0
  • .NETFramework 4.5: 4.5.0.0
  • Portable Class Library (.NETFramework 4.5, Silverlight 5.0, Windows 8.0): Profile47: 0.0.0.0
  • .NETStandard 1.3: 1.3.0.0
  • .NETStandard 2.0: 2.0.0.0

Owners

Dupdob

Authors

Thomas PIERRAIN, Cyrille DUPUYDAUBY, Rui CARVALHO, Marc-Antoine LATOUR

Project URL

http://www.n-fluent.net/

License

Apache-2.0

Tags

tdd bdd test fluent check checks easy nunit xunit mbunit mstestsucks

Info

262 total downloads
21 downloads for version 2.4.0-beta-0183
Download (760.05 KB)
Found on the current feed only

Package history

Version Size Last updated Downloads Mirrored?
3.0.0-beta-0250 634.56 KB Fri, 04 Feb 2022 15:10:23 GMT 23
3.0.0-beta-0246 640.28 KB Wed, 13 Oct 2021 10:03:19 GMT 21
3.0.0-beta-0245 638.54 KB Mon, 11 Oct 2021 21:43:04 GMT 5
3.0.0-beta-0244 638.07 KB Mon, 11 Oct 2021 13:07:00 GMT 3
3.0.0-beta-0241 628.11 KB Tue, 22 Jun 2021 07:44:49 GMT 2
3.0.0-beta-0238 774.62 KB Tue, 16 Feb 2021 21:16:51 GMT 64
3.0.0-beta-0237 773.02 KB Sat, 13 Feb 2021 15:06:07 GMT 5
3.0.0-beta-0236 764.76 KB Sun, 24 Jan 2021 15:23:35 GMT 5
3.0.0-beta-0223 764.58 KB Wed, 16 Dec 2020 21:28:20 GMT 3
3.0.0-beta-0222 761.9 KB Thu, 22 Oct 2020 07:46:33 GMT 7
3.0.0-beta-0220 761.89 KB Wed, 14 Oct 2020 07:22:28 GMT 21
3.0.0-beta-0216 761.89 KB Tue, 13 Oct 2020 13:59:47 GMT 19
3.0.0-beta-0214 756.99 KB Thu, 23 Jul 2020 07:02:28 GMT 4
2.7.0-beta-0213 1.44 MB Wed, 29 Jan 2020 06:07:43 GMT 19
2.6.0-beta-0197 1.3 MB Fri, 03 May 2019 07:05:26 GMT 3
2.5.1-beta-0194 1.24 MB Fri, 22 Mar 2019 21:38:54 GMT 5
2.4.0-beta-0187 881.53 KB Thu, 06 Sep 2018 20:18:31 GMT 5
2.4.0-beta-0186 881.49 KB Thu, 06 Sep 2018 12:51:55 GMT 5
2.4.0-beta-0183 760.05 KB Thu, 19 Jul 2018 15:57:18 GMT 21
2.4.0-beta-0182 758.11 KB Wed, 18 Jul 2018 13:18:25 GMT 22