Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ public class CollectionTests
[AssertionDiagnostic(@"var array = new string[1, 1]; array.Length.Should().Be(0{0});")]
[AssertionDiagnostic(@"var array = new string[2, 2]; array.Length.Should().Be(0{0});")]
[AssertionDiagnostic(@"var array = new string[3, 3, 3]; array.Length.Should().Be(0{0});")]
[AssertionDiagnostic(@"int[] array1 = [1, 2, 3]; int[] array2 = [4, 5, 6]; int[] both = [..array1, ..array2]; (array1.Length + array2.Length).Should().Be(both.Length{0});")]
[Implemented(Reason = "https://github.com/fluentassertions/fluentassertions.analyzers/issues/309")]
public void CollectionShouldHaveCount_LengthShouldBe_TestNoAnalyzer(string assertion) => DiagnosticVerifier.VerifyCSharpDiagnosticUsingAllAnalyzers(new StringBuilder()
.AppendLine("using System;")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public const string DiagnosticId = "FAA0001";
public const string Message = "Clean up FluentAssertion usage";

protected static readonly DiagnosticDescriptor Rule = new DiagnosticDescriptor(DiagnosticId, Title, Message, Constants.Tips.Category, DiagnosticSeverity.Info, true);

Check warning on line 19 in src/FluentAssertions.Analyzers/Tips/FluentAssertionsAnalyzer.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Enable analyzer release tracking for the analyzer project containing rule 'FAA0001' (https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md)

Check warning on line 19 in src/FluentAssertions.Analyzers/Tips/FluentAssertionsAnalyzer.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Enable analyzer release tracking for the analyzer project containing rule 'FAA0001' (https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md)

Check warning on line 19 in src/FluentAssertions.Analyzers/Tips/FluentAssertionsAnalyzer.cs

View workflow job for this annotation

GitHub Actions / Performance regression check

Enable analyzer release tracking for the analyzer project containing rule 'FAA0001' (https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md)

Check warning on line 19 in src/FluentAssertions.Analyzers/Tips/FluentAssertionsAnalyzer.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Enable analyzer release tracking for the analyzer project containing rule 'FAA0001' (https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md)

Check warning on line 19 in src/FluentAssertions.Analyzers/Tips/FluentAssertionsAnalyzer.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, Release)

Enable analyzer release tracking for the analyzer project containing rule 'FAA0001' (https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md)

Check warning on line 19 in src/FluentAssertions.Analyzers/Tips/FluentAssertionsAnalyzer.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, Release)

Enable analyzer release tracking for the analyzer project containing rule 'FAA0001' (https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md)

Check warning on line 19 in src/FluentAssertions.Analyzers/Tips/FluentAssertionsAnalyzer.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, Debug)

Enable analyzer release tracking for the analyzer project containing rule 'FAA0001' (https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md)

Check warning on line 19 in src/FluentAssertions.Analyzers/Tips/FluentAssertionsAnalyzer.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, Debug)

Enable analyzer release tracking for the analyzer project containing rule 'FAA0001' (https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md)

Check warning on line 19 in src/FluentAssertions.Analyzers/Tips/FluentAssertionsAnalyzer.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest, Release)

Enable analyzer release tracking for the analyzer project containing rule 'FAA0001' (https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md)

Check warning on line 19 in src/FluentAssertions.Analyzers/Tips/FluentAssertionsAnalyzer.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest, Release)

Enable analyzer release tracking for the analyzer project containing rule 'FAA0001' (https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md)

Check warning on line 19 in src/FluentAssertions.Analyzers/Tips/FluentAssertionsAnalyzer.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest, Debug)

Enable analyzer release tracking for the analyzer project containing rule 'FAA0001' (https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md)

Check warning on line 19 in src/FluentAssertions.Analyzers/Tips/FluentAssertionsAnalyzer.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest, Debug)

Enable analyzer release tracking for the analyzer project containing rule 'FAA0001' (https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md)

Check warning on line 19 in src/FluentAssertions.Analyzers/Tips/FluentAssertionsAnalyzer.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest, Debug)

Enable analyzer release tracking for the analyzer project containing rule 'FAA0001' (https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md)

Check warning on line 19 in src/FluentAssertions.Analyzers/Tips/FluentAssertionsAnalyzer.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest, Debug)

Enable analyzer release tracking for the analyzer project containing rule 'FAA0001' (https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md)

Check warning on line 19 in src/FluentAssertions.Analyzers/Tips/FluentAssertionsAnalyzer.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest, Release)

Enable analyzer release tracking for the analyzer project containing rule 'FAA0001' (https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md)

Check warning on line 19 in src/FluentAssertions.Analyzers/Tips/FluentAssertionsAnalyzer.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest, Release)

Enable analyzer release tracking for the analyzer project containing rule 'FAA0001' (https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md)

public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);

Expand Down Expand Up @@ -334,7 +334,8 @@

}
}
if (invocation.TryGetFirstDescendent<IPropertyReferenceOperation>(out var propertyBeforeShould))
var argument = invocation.Arguments[0].Value.UnwrapConversion();
if (argument is IPropertyReferenceOperation propertyBeforeShould)
{
switch (propertyBeforeShould.Property.Name)
{
Expand Down
Loading