You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
The text was updated successfully, but these errors were encountered:
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:
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.
The text was updated successfully, but these errors were encountered: