diff --git a/tests/FSharpLint.Core.Tests/Rules/Conventions/SourceLength.fs b/tests/FSharpLint.Core.Tests/Rules/Conventions/SourceLength.fs index 6ed14cc08..747656e53 100644 --- a/tests/FSharpLint.Core.Tests/Rules/Conventions/SourceLength.fs +++ b/tests/FSharpLint.Core.Tests/Rules/Conventions/SourceLength.fs @@ -230,7 +230,29 @@ let MemberLength = 70 [] type TestMaxLinesInMember() = inherit TestAstNodeRuleBase.TestAstNodeRuleBase(MaxLinesInMember.rule { Config.MaxLines = MemberLength }) - // TODO: Add tests. + [] + member this.MemberTooManyLines() = + this.Parse $""" +module Program + +type Class() = + member this.Member1 () = + %s{generateNewLines MemberLength 8} + () +\"\"\") + + Assert.IsTrue(this.ErrorExistsAt(5, 4)) + + [] + member this.MemberNotTooManyLines() = + this.Parse \"\"\" +module Program + +type Class() = + member this.Member1 () = () +\"\""" + + Assert.IsFalse(this.ErrorExistsAt(5, 4)) [] let PropertyLength = 70