Skip to content

Improve analyzers for [ClassInitialize], [ClassCleanup], [TestInitialize] and [TestCleanup] to handle [TestClass] case #3246

Closed
@Evangelink

Description

@Evangelink

Unlike #3244 and #3245 when methods marked with the following attributes:

  • [ClassInitialize]
  • [ClassCleanup]
  • [TestInitialize]
  • [TestCleanup]

are on a class not marked with [TestClass] it's possible that they are still being picked-up through inheritance.

In addition to #3223 and #3224 updates, we should raise a diagnostic if the containing type is sealed and not marked with [TestClass] (or derived attribute).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions