Skip to content

Commit cb3ed66

Browse files
authored
feat: add missing nunit test cases for false assertions (#337)
1 parent 94e1c8b commit cb3ed66

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ public class NunitTests
9999
[AssertionDiagnostic("Assert.False(bool.Parse(\"false\"){0});")]
100100
[AssertionDiagnostic("Assert.IsFalse(actual{0});")]
101101
[AssertionDiagnostic("Assert.IsFalse(bool.Parse(\"false\"){0});")]
102+
[AssertionDiagnostic("Assert.That(actual, Is.False{0});")]
103+
[AssertionDiagnostic("Assert.That(actual, Is.Not.True{0});")]
102104
[Implemented]
103105
public void Nunit3_AssertFalse_TestAnalyzer(string assertion) => Nunit3VerifyDiagnostic("bool actual", assertion);
104106

@@ -123,6 +125,12 @@ public class NunitTests
123125
[AssertionCodeFix(
124126
oldAssertion: "Assert.IsFalse(bool.Parse(\"false\"){0});",
125127
newAssertion: "bool.Parse(\"false\").Should().BeFalse({0});")]
128+
[AssertionCodeFix(
129+
oldAssertion: "Assert.That(actual, Is.False{0});",
130+
newAssertion: "actual.Should().BeFalse({0});")]
131+
[AssertionCodeFix(
132+
oldAssertion: "Assert.That(actual, Is.Not.True{0});",
133+
newAssertion: "actual.Should().BeFalse({0});")]
126134
[Implemented]
127135
public void Nunit3_AssertFalse_TestCodeFix(string oldAssertion, string newAssertion) => Nunit3VerifyFix("bool actual", oldAssertion, newAssertion);
128136

0 commit comments

Comments
 (0)