是否可以使用反射从 mstest 解决方案 dll 中获取所有测试类别?
Is it possible to get all the test categories from mstest solution dll using reflection?
是否可以使用反射从mstest解决方案dll中获取所有测试类别?
我尝试了以下方法:
Assembly testAssembly = Assembly.LoadFile(@"c:\Test.dll");
但是当我尝试使用
从此程序集中获取类型时
var types = testAssembly.GetTypes();
它抛出 ReflectionTypeLoadException
。
我相信一旦我得到类型我就可以寻找 CutomAttribute 'TestCategoryAttribute'。
我从中选择用于获取类型的解决方案 dll 的文件夹只有那个 dll。但它也依赖于其他一些 DLL。因此,当我将所有其他 DLL 与主要解决方案 dll 一起复制时,我能够获得类型。从这些类型中我得到了测试类别。
谢谢。
是否可以使用反射从mstest解决方案dll中获取所有测试类别? 我尝试了以下方法:
Assembly testAssembly = Assembly.LoadFile(@"c:\Test.dll");
但是当我尝试使用
从此程序集中获取类型时var types = testAssembly.GetTypes();
它抛出 ReflectionTypeLoadException
。
我相信一旦我得到类型我就可以寻找 CutomAttribute 'TestCategoryAttribute'。
我从中选择用于获取类型的解决方案 dll 的文件夹只有那个 dll。但它也依赖于其他一些 DLL。因此,当我将所有其他 DLL 与主要解决方案 dll 一起复制时,我能够获得类型。从这些类型中我得到了测试类别。 谢谢。