Skip to content

Commit 686a33b

Browse files
authored
added help links for analyzers (#62)
* added some help links * more help links * completed help links * fixed #74 * completed
1 parent 35560cb commit 686a33b

33 files changed

+151
-55
lines changed

src/FluentAssertions.Analyzers.Tests/Tips/StringTests.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ public class StringTests
8585

8686
[AssertionDataTestMethod]
8787
[AssertionDiagnostic("string.IsNullOrEmpty(actual).Should().BeTrue({0});")]
88-
[AssertionDiagnostic("string.IsNullOrEmpty(actual).Should().BeTrue({0}).And.ToString();")]
89-
[AssertionDiagnostic("string.IsNullOrEmpty(actual.ToString()).Should().BeTrue({0});")]
9088
[AssertionDiagnostic("string.IsNullOrEmpty(actual.ToString()).Should().BeTrue({0}).And.ToString();")]
9189
[Implemented]
9290
public void StringShouldBeNullOrEmpty_TestAnalyzer(string assertion) => VerifyCSharpDiagnostic<StringShouldBeNullOrEmptyAnalyzer>(assertion);
@@ -95,12 +93,6 @@ public class StringTests
9593
[AssertionCodeFix(
9694
oldAssertion: "string.IsNullOrEmpty(actual).Should().BeTrue({0});",
9795
newAssertion: "actual.Should().BeNullOrEmpty({0});")]
98-
[AssertionCodeFix(
99-
oldAssertion: "string.IsNullOrEmpty(actual).Should().BeTrue({0}).And.ToString();",
100-
newAssertion: "actual.Should().BeNullOrEmpty({0}).And.ToString();")]
101-
[AssertionCodeFix(
102-
oldAssertion: "string.IsNullOrEmpty(actual.ToString()).Should().BeTrue({0});",
103-
newAssertion: "actual.ToString().Should().BeNullOrEmpty({0});")]
10496
[AssertionCodeFix(
10597
oldAssertion: "string.IsNullOrEmpty(actual.ToString()).Should().BeTrue({0}).And.ToString();",
10698
newAssertion: "actual.ToString().Should().BeNullOrEmpty({0}).And.ToString();")]

src/FluentAssertions.Analyzers/Constants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ public static class DiagnosticProperties
66
{
77
public const string Title = nameof(Title);
88
public const string VisitorName = nameof(VisitorName);
9+
public const string HelpLink = nameof(HelpLink);
910
}
1011

1112
public static class Tips

src/FluentAssertions.Analyzers/Tips/Collections/CollectionShouldBeInAscendingOrder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected override IEnumerable<FluentAssertionsCSharpSyntaxVisitor> Visitors
2525
}
2626
}
2727

28-
private class OrderByShouldEqualSyntaxVisitor : FluentAssertionsCSharpSyntaxVisitor
28+
public class OrderByShouldEqualSyntaxVisitor : FluentAssertionsCSharpSyntaxVisitor
2929
{
3030
public OrderByShouldEqualSyntaxVisitor() : base(MemberValidator.MathodContainingLambda("OrderBy"), MemberValidator.Should, MemberValidator.ArgumentIsVariable("Equal"))
3131
{

src/FluentAssertions.Analyzers/Tips/Collections/CollectionShouldBeInDescendingOrder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected override IEnumerable<FluentAssertionsCSharpSyntaxVisitor> Visitors
2525
}
2626
}
2727

28-
private class OrderByDescendingShouldEqualSyntaxVisitor : FluentAssertionsCSharpSyntaxVisitor
28+
public class OrderByDescendingShouldEqualSyntaxVisitor : FluentAssertionsCSharpSyntaxVisitor
2929
{
3030
public OrderByDescendingShouldEqualSyntaxVisitor() : base(MemberValidator.MathodContainingLambda("OrderByDescending"), MemberValidator.Should, MemberValidator.ArgumentIsVariable("Equal"))
3131
{

src/FluentAssertions.Analyzers/Tips/Collections/CollectionShouldContainItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ protected override IEnumerable<FluentAssertionsCSharpSyntaxVisitor> Visitors
2626
}
2727
}
2828

29-
private class ContainsShouldBeTrueSyntaxVisitor : FluentAssertionsCSharpSyntaxVisitor
29+
public class ContainsShouldBeTrueSyntaxVisitor : FluentAssertionsCSharpSyntaxVisitor
3030
{
3131
public ContainsShouldBeTrueSyntaxVisitor() : base(new MemberValidator("Contains"), MemberValidator.Should, new MemberValidator("BeTrue"))
3232
{

src/FluentAssertions.Analyzers/Tips/Collections/CollectionShouldEqualOtherCollectionByComparer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ protected override IEnumerable<FluentAssertionsCSharpSyntaxVisitor> Visitors
2727
}
2828
}
2929

30-
private class SelectShouldEqualOtherCollectionSelectSyntaxVisitor : FluentAssertionsCSharpSyntaxVisitor
30+
public class SelectShouldEqualOtherCollectionSelectSyntaxVisitor : FluentAssertionsCSharpSyntaxVisitor
3131
{
3232
public SelectShouldEqualOtherCollectionSelectSyntaxVisitor()
3333
: base(MemberValidator.MathodContainingLambda("Select"), MemberValidator.Should, new MemberValidator("Equal", MathodContainingArgumentInvokingLambda))

src/FluentAssertions.Analyzers/Tips/Collections/CollectionShouldHaveCountGreaterOrEqualTo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class CollectionShouldHaveCountGreaterOrEqualToAnalyzer : CollectionAnaly
1414
public const string DiagnosticId = Constants.Tips.Collections.CollectionShouldHaveCountGreaterOrEqualTo;
1515
public const string Category = Constants.Tips.Category;
1616

17-
public const string Message = "Use .Should()### instead.";
17+
public const string Message = "Use .Should().HaveCountGreaterOrEqualTo() instead.";
1818

1919
protected override DiagnosticDescriptor Rule => new DiagnosticDescriptor(DiagnosticId, Title, Message, Category, DiagnosticSeverity.Info, true);
2020
protected override IEnumerable<FluentAssertionsCSharpSyntaxVisitor> Visitors
@@ -25,7 +25,7 @@ protected override IEnumerable<FluentAssertionsCSharpSyntaxVisitor> Visitors
2525
}
2626
}
2727

28-
private class CountShouldBeGreaterOrEqualToSyntaxVisitor : FluentAssertionsCSharpSyntaxVisitor
28+
public class CountShouldBeGreaterOrEqualToSyntaxVisitor : FluentAssertionsCSharpSyntaxVisitor
2929
{
3030
public CountShouldBeGreaterOrEqualToSyntaxVisitor() : base(new MemberValidator("Count"), MemberValidator.Should, new MemberValidator("BeGreaterOrEqualTo"))
3131
{

src/FluentAssertions.Analyzers/Tips/Collections/CollectionShouldHaveCountGreaterThan.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected override IEnumerable<FluentAssertionsCSharpSyntaxVisitor> Visitors
2525
}
2626
}
2727

28-
private class CountShouldBeGreaterThanSyntaxVisitor : FluentAssertionsCSharpSyntaxVisitor
28+
public class CountShouldBeGreaterThanSyntaxVisitor : FluentAssertionsCSharpSyntaxVisitor
2929
{
3030
public CountShouldBeGreaterThanSyntaxVisitor() : base(new MemberValidator("Count"), MemberValidator.Should, new MemberValidator("BeGreaterThan"))
3131
{

src/FluentAssertions.Analyzers/Tips/Collections/CollectionShouldHaveCountLessOrEqualTo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected override IEnumerable<FluentAssertionsCSharpSyntaxVisitor> Visitors
2525
yield return new CountShouldBeLessOrEqualToSyntaxVisitor();
2626
}
2727
}
28-
private class CountShouldBeLessOrEqualToSyntaxVisitor : FluentAssertionsCSharpSyntaxVisitor
28+
public class CountShouldBeLessOrEqualToSyntaxVisitor : FluentAssertionsCSharpSyntaxVisitor
2929
{
3030
public CountShouldBeLessOrEqualToSyntaxVisitor() : base(new MemberValidator("Count"), MemberValidator.Should, new MemberValidator("BeLessOrEqualTo"))
3131
{

src/FluentAssertions.Analyzers/Tips/Collections/CollectionShouldHaveCountLessThan.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected override IEnumerable<FluentAssertionsCSharpSyntaxVisitor> Visitors
2525
}
2626
}
2727

28-
private class CountShouldBeLessThanSyntaxVisitor : FluentAssertionsCSharpSyntaxVisitor
28+
public class CountShouldBeLessThanSyntaxVisitor : FluentAssertionsCSharpSyntaxVisitor
2929
{
3030
public CountShouldBeLessThanSyntaxVisitor() : base(new MemberValidator("Count"), MemberValidator.Should, new MemberValidator("BeLessThan"))
3131
{

0 commit comments

Comments
 (0)