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

ExcludeFromCodeCoverage ignore above properties #229

Closed
tsleegers opened this issue Oct 26, 2018 · 2 comments
Closed

ExcludeFromCodeCoverage ignore above properties #229

tsleegers opened this issue Oct 26, 2018 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@tsleegers
Copy link

tsleegers commented Oct 26, 2018

Description

When excluding a propety from code coverage using de ExcludeFromCodeCoverage attribute this is ignored in the coverage result.

Repro steps

Example code:

public sealed class Euro : ICurrencyDefinition
{
	private const string currencyCode = "EUR";

	[ExcludeFromCodeCoverage]
	public string CurrencyCode
	{
		get
		{
			return currencyCode;
		}
	}

	[ExcludeFromCodeCoverage]
	public string Name
	{
		get { return "Euro"; }
	}

	[ExcludeFromCodeCoverage]
	public int NumberOfDecimals => 2;
}

All the above situations are marked as missing test coverage.

Expected behavior

The properties are marked as covered.

Actual behavior

The properties are not marked as missing code coverage.

Known workarounds

Exclude the whole class from code coverage.

Related information

  • coverlet.msbuild Version: 2.3.1
  • Visual Studio Version: Visual Studio Professional 2017 (15.8.7 and 15.9.0 Preview 3)
  • Microsoft Test Execution Command Line Tool Version: 15.8.0
@SlowLogicBoy
Copy link
Contributor

@akshaybheda #290 issue is for assembly attributes.
@tsleegers Dupe of #269 also this link contains a workaround

@MarcoRossignoli MarcoRossignoli added the duplicate This issue or pull request already exists label Sep 28, 2019
@MarcoRossignoli
Copy link
Collaborator

close for dup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants