jeudi 11 avril 2019

Distinguish between SpecFlow and Unit Test assembly

I have written some code that analyzes a test DLL and extracts names of tests and which tags they have using reflection.
I originally wrote it to analyze SpecFlow DLLs, but it seems to work fine for Unit Test DLLs, with a few tweaks.
Both are using MSTest (VSTest.Console.exe)
I am wondering if anyone knows how I could distinguish one type of assembly from the other, so that I can use the same code to analyze either kind of assembly, without having to specify what kind it is.
Also, if anyone knows of an existing tool to do this (Extract lists of tests from DLLs), that would be great. I am kind of feeling like I must be re-inventing the wheel here...

Sample files
Specflow DLL
Unit Test DLL
(You probably need to right-click these and unblock to be able to load them)

TLDR: How do I detect, through code, which one of these DLLs is Specflow and which is Unit Tests?





Aucun commentaire:

Enregistrer un commentaire