1

I have an assembly that I have created from a suite of SpecFlow MsTests.

What I am looking to do is to run a bit of code over the assembly DLL in order to extract a list of the test names from the contained test classes.

I assume it will require reading the attributes via Reflection or something similar, im just not sure where to start.

helb
  • 7,609
  • 8
  • 36
  • 58
Festivejelly
  • 670
  • 2
  • 12
  • 30
  • Also see http://stackoverflow.com/questions/2656189/how-do-i-read-an-attribute-on-a-class-at-runtime – helb Aug 07 '15 at 13:14

1 Answers1

2

This should be pretty straightforward:

Use reflection to load the assembly, iterate over all public classes and for each class, check if the TestClass attribute is set.

Then for each class, iterate over each public method and check if the TestMethod attribute is set.

As result you could for eaxmaple use a combination of class and method names.

helb
  • 7,609
  • 8
  • 36
  • 58