Skip to content

Commit 8c82599

Browse files
authored
Core.Tests/Conventions: add 2 missing unit-tests
Added 2 missing unit-tests for member length in SourceLength.
1 parent 1884542 commit 8c82599

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

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

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,29 @@ let MemberLength = 70
230230
[<TestFixture>]
231231
type TestMaxLinesInMember() =
232232
inherit TestAstNodeRuleBase.TestAstNodeRuleBase(MaxLinesInMember.rule { Config.MaxLines = MemberLength })
233-
// TODO: Add tests.
233+
[<Test>]
234+
member this.MemberTooManyLines() =
235+
this.Parse $"""
236+
module Program
237+
238+
type Class() =
239+
member this.Member1 () =
240+
%s{generateNewLines MemberLength 8}
241+
()
242+
\"\"\")
243+
244+
Assert.IsTrue(this.ErrorExistsAt(5, 4))
245+
246+
[<Test>]
247+
member this.MemberNotTooManyLines() =
248+
this.Parse \"\"\"
249+
module Program
250+
251+
type Class() =
252+
member this.Member1 () = ()
253+
\"\"""
254+
255+
Assert.IsFalse(this.ErrorExistsAt(5, 4))
234256

235257
[<Literal>]
236258
let PropertyLength = 70

0 commit comments

Comments
 (0)