https://github.com/fluentassertions/fluentassertions.analyzers
Analyzers based on the FluentAssertions best practices docs
https://github.com/fluentassertions/fluentassertions.analyzers
analyzers assertions c-sharp fluent-assertions fluentassertions hacktoberfest mstest unit-testing xunit
Last synced: 12 days ago
JSON representation
Analyzers based on the FluentAssertions best practices docs
- Host: GitHub
- URL: https://github.com/fluentassertions/fluentassertions.analyzers
- Owner: fluentassertions
- License: mit
- Created: 2017-10-08T19:29:12.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-11-24T09:03:19.000Z (5 months ago)
- Last Synced: 2024-12-04T04:34:20.400Z (5 months ago)
- Topics: analyzers, assertions, c-sharp, fluent-assertions, fluentassertions, hacktoberfest, mstest, unit-testing, xunit
- Language: C#
- Homepage: https://www.fluentassertions.com/tips
- Size: 1.34 MB
- Stars: 138
- Watchers: 4
- Forks: 21
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Extension methods to fluently assert the outcome of .NET tests
[](https://github.com/fluentassertions/fluentassertions.analyzers/actions/workflows/ci.yml)
[](https://github.com/fluentassertions/fluentassertions.analyzers/releases/latest)
[](https://www.nuget.org/packages/fluentassertions.analyzers)
[](https://libraries.io/nuget/fluentassertions.analyzers)
[](https://github.com/fluentassertions/fluentassertions.analyzers/stargazers)
[](https://github.com/fluentassertions/fluentassertions.analyzers/graphs/contributors)
[](https://github.com/fluentassertions/fluentassertions.analyzers)
[](https://github.com/fluentassertions/fluentassertions.analyzers/graphs/commit-activity)
[](https://github.com/fluentassertions/fluentassertions.analyzers/issues)A collection of Analyzers based on the best practices [tips](https://fluentassertions.com/tips/).

## Analysis and Code Fix in Action

## Install
using the latest stable version:
```powershell
dotnet add package FluentAssertions.Analyzers
```## Docs
- [FluentAssertions Analyzer Docs](docs/FluentAssertionsAnalyzer.md)
- [MsTest Analyzer Docs](docs/MsTestAnalyzer.md)
- [NUnit4 Analyzer Docs](docs/Nunit4Analyzer.md)
- [NUnit3 Analyzer Docs](docs/Nunit3Analyzer.md)
- [Xunit Analyzer Docs](docs/XunitAnalyzer.md)## Configuration
© Thanks to https://github.com/meziantou/Meziantou.FluentAssertionsAnalyzers
You can exclude assertion methods using the `.editorconfig` file:
```ini
[*.cs]
ffa_excluded_methods=M:NUnit.Framework.Assert.Fail;M:NUnit.Framework.Assert.Fail(System.String)
```## Getting Started
### Build
```bash
dotnet build
```### Tests
```bash
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