Skip to content

Refactor and cleanup how we store type information for test methods #7032

@Youssef1313

Description

@Youssef1313

We have our TestMethod model. It contains multiple properties related to type information:

  • FullClassName (the semantic type)
  • ManagedTypeName (the semantic type too!)
  • DeclaringClassFullName (the syntactic type)

Semantic and syntactic type are different when inheritance is involved.

[TestClass]
public abstract class MyBaseTestClass
{
    [TestMethod]
    public void M() { }
}

[TestClass]
public class ConcreteTestClass : MyBaseTestClass
{
    // this class implicitly has the test method 'M'.
    // When it's run in context of this class, its semantic type is ConcreteTestClass, but the syntactic type is MyBaseTestClass.
}

We should find ways to reduce the information we store. Ideally, only have one property for the semantic type, and not need the syntactic type at all.

Metadata

Metadata

Labels

Area: MSTestIssues with MSTest that are not specific to more refined area (e.g. analyzers or assertions)

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions