FluentAssertions 1.7.0

A very extensive set of extension methods for .NET 3.5, 4.0 and Silverlight 4.0 that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit test.

There is a newer version of this package available.
See the version list below for details.
Install-Package FluentAssertions -Version 1.7.0
dotnet add package FluentAssertions --version 1.7.0
<PackageReference Include="FluentAssertions" Version="1.7.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FluentAssertions --version 1.7.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Release Notes

- Added methods for asserting that a collection of types matching a predicate have specific methods that are virtual or marked with a specific attribute.
     - Added methods for asserting XElements and Xattributes
     - Added support for recursively comparing the properties of nested (collection of objects ). By default it will compare all properties of the expected object graph, unless SharedProperties is used.
     - Added a fallback mechanism so that if FA cannot find any of the supported frameworks, it will fall back to using a custom AssertFailedException exception class rather than crashing.
     - Added support for ComparisonMode.StartWith and ComparisonMode.StartWithEquivalent when asserting the message of an exception.
     - For assertions that verify against a Type, the failure message will use the AssemblyQualifiedName rather than just the name of the type.
     - Fixed a bug so that collection.Should().OnlyContain(lamba) now throws if the collection is empty. See this discussion for more details.
     - Minor fix that ignores trailing blank characters when looking for the 'because' text in the reason of an assertion.
     - Added better and deeper detection of cyclic references when recursively comparing properties or generating a string representation of a complex object graph.
     - For long strings, the error message for string.Should().StartWith() places the actual and expected strings on seperate lines. This makes it easier to find the differences.

Dependencies

This package has no dependencies.

NuGet packages (242)

Showing the top 5 NuGet packages that depend on FluentAssertions:

Package Downloads
FluentAssertions.Json
Fluent Assertions extensions for Newtonsoft.Json
FluentValidation.Validators.UnitTestExtension
A unit test library for .NET that allows you to build tests for FluentValidation rules in easy way.
FluentAssertions.Mvc5
Fluent Assertions extensions for ASP.NET MVC 5.
FluentAssertions.Autofac
Fluent Assertions extensions for Autofac
LCore
C# Extensions Method Library

GitHub repositories (335)

Showing the top 5 popular GitHub repositories that depend on FluentAssertions:

Repository Stars
App-vNext/Polly
Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. From version 6.0.1, Polly targets .NET Standard 1.1 and 2.0+.
restsharp/RestSharp
Simple REST and HTTP API Client for .NET
felixse/FluentTerminal
A Terminal Emulator based on UWP and web technologies.
IdentityServer/IdentityServer4
OpenID Connect and OAuth 2.0 Framework for ASP.NET Core
dotnet/machinelearning
ML.NET is an open source and cross-platform machine learning framework for .NET.

Version History

Version Downloads Last updated
6.0.0-alpha0001 32,715 7/24/2020
5.10.3 7,595,733 3/21/2020
5.10.2 2,541,697 2/9/2020
5.10.0 2,377,390 1/2/2020
5.9.0 6,353,675 8/28/2019
5.8.0 1,034,848 8/9/2019
5.7.0 3,596,299 6/8/2019
5.6.0 7,645,312 1/11/2019
5.5.3 2,194,750 11/20/2018
5.5.1 173,245 11/16/2018
5.4.2 2,342,970 9/14/2018
5.4.1 3,350,231 6/20/2018
5.4.0 388,278 6/13/2018
5.3.2 587,240 5/30/2018
5.3.0 1,620,491 4/19/2018
5.2.0 1,168,424 3/15/2018
5.1.2 835,199 2/19/2018
5.1.1 156,336 2/14/2018
5.0.0 810,265 2/4/2018
4.19.4 5,160,464 8/24/2017
4.19.3 1,111,815 7/4/2017
4.19.2 2,686,586 3/8/2017
4.19.0 993,323 2/4/2017
4.18.0 1,472,142 12/4/2016
4.17.0 575,108 11/9/2016
4.16.0 266,640 10/26/2016
4.15.0 192,847 10/11/2016
4.14.0 702,874 9/5/2016
4.13.1 81,333 9/1/2016
4.13.0 328,635 8/2/2016
4.12.0 379,894 7/15/2016
4.11.0 195,535 7/6/2016
4.10.0 19,412 7/5/2016
4.9.1 206,943 6/23/2016
4.9.0 123,882 6/13/2016
4.8.0 55,568 6/7/2016
4.7.0 44,797 6/6/2016
4.6.3 242,069 5/24/2016
4.6.2 42,567 5/22/2016
4.6.1 108,392 5/13/2016
4.5.0 220,912 4/25/2016
4.4.0 138,473 4/17/2016
4.3.2 71,404 4/3/2016
4.3.1 4,159 4/1/2016
4.3.0 61,942 3/31/2016
4.2.2 472,487 2/5/2016
4.2.1 254,766 1/10/2016
4.2.0 190,286 1/8/2016
4.1.1 143,813 12/13/2015
4.1.0 274,195 11/24/2015
4.0.1 286,191 10/21/2015
4.0.0 393,053 8/24/2015
4.0.0-beta0001 2,455 8/7/2015
3.5.0 248,190 8/2/2015
3.4.1 228,338 7/3/2015
3.4.0 81,058 6/22/2015
3.3.0 636,788 2/18/2015
3.2.2 217,343 12/12/2014
3.2.1 290,242 9/11/2014
3.1.229 168,758 7/29/2014
3.0.107 242,774 4/30/2014
2.2.0 482,785 12/30/2013
2.1.0 213,574 8/23/2013
2.0.1 233,105 3/3/2013
2.0.0.1 102,962 10/15/2012
1.7.1.1 72,392 3/24/2012
1.7.0 8,997 1/13/2012
1.6.0 10,907 10/31/2011
1.5.0 7,602 6/29/2011
1.4.0 4,814 3/14/2011
1.3.0.1 12,599 1/15/2011
Show less