Skip to content

Commit a30bbd7

Browse files
committed
Tests(FavourStaticEmptyFields): add a failure test
1 parent 05fa5a2 commit a30bbd7

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
@@ -104,6 +104,19 @@ type Person =
104104
Assert.IsTrue this.ErrorsExist
105105
Assert.IsTrue (this.ErrorMsg.Contains "String.Empty")
106106

107+
[<Test>]
108+
member this.FavourStaticEmptyFieldsShouldProduceError12() =
109+
this.Parse """
110+
type Person =
111+
{
112+
FirstName: string
113+
}
114+
115+
{ FirstName = fooGetFirstName "" } |> ignore"""
116+
117+
Assert.IsTrue this.ErrorsExist
118+
Assert.IsTrue (this.ErrorMsg.Contains "String.Empty")
119+
107120
[<Test>]
108121
member this.FavourStaticEmptyFieldsShouldNotProduceError1() =
109122
this.Parse "let bar = String.Empty"

0 commit comments

Comments
 (0)