fluentassertions.analyzers icon indicating copy to clipboard operation
fluentassertions.analyzers copied to clipboard

Analyzers based on the FluentAssertions best practices docs

Results 46 fluentassertions.analyzers issues
Sort by recently updated
recently updated
newest added

### Description Analyzer incorrectly recommends `ContainsSingle()` for `HaveCount(1).And.Contains(predicate)` but looking at the tests for ContaiansSingle they are not equivalent as shown by this test https://github.com/fluentassertions/fluentassertions/blob/501cf353ecc872154fae54960ee1b692851bfb8a/Tests/FluentAssertions.Specs/Collections/GenericCollectionAssertionsSpecs.cs#L302-L314 which passes when a collection...

bug

### Description The rules `CollectionShouldContainSingleAnalyzer` and `CollectionShouldBeEmptyAnalyzer` throws `InvalidOperationException` with message `This operation does not apply to an empty instance`. For some weird reason, the stack trace disappear every time...

bug
help wanted

failing test demonstrating fluentassertions/fluentassertions.analyzers#82

```csharp // cloudEvent.Time is Nullable (cloudEvent.Time?.ToUniversalTime()).Should().Be(cloudEvent2.Time?.ToUniversalTime()); ``` This code will get a NullConditionalAssertion warning. But ```csharp var x = cloudEvent.Time?.ToUniversalTime(); x.Should().Be(cloudEvent2.Time?.ToUniversalTime()); ``` has no warning. Is it a bug of...

### Description When a class implements `IDictionary` and a custom `ContainsKey(TKey1, TKey2)`, the analyzer does not distinguish between `IDictionary.ContainsKey(TKey)` and `ContainsKey(TKey1, TKey2)`. Related to #65 ### Complete minimal example reproducing...

### Description When installing the NuGet-package using paket, an IOException is thrown: ``` Paket failed with -> Error during extraction of D:\projects\...\packages\FluentAssertions.Analyzers\fluentassertions.analyzers.0.11.4.nupkg. In rare cases a firewall might have blocked...

### Description In some of my projects I get the following error when building: ``` CSC : warning AD0001: Analyzer 'FluentAssertions.Analyzers.CollectionShouldHaveCountAnalyzer' threw an exception of type 'System.InvalidOperationException' with message 'This...

bug

https://github.com/fluentassertions/fluentassertions/blob/5.2.0/docs/_data/tips/datetimes.yml

enhancement

https://github.com/fluentassertions/fluentassertions/blob/master/docs/_data/tips/types.yml

enhancement

for example: ```cs public class MyCustomException : Exception { public string MyCustomProperty { get; } public MyCustomException(string myCustomProperty) { MyCustomProperty = MyCustomProperty; } } ``` when hovering over the property...

idea