Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 1.86 KB

File metadata and controls

57 lines (41 loc) · 1.86 KB

PH2013: Avoid Ignore attribute

Property Value
Package Philips.CodeAnalysis.MsTestAnalyzers
Diagnostic ID PH2013
Category MsTest
Analyzer AvoidAttributeAnalyzer
CodeFix No
Severity Error
Enabled By Default Yes

Introduction

Tests marked as Ignore are essentially dead code.

How to solve

Remove the test. Rely on your version control system and issue tracking system to remember it.

Example

Code that triggers a diagnostic:

        [TestMethod]
        [Ignore]
        public void BadTestMethod()
        {
            Assert.AreEqual(1, 1);
        }

Similar Analyzers

The following analyzers detect other situations that prevent tests from executing (either unwittingly or nefariously):

ID Title
PH2034 Test methods must be in TestClass
PH2036 Test methods must be public
PH2038 Test classes must be public
PH2059 Public methods must be TestMethods

Microsoft Equivalent

Microsoft's official MSTest analyzers provide equivalent functionality:

Microsoft Rule Description
MSTEST0015 Don't ignore tests

Migration

Consider migrating to Microsoft's official MSTest analyzers which provide equivalent or better functionality with official support.

Configuration

This analyzer does not offer any special configuration. The general ways of suppressing diagnostics apply.