coverlet
coverlet copied to clipboard
[F#]Auto-properties are not implicitly covered
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
Any updates on this feature?
@tonerdo do you agree on adding -skipautoprops
(opencover name)?
I don't have a strong opinion on "exclude always" vs "switch"
At the moment we can achieve this using ExcludeByAttribute
thank's to https://github.com/tonerdo/coverlet/pull/477#issuecomment-512515625
Closing because we can use /p:ExcludeByAttribute=\"CompilerGeneratedAttribute\"
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@
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.