ExcludeFromCodeCoverage for interface with default implementations
@fhnaseer がすでに取り組んでいます。
2024年11月18日 から。
評価
この issue はまだ評価されていません。
説明
Currently the ExcludeFromCodeCoverage attribute can only be placed on classes, constructors, methods, structs, properties, events and assemblies. However, now that C# 8.0 introduced interfaces with default implementations it could be useful to be able to be able to use the attribute on these as well.
As an example, in the visitor pattern I'm using an interface with default implementation so that visitors don't have to override every method:
public interface IVisitor
{
void Visit(FullName fullName) => throw new NotImplementedException();
void Visit(Address address) => throw new NotImplementedException();
void Visit(PhoneInfo phoneInfo) => throw new NotImplementedException();
}
Since testing these concrete methods (in my case) is not necessary, I would like to tag the interface with the ExcludeFromCodeCoverage attribute which is currently not possible. While I've got a few workarounds (adding the ExcludeFromCodeCoverage attribute to every single method declaration in the interface or using an abstract class and tagging the class itself) it might be worth letting the attribute be placed directly on interfaces.
- 主要言語
- C#
- スター
- 125
- フォーク
- 17
- 平均マージ
- 1時間 17分
- マージ済み PR(30日)
- 2
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/codecoverage のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
microsoft/codecoverage#246 · コメント 6 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
microsoft/codecoverage#237 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
microsoft/codecoverage#234 · コメント 1 件 · リアクション 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
microsoft/codecoverage#233 · リアクション 2 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
microsoft/codecoverage#232 · コメント 6 件 ·
microsoft/codecoverage の issue をすべて見る
似ている issue
-
core dependencies
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
-
bug frontend good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
NavigationViewItemAutomationPeer implements IInvokeProvider but never advertises the Invoke pattern オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
unoplatform/uno#24629 ·
-
agentic-workflows Needs: Triage :mag: State: In-PR
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
Down / Waiting for removal
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100