Skip to content

Commit ade8da0

Browse files
committed
Tests(FavourStaticEmptyFields): add a failure test
1 parent a80a633 commit ade8da0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/FSharpLint.Core.Tests/Rules/Conventions/FavourStaticEmptyFields.fs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,19 @@ type Person =
9191
Assert.IsTrue this.ErrorsExist
9292
Assert.IsTrue (this.ErrorMsg.Contains "List.Empty")
9393

94+
[<Test>]
95+
member this.FavourStaticEmptyFieldsShouldProduceError11() =
96+
this.Parse """
97+
type Person =
98+
{
99+
FirstName: string
100+
}
101+
102+
{ FirstName = "" } |> ignore"""
103+
104+
Assert.IsTrue this.ErrorsExist
105+
Assert.IsTrue (this.ErrorMsg.Contains "String.Empty")
106+
94107
[<Test>]
95108
member this.FavourStaticEmptyFieldsShouldNotProduceError1() =
96109
this.Parse "let bar = String.Empty"

0 commit comments

Comments
 (0)