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.

Fix SkipAutoProps to work for records as well.

See original GitHub issue
    public sealed record RouteResponse
    {
        public string Id { get; init; } = string.Empty;
    }

I’m still experiencing that autoprops like these in records are still counting against coverage even though SkipAutoProps is set to true.

I originally was under the impression that #328 would fix it for both classes and records; however, I was told to open this new issue since it doesn’t. Please fix so that we don’t have to keep manually exclude them via the [ExcludedFroCodeCoverage] attribute.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13

github_iconTop GitHub Comments

1reaction
MarcoRossignolicommented, May 4, 2021

The constructor of the record creates an instance of System.Object and I’m currently not sure if I can just ignore this.

It’s ok…every ref object inherits from System.Object

1reaction
daveMuellercommented, May 3, 2021

I analyzed this a bit more and did both in one PR https://github.com/coverlet-coverage/coverlet/pull/1159.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - GitHub
NET Framework >= 4.6.1 As explained in quick start section, to use collectors you ... SkipAutoProps | Neither track nor record auto-implemented properties....
Read more >
Exclude AutoGeneratedProgram.cs from code coverage
1 Answer 1 ; IncludeTestAssembly, Include coverage of the test assembly. ; SkipAutoProps, Neither track nor record auto-implemented properties.
Read more >
OpenCover
I tried OpenCover v4.7.1221 to run tests on the NDepend code base but it doesn't work. Until now we used an older version...
Read more >
Continuous Integration, Delivery, and Deployment
project and is also a prerequisite for CI, so this explores Git and how to work with it, both from a command line...
Read more >
July 1, 2016, 8:03 pm - Telerik Forums RSS
I have recently been experimenting with converting from WEINRE to the Debug on Device feature, and it seems to work fairly well with...
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