question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[F#]Auto-properties are not implicitly covered

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:7
  • Comments:6

github_iconTop GitHub Comments

1reaction
SteveGilhamcommented, Oct 14, 2019

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@

0reactions
MarcoRossignolicommented, Oct 14, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[F#]Auto-properties are not implicitly covered · Issue #81
Writing unit tests for auto-properties is a futile exercise; they are essentially noise (as is the coverage or otherwise of such properties) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found