Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add test project for FluentAssertionsAnalyzer #304

Merged
merged 5 commits into from
Feb 19, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ jobs:
with:
dotnet-version: 6.0.x
- run: dotnet build
- run: dotnet test --configuration Release --filter 'TestCategory=Completed' /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura
- run: dotnet test src/FluentAssertions.Analyzers.Tests --configuration Release --filter 'TestCategory=Completed' /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura
- run: dotnet pack src/FluentAssertions.Analyzers/FluentAssertions.Analyzers.csproj
27 changes: 27 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Integration
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
env:
NUGET_CERT_REVOCATION_MODE: offline
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET 6
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
- run: dotnet test src/FluentAssertions.Analyzers.FluentAssertionAnalyzerDocs # before formatting
- run: dotnet format analyzers src/FluentAssertions.Analyzers.FluentAssertionAnalyzerDocs --diagnostics FAA0001 --severity info --verbosity normal
- run: dotnet test src/FluentAssertions.Analyzers.FluentAssertionAnalyzerDocs # after formatting
11 changes: 11 additions & 0 deletions FluentAssertions.Analyzers.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentAssertions.Analyzers.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentAssertions.Analyzers.BenchmarkTests", "src\FluentAssertions.Analyzers.BenchmarkTests\FluentAssertions.Analyzers.BenchmarkTests.csproj", "{FE6D8A05-1383-4BCD-AD65-2EF741E48F44}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{8EFE7955-E63C-4055-A9FF-76C7CE0A1151}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentAssertions.Analyzers.FluentAssertionAnalyzerDocs", "src\FluentAssertions.Analyzers.FluentAssertionAnalyzerDocs\FluentAssertions.Analyzers.FluentAssertionAnalyzerDocs.csproj", "{2F84FE09-8CB4-48AE-A119-671C509213CF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -41,11 +45,18 @@ Global
{FE6D8A05-1383-4BCD-AD65-2EF741E48F44}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FE6D8A05-1383-4BCD-AD65-2EF741E48F44}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FE6D8A05-1383-4BCD-AD65-2EF741E48F44}.Release|Any CPU.Build.0 = Release|Any CPU
{2F84FE09-8CB4-48AE-A119-671C509213CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2F84FE09-8CB4-48AE-A119-671C509213CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2F84FE09-8CB4-48AE-A119-671C509213CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2F84FE09-8CB4-48AE-A119-671C509213CF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4BF3D005-625C-4CEC-B3FB-298B956402BE}
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{2F84FE09-8CB4-48AE-A119-671C509213CF} = {8EFE7955-E63C-4055-A9FF-76C7CE0A1151}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace FluentAssertions.Analyzers.FluentAssertionAnalyzerDocs;

[TestClass]
public class CollectionTests
{
[TestMethod]
public void CollectionsShouldNotBeEmpty()
{
// arrange
IList<TestComplexClass> collection = new List<TestComplexClass>
{
new TestComplexClass { BooleanProperty = true, Message = 1 },
new TestComplexClass { BooleanProperty = false, Message = 2 }
};

// assert
collection.Any().Should().BeTrue();
}

public class TestComplexClass
{
public bool BooleanProperty { get; set; }
public int Message { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.4" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.4" />
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\FluentAssertions.Analyzers\FluentAssertions.Analyzers.csproj" />
<Analyzer Include="..\FluentAssertions.Analyzers\bin\Debug\netstandard2.0\FluentAssertions.Analyzers.dll" />
</ItemGroup>

</Project>
10 changes: 5 additions & 5 deletions src/FluentAssertions.Analyzers.Tests/Tips/CollectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ public void CollectionShouldContainSingle_TestAnalyzer_GenericIEnumerableShouldR

DiagnosticVerifier.VerifyCSharpDiagnosticUsingAllAnalyzers(source, new DiagnosticResult
{
Id = FluentAssertionsOperationAnalyzer.DiagnosticId,
Id = FluentAssertionsAnalyzer.DiagnosticId,
Message = DiagnosticMetadata.CollectionShouldContainSingle_ShouldHaveCount1.Message,
VisitorName = DiagnosticMetadata.CollectionShouldContainSingle_ShouldHaveCount1.Name,
Locations = new DiagnosticResultLocation[]
Expand Down Expand Up @@ -986,7 +986,7 @@ private void VerifyCSharpDiagnosticCodeBlock(string sourceAssertion, DiagnosticM

DiagnosticVerifier.VerifyCSharpDiagnosticUsingAllAnalyzers(source, new DiagnosticResult
{
Id = FluentAssertionsOperationAnalyzer.DiagnosticId,
Id = FluentAssertionsAnalyzer.DiagnosticId,
Message = metadata.Message,
VisitorName = metadata.Name,
Locations = new DiagnosticResultLocation[]
Expand All @@ -1003,7 +1003,7 @@ private void VerifyCSharpDiagnosticExpressionBody(string sourceAssertion, Diagno

DiagnosticVerifier.VerifyCSharpDiagnosticUsingAllAnalyzers(source, new DiagnosticResult
{
Id = FluentAssertionsOperationAnalyzer.DiagnosticId,
Id = FluentAssertionsAnalyzer.DiagnosticId,
VisitorName = metadata.Name,
Message = metadata.Message,
Locations = new DiagnosticResultLocation[]
Expand All @@ -1020,7 +1020,7 @@ private void VerifyArrayCSharpDiagnosticCodeBlock(string sourceAssertion, Diagno

DiagnosticVerifier.VerifyCSharpDiagnosticUsingAllAnalyzers(source, new DiagnosticResult
{
Id = FluentAssertionsOperationAnalyzer.DiagnosticId,
Id = FluentAssertionsAnalyzer.DiagnosticId,
Message = metadata.Message,
VisitorName = metadata.Name,
Locations = new DiagnosticResultLocation[]
Expand Down Expand Up @@ -1059,7 +1059,7 @@ private void VerifyFix(string oldSource, string newSource)
{
DiagnosticVerifier.VerifyFix(new CodeFixVerifierArguments()
.WithCodeFixProvider<FluentAssertionsCodeFixProvider>()
.WithDiagnosticAnalyzer<FluentAssertionsOperationAnalyzer>()
.WithDiagnosticAnalyzer<FluentAssertionsAnalyzer>()
.WithSources(oldSource)
.WithFixedSources(newSource)
.WithPackageReferences(PackageReference.FluentAssertions_6_12_0)
Expand Down
4 changes: 2 additions & 2 deletions src/FluentAssertions.Analyzers.Tests/Tips/DictionaryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private void VerifyCSharpDiagnostic(string sourceAssersion, DiagnosticMetadata m

DiagnosticVerifier.VerifyCSharpDiagnosticUsingAllAnalyzers(source, new DiagnosticResult
{
Id = FluentAssertionsOperationAnalyzer.DiagnosticId,
Id = FluentAssertionsAnalyzer.DiagnosticId,
Message = metadata.Message,
VisitorName = metadata.Name,
Locations = new DiagnosticResultLocation[]
Expand All @@ -184,7 +184,7 @@ private void VerifyCSharpFix(string oldSourceAssertion, string newSourceAssertio
DiagnosticVerifier.VerifyFix(new CodeFixVerifierArguments()
.WithSources(oldSource)
.WithFixedSources(newSource)
.WithDiagnosticAnalyzer<FluentAssertionsOperationAnalyzer>()
.WithDiagnosticAnalyzer<FluentAssertionsAnalyzer>()
.WithCodeFixProvider<FluentAssertionsCodeFixProvider>()
.WithPackageReferences(PackageReference.FluentAssertions_6_12_0)
);
Expand Down
4 changes: 2 additions & 2 deletions src/FluentAssertions.Analyzers.Tests/Tips/ExceptionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ private void VerifyCSharpDiagnostic(string sourceAssertion, DiagnosticMetadata m

DiagnosticVerifier.VerifyCSharpDiagnosticUsingAllAnalyzers(source, new DiagnosticResult
{
Id = FluentAssertionsOperationAnalyzer.DiagnosticId,
Id = FluentAssertionsAnalyzer.DiagnosticId,
Message = metadata.Message,
VisitorName = metadata.Name,
Locations = new DiagnosticResultLocation[]
Expand All @@ -304,7 +304,7 @@ private void VerifyCSharpFix(string oldSourceAssertion, string newSourceAssertio
DiagnosticVerifier.VerifyFix(new CodeFixVerifierArguments()
.WithSources(oldSource)
.WithFixedSources(newSource)
.WithDiagnosticAnalyzer<FluentAssertionsOperationAnalyzer>()
.WithDiagnosticAnalyzer<FluentAssertionsAnalyzer>()
.WithCodeFixProvider<FluentAssertionsCodeFixProvider>()
.WithPackageReferences(PackageReference.FluentAssertions_6_12_0)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class TestClass
}";

DiagnosticVerifier.VerifyDiagnostic(new DiagnosticVerifierArguments()
.WithDiagnosticAnalyzer<FluentAssertionsOperationAnalyzer>()
.WithDiagnosticAnalyzer<FluentAssertionsAnalyzer>()
.WithSources(source)
);
}
Expand Down Expand Up @@ -51,7 +51,7 @@ public void BeTrue() { }
}";

DiagnosticVerifier.VerifyDiagnostic(new DiagnosticVerifierArguments()
.WithDiagnosticAnalyzer<FluentAssertionsOperationAnalyzer>()
.WithDiagnosticAnalyzer<FluentAssertionsAnalyzer>()
.WithPackageReferences(PackageReference.FluentAssertions_6_12_0)
.WithSources(source)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ public class NullConditionalAssertionTests
public void NullConditionalMayNotExecuteTest(string assertion)
{
DiagnosticVerifier.VerifyDiagnostic(new DiagnosticVerifierArguments()
.WithDiagnosticAnalyzer<FluentAssertionsOperationAnalyzer>()
.WithDiagnosticAnalyzer<FluentAssertionsAnalyzer>()
.WithSources(Code(assertion))
.WithPackageReferences(PackageReference.FluentAssertions_6_12_0)
.WithExpectedDiagnostics(new DiagnosticResult
{
Id = FluentAssertionsOperationAnalyzer.DiagnosticId,
Id = FluentAssertionsAnalyzer.DiagnosticId,
Message = DiagnosticMetadata.NullConditionalMayNotExecute.Message,
Severity = Microsoft.CodeAnalysis.DiagnosticSeverity.Info, // TODO: change to warning
VisitorName = nameof(DiagnosticMetadata.NullConditionalMayNotExecute),
Expand All @@ -43,7 +43,7 @@ public void NullConditionalMayNotExecuteTest(string assertion)
public void NullConditionalWillStillExecuteTest(string assertion)
{
DiagnosticVerifier.VerifyDiagnostic(new DiagnosticVerifierArguments()
.WithDiagnosticAnalyzer<FluentAssertionsOperationAnalyzer>()
.WithDiagnosticAnalyzer<FluentAssertionsAnalyzer>()
.WithSources(Code(assertion))
.WithPackageReferences(PackageReference.FluentAssertions_6_12_0)
);
Expand Down
4 changes: 2 additions & 2 deletions src/FluentAssertions.Analyzers.Tests/Tips/NumericTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private void VerifyCSharpDiagnostic(string sourceAssertion, DiagnosticMetadata m
.WithPackageReferences(PackageReference.FluentAssertions_6_12_0)
.WithExpectedDiagnostics(new DiagnosticResult
{
Id = FluentAssertionsOperationAnalyzer.DiagnosticId,
Id = FluentAssertionsAnalyzer.DiagnosticId,
Message = metadata.Message,
VisitorName = metadata.Name,
Locations = new DiagnosticResultLocation[]
Expand All @@ -143,7 +143,7 @@ private void VerifyCSharpFix(string oldSourceAssertion, string newSourceAssertio

DiagnosticVerifier.VerifyFix(new CodeFixVerifierArguments()
.WithCodeFixProvider<FluentAssertionsCodeFixProvider>()
.WithDiagnosticAnalyzer<FluentAssertionsOperationAnalyzer>()
.WithDiagnosticAnalyzer<FluentAssertionsAnalyzer>()
.WithSources(oldSource)
.WithFixedSources(newSource)
.WithPackageReferences(PackageReference.FluentAssertions_6_12_0)
Expand Down
4 changes: 2 additions & 2 deletions src/FluentAssertions.Analyzers.Tests/Tips/SanityTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ public class TestType3
.WithPackageReferences(PackageReference.FluentAssertions_6_12_0)
.WithExpectedDiagnostics(new DiagnosticResult()
{
Id = FluentAssertionsOperationAnalyzer.DiagnosticId,
Id = FluentAssertionsAnalyzer.DiagnosticId,
Message = DiagnosticMetadata.CollectionShouldNotBeEmpty_AnyShouldBeTrue.Message,
Severity = DiagnosticSeverity.Info,
Locations = new[] { new DiagnosticResultLocation("Test0.cs", 11, 9) }
Expand Down Expand Up @@ -441,7 +441,7 @@ public class MyCollectionType { }";
.WithPackageReferences(PackageReference.FluentAssertions_6_12_0)
.WithExpectedDiagnostics(new DiagnosticResult()
{
Id = FluentAssertionsOperationAnalyzer.DiagnosticId,
Id = FluentAssertionsAnalyzer.DiagnosticId,
Message = DiagnosticMetadata.NullConditionalMayNotExecute.Message,
Severity = DiagnosticSeverity.Info, // TODO: change to warning
Locations = new[] { new DiagnosticResultLocation("Test0.cs", 13, 9) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private void VerifyCSharpDiagnosticExpressionBody(string sourceAssertion, int li
var source = GenerateCode.ObjectStatement(sourceAssertion);
DiagnosticVerifier.VerifyCSharpDiagnosticUsingAllAnalyzers(source, new DiagnosticResult
{
Id = FluentAssertionsOperationAnalyzer.DiagnosticId,
Id = FluentAssertionsAnalyzer.DiagnosticId,
Message = metadata.Message,
VisitorName = metadata.Name,
Locations = new DiagnosticResultLocation[]
Expand All @@ -120,7 +120,7 @@ private void VerifyFix(string oldSource, string newSource)
=> DiagnosticVerifier.VerifyFix(new CodeFixVerifierArguments()
.WithSources(oldSource)
.WithFixedSources(newSource)
.WithDiagnosticAnalyzer<FluentAssertionsOperationAnalyzer>()
.WithDiagnosticAnalyzer<FluentAssertionsAnalyzer>()
.WithCodeFixProvider<FluentAssertionsCodeFixProvider>()
.WithPackageReferences(PackageReference.FluentAssertions_6_12_0)
);
Expand Down
4 changes: 2 additions & 2 deletions src/FluentAssertions.Analyzers.Tests/Tips/StringTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ private void VerifyCSharpDiagnostic(string sourceAssertion, DiagnosticMetadata m

DiagnosticVerifier.VerifyCSharpDiagnosticUsingAllAnalyzers(source, new DiagnosticResult
{
Id = FluentAssertionsOperationAnalyzer.DiagnosticId,
Id = FluentAssertionsAnalyzer.DiagnosticId,
Message = metadata.Message,
VisitorName = metadata.Name,
Locations = new DiagnosticResultLocation[]
Expand All @@ -200,7 +200,7 @@ private void VerifyCSharpFix(string oldSourceAssertion, string newSourceAssertio
DiagnosticVerifier.VerifyFix(new CodeFixVerifierArguments()
.WithSources(oldSource)
.WithFixedSources(newSource)
.WithDiagnosticAnalyzer<FluentAssertionsOperationAnalyzer>()
.WithDiagnosticAnalyzer<FluentAssertionsAnalyzer>()
.WithCodeFixProvider<FluentAssertionsCodeFixProvider>()
.WithPackageReferences(PackageReference.FluentAssertions_6_12_0)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace FluentAssertions.Analyzers;

public partial class FluentAssertionsOperationAnalyzer
public partial class FluentAssertionsAnalyzer
{
private static bool IsEnumerableMethodWithoutArguments(IInvocationOperation invocation, FluentAssertionsMetadata metadata)
=> invocation.IsContainedInType(metadata.Enumerable) && invocation.Arguments.Length == 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
namespace FluentAssertions.Analyzers;

[DiagnosticAnalyzer(LanguageNames.CSharp)]
public partial class FluentAssertionsOperationAnalyzer : DiagnosticAnalyzer
public partial class FluentAssertionsAnalyzer : DiagnosticAnalyzer
{
public const string Title = "Simplify Assertion";
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 20 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 20 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 20 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 20 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 20 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 20 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 20 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 20 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 20 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 20 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 20 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 20 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 20 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 20 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 20 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 20 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 20 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 20 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 20 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 20 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 20 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 20 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)

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ namespace FluentAssertions.Analyzers;
[ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(FluentAssertionsCodeFixProvider)), Shared]
public sealed partial class FluentAssertionsCodeFixProvider : CodeFixProviderBase<FluentAssertionsCodeFixProvider.EmptyTestContext>
{
protected override string Title => FluentAssertionsOperationAnalyzer.Title;
public override ImmutableArray<string> FixableDiagnosticIds { get; } = ImmutableArray.Create(FluentAssertionsOperationAnalyzer.DiagnosticId);
protected override string Title => FluentAssertionsAnalyzer.Title;
public override ImmutableArray<string> FixableDiagnosticIds { get; } = ImmutableArray.Create(FluentAssertionsAnalyzer.DiagnosticId);

protected override CreateChangedDocument TryComputeFix(IInvocationOperation assertion, CodeFixContext context, EmptyTestContext t, Diagnostic diagnostic)
{
Expand Down
Loading