Skip to content

BannedApiAnalyzer does not prevent inheritance or Implementation #6841

@JinsPeter

Description

@JinsPeter

BannedApiAnalyzers

Diagnostic ID: RS0030

BannedAPI Analyser does not prevent inheritance or implemenation

I was trying to ban Xunit.IClassFixture in one my project in favor of Xunit.ICollectionFixture so as to disallow redundant creation of database objects in my project's integration tests.

But applying a rule like below only prevents me from using this in a class / method. It does not prevent my application to inherit/implement the IClassFixture interface

T:Xunit.IClassFixture`1;Don't use IClassFixture<T> in IntegrationTests project. Rather use collection Fixture for any Fixture requirement.

Describe suggestions on how to achieve the rule

I would like to a way to prevent a Type from being inherited so that its features would not be used at all..

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions