Fluentassertions.analyzers
Analyzers based on the FluentAssertions best practices docs
Install / Use
/learn @fluentassertions/Fluentassertions.analyzersREADME
<a href="https://www.fluentassertions.com"><img src="assets/images/fluent_assertions_analyzers_large_horizontal.svg" style="width:400px"/></a>
Extension methods to fluently assert the outcome of .NET tests
A collection of Analyzers based on the best practices tips.
Analysis and Code Fix in Action

Install
using the latest stable version:
dotnet add package FluentAssertions.Analyzers
Docs
- FluentAssertions Analyzer Docs
- MsTest Analyzer Docs
- NUnit4 Analyzer Docs
- NUnit3 Analyzer Docs
- Xunit Analyzer Docs
Configuration
© Thanks to https://github.com/meziantou/Meziantou.FluentAssertionsAnalyzers
You can exclude assertion methods using the .editorconfig file:
[*.cs]
ffa_excluded_methods=M:NUnit.Framework.Assert.Fail;M:NUnit.Framework.Assert.Fail(System.String)
Getting Started
Build
dotnet build
Tests
dotnet test --configuration Release --filter 'TestCategory=Completed'
Benchmarks
https://fluentassertions.github.io/fluentassertions.analyzers/dev/bench/
Example Usages
- https://github.com/SonarSource/sonar-dotnet/pull/2072
- https://github.com/microsoft/component-detection/pull/634
- https://github.com/microsoft/onefuzz/pull/3314
- https://github.com/chocolatey/choco/pull/2908
