testfx icon indicating copy to clipboard operation
testfx copied to clipboard

Analyzer: DynamicData should be valid

Open Evangelink opened this issue 1 year ago • 6 comments

Summary

Title: DynamicData should be valid Category: Usage Description: Default severity: Warning

Please refer to MSTEST0003: Test methods should have valid layout.

Non exhaustive list of constraints:

  • public (except if discover internals)
  • static
  • member should match kind declared on the attribute (property or method)
  • member should exist
  • member return type should be valid (IEnumerable<object[]> or IEnumerable<(Value)Tuple<...>>)
  • if member is property it should be gettable
  • if member is method, it should not have parameters

AB#1950780

Evangelink avatar Feb 01 '24 14:02 Evangelink

Would be perfect if this could compare the count and type of parameters when IEnumerable<Tuple> is used.

nohwnd avatar Feb 01 '24 15:02 nohwnd

Thanks! I definitely missed these cases here but I described them in the global analyzers ticket.

Evangelink avatar Feb 01 '24 15:02 Evangelink

✅ Successfully linked to Azure Boards work item(s):

testplatform-bot avatar Feb 02 '24 15:02 testplatform-bot

@engyebrahim As discussed, postponing to milestone 3.4

Evangelink avatar Feb 21 '24 15:02 Evangelink

I also have a issue with DynamicData in vscode test explorer. same cause here?

image

@Evangelink

xcaptain avatar Feb 26 '24 12:02 xcaptain

Moved the above issue to a separate one. This is a work item to create the analyzer, not an issue report.

nohwnd avatar Feb 27 '24 08:02 nohwnd