Skip to content

Commit

Permalink
Core.Tests: added tests for more cases
Browse files Browse the repository at this point in the history
Added tests for cases when property returns array or list of
immutable values.
  • Loading branch information
webwarrior-ws committed Dec 6, 2023
1 parent 442e5c2 commit c7f3813
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,21 @@ type Foo(content: int) =

Assert.IsTrue(this.NoErrorsExist)


[<Test>]
member this.``Should suggest usage of auto-property for for property that only returns list of immutable values``() =
this.Parse """
type Foo(content: int) =
member self.Content = [ 42 ]
"""

Assert.IsTrue(this.ErrorsExist)

[<Test>]
member this.``Should suggest usage of auto-property for for property that only returns array of immutable values``() =
this.Parse """
type Foo(content: int) =
member self.Content = [| content; 42 |]
"""

Assert.IsTrue(this.ErrorsExist)

0 comments on commit c7f3813

Please sign in to comment.