microsoft / testfx

MSTest framework and adapter
MIT License
697 stars 250 forks source link

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

Closed Evangelink closed 1 month ago

Evangelink commented 1 month ago

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

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).