Skip to content

Commit

Permalink
reproduce tests case
Browse files Browse the repository at this point in the history
  • Loading branch information
Meir017 committed Aug 22, 2023
1 parent 5f4f3f5 commit a0e5050
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/FluentAssertions.Analyzers.Tests/Tips/CollectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,10 @@ public void CollectionShouldContainSingle_TestAnalyzer_GenericIEnumerableShouldR
[AssertionDiagnostic("actual.Where(x => x.BooleanProperty).Should().HaveCount(1{0});")]
[AssertionDiagnostic("actual.AsEnumerable().Should().HaveCount(1{0}).And.ToString();")]
[AssertionDiagnostic("actual.AsEnumerable().Where(x => x.BooleanProperty).Should().HaveCount(1{0}).And.ToString();")]
[AssertionDiagnostic("actual.Should().HaveCount(1{0}).And.Contain(item => item == expectedItem);")]
[AssertionDiagnostic("actual.Where(x => x.BooleanProperty).Should().HaveCount(1{0}).And.Contain(item => item == expectedItem);")]
[AssertionDiagnostic("actual.AsEnumerable().Should().HaveCount(1{0}).And.Contain(item => item == expectedItem).And.ToString();")]
[AssertionDiagnostic("actual.AsEnumerable().Where(x => x.BooleanProperty).Should().HaveCount(1{0}).And.Contain(item => item == expectedItem).And.ToString();")]
[Implemented]
public void CollectionShouldContainSingle_TestAnalyzer(string assertion) => VerifyCSharpDiagnosticCodeBlock<CollectionShouldContainSingleAnalyzer>(assertion);

Expand All @@ -412,6 +416,12 @@ public void CollectionShouldContainSingle_TestAnalyzer_GenericIEnumerableShouldR
[AssertionCodeFix(
oldAssertion: "actual.AsEnumerable().Should().HaveCount(1{0}).And.ToString();",
newAssertion: "actual.AsEnumerable().Should().ContainSingle({0}).And.ToString();")]
[AssertionCodeFix(
oldAssertion: "actual.Should().HaveCount(1{0}).And.Contain(item => item == expectedItem);",
newAssertion: "actual.Should().ContainSingle({0}).Which.Should().Be(expectedItem);")]
[AssertionCodeFix(
oldAssertion: "actual.AsEnumerable().Should().HaveCount(1{0}).And.Contain(item => item == expectedItem).And.ToString();",
newAssertion: "actual.AsEnumerable().Should().ContainSingle({0}).Which.Should().Be(expectedItem).And.ToString();")]
[Implemented]
public void CollectionShouldContainSingle_TestCodeFix(string oldAssertion, string newAssertion) => VerifyCSharpFixCodeBlock<CollectionShouldContainSingleCodeFix, CollectionShouldContainSingleAnalyzer>(oldAssertion, newAssertion);

Expand Down

0 comments on commit a0e5050

Please sign in to comment.