Skip to content

Commit e8701e1

Browse files
committed
Tests(SuggestUseAutoProperty): add test for struct
Added test for type with `[<Struct>]` annotation. Such types cannot have auto-properties, so the rule should not apply.
1 parent a848a1f commit e8701e1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,13 @@ type Foo(content: int) =
106106

107107
this.Parse source
108108
Assert.AreEqual(expected, this.ApplyQuickFix source)
109+
110+
[<Test>]
111+
member this.``Should not suggest using auto-property for types with [<Struct>] attribute`` () =
112+
this.Parse """
113+
[<Struct>]
114+
type Foo(content: int) =
115+
member self.Content = content
116+
"""
117+
118+
Assert.IsTrue this.NoErrorsExist

0 commit comments

Comments
 (0)