MSTEST0057 reports a false positive when the attribute has a static field or property with an initializer. Not happens for const
public class DerivedTestMethodAttribute : TestMethodAttribute
{
private static string Text { get; } = "I'm static property";
private static readonly string _text = "I'm static field";
public DerivedTestMethodAttribute([CallerFilePath] string callerFilePath = "", [CallerLineNumber] int callerLineNumber = -1)
: base(callerFilePath, callerLineNumber)
{
}
}
MSTEST0057: TestMethodAttribute derived class 'AftTestMethodAttribute' should add CallerFilePath and CallerLineNumber parameters to its constructor
BTW, the documentation is missing for this diagnostic.