Skip to content

feat: add missing nunit test cases for false assertions #337

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

Merged
merged 1 commit into from
May 15, 2024
Merged
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
8 changes: 8 additions & 0 deletions src/FluentAssertions.Analyzers.Tests/Tips/NunitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ public class NunitTests
[AssertionDiagnostic("Assert.False(bool.Parse(\"false\"){0});")]
[AssertionDiagnostic("Assert.IsFalse(actual{0});")]
[AssertionDiagnostic("Assert.IsFalse(bool.Parse(\"false\"){0});")]
[AssertionDiagnostic("Assert.That(actual, Is.False{0});")]
[AssertionDiagnostic("Assert.That(actual, Is.Not.True{0});")]
[Implemented]
public void Nunit3_AssertFalse_TestAnalyzer(string assertion) => Nunit3VerifyDiagnostic("bool actual", assertion);

Expand All @@ -123,6 +125,12 @@ public class NunitTests
[AssertionCodeFix(
oldAssertion: "Assert.IsFalse(bool.Parse(\"false\"){0});",
newAssertion: "bool.Parse(\"false\").Should().BeFalse({0});")]
[AssertionCodeFix(
oldAssertion: "Assert.That(actual, Is.False{0});",
newAssertion: "actual.Should().BeFalse({0});")]
[AssertionCodeFix(
oldAssertion: "Assert.That(actual, Is.Not.True{0});",
newAssertion: "actual.Should().BeFalse({0});")]
[Implemented]
public void Nunit3_AssertFalse_TestCodeFix(string oldAssertion, string newAssertion) => Nunit3VerifyFix("bool actual", oldAssertion, newAssertion);

Expand Down