Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[F#]Auto-properties are not implicitly covered #81

Open
SteveGilham opened this issue May 3, 2018 · 7 comments
Open

[F#]Auto-properties are not implicitly covered #81

SteveGilham opened this issue May 3, 2018 · 7 comments
Labels
feature-request New feature request fsharp F# source code issue stale

Comments

@SteveGilham
Copy link

Writing unit tests for auto-properties is a futile exercise; they are essentially noise (as is the coverage or otherwise of such properties).

Auto-properties in code exercised by coverlet are marked as uncovered by default be they C#

    public class Class1
    {
        string Property { get; set; }
    }

or F#

type Class1 () =
  member val Property= String.Empty with get, set
@lucasbflopes
Copy link

Any updates on this feature?

@tonerdo tonerdo added enhancement General enhancement request help wanted and removed in progress labels May 1, 2019
@MarcoRossignoli
Copy link
Collaborator

@tonerdo do you agree on adding -skipautoprops(opencover name)?
I don't have a strong opinion on "exclude always" vs "switch"

@MarcoRossignoli
Copy link
Collaborator

At the moment we can achieve this using ExcludeByAttribute thank's to #477 (comment)

@MarcoRossignoli MarcoRossignoli added feature-request New feature request and removed enhancement General enhancement request labels Sep 12, 2019
@MarcoRossignoli MarcoRossignoli added up-for-grabs Good issue for contributors and removed help wanted labels Oct 3, 2019
@MarcoRossignoli
Copy link
Collaborator

Closing because we can use /p:ExcludeByAttribute=\"CompilerGeneratedAttribute\"

@SteveGilham
Copy link
Author

Sorry, F# auto-properties of the form

  type MyClass() =
    member val Property = 0 with get, set

are not marked [CompilerGenerated] -- the F# compiler does its own thing here.

The key to identify these ones is by a backing field with name Property@

@MarcoRossignoli
Copy link
Collaborator

Ugh...sorry to you for my ignorance...didn't know, I'm not familiar with F# compiler.
I'm thinking to add a F# lib on tests to handle the cases.
Thank's Steve.

@MarcoRossignoli MarcoRossignoli changed the title Auto-properties are not implicitly covered [F#]Auto-properties are not implicitly covered Jan 23, 2020
@MarcoRossignoli MarcoRossignoli added the fsharp F# source code issue label Jan 23, 2020
@MarcoRossignoli MarcoRossignoli removed the up-for-grabs Good issue for contributors label Feb 21, 2021
Copy link

This issue is stale because it has been open for 90 days with no activity.

@github-actions github-actions bot added the stale label Jul 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature request fsharp F# source code issue stale
Projects
None yet
Development

No branches or pull requests

4 participants