Class TestModuleActivator
Provides functionality to register and resolve factory methods to create ITestModule instances with a specific unique ID and/or name from assemblies.
public class TestModuleActivator
- Inheritance
-
TestModuleActivator
- Inherited Members
Constructors
TestModuleActivator()
public TestModuleActivator()
Methods
IsSystemOrRanorexAssembly(string)
Determines whether the path to an assembly is a System or Ranorex assembly.
public static bool IsSystemOrRanorexAssembly(string assemblyPath)
Parameters
assemblyPathstringThe path to the assembly to inspect.
Returns
- bool
trueif theassemblyPathis a System or Ranorex assembly, otherwisefalse.
Register(string, TestModuleFactoryMethod)
Registers a new factory method that creates ITestModule instances with the specified module GUID.
public static void Register(string moduleGuid, TestModuleActivator.TestModuleFactoryMethod factoryMethod)
Parameters
moduleGuidstringThe module GUID of the ITestModule instance created by the specified factory method.
factoryMethodTestModuleActivator.TestModuleFactoryMethodThe factory method that creates ITestModule instances with the specified
moduleGuid.
Register(string, TestModuleFactoryMethod, ModuleType)
Registers a new factory method that creates ITestModule instances with the specified module GUID.
public static void Register(string moduleGuid, TestModuleActivator.TestModuleFactoryMethod factoryMethod, ModuleType moduleType)
Parameters
moduleGuidstringThe module GUID of the ITestModule instance created by the specified factory method.
factoryMethodTestModuleActivator.TestModuleFactoryMethodThe factory method that creates ITestModule instances with the specified
moduleGuid.moduleTypeModuleTypeThe type of the module created by the factory method.
Register(string, TestModuleFactoryMethod, ModuleType, int)
Registers a new factory method that creates ITestModule instances with the specified module GUID.
public static void Register(string moduleGuid, TestModuleActivator.TestModuleFactoryMethod factoryMethod, ModuleType moduleType, int iteration)
Parameters
moduleGuidstringThe module GUID of the ITestModule instance created by the specified factory method.
factoryMethodTestModuleActivator.TestModuleFactoryMethodThe factory method that creates ITestModule instances with the specified
moduleGuid.moduleTypeModuleTypeThe type of the module created by the factory method.
iterationintA number specifying the repeat count for the module created by the factory method.
ResolveFactoryMethod(CaseInsensitiveString, string, Type, IList<string>, out TestModuleAttribute)
Resolves the factory method that creates ITestModule instances with the specified module GUID and/or module.
public static TestModuleActivator.TestModuleFactoryMethod ResolveFactoryMethod(CaseInsensitiveString moduleGuid, string moduleName, Type containerType, IList<string> assemblyPathsToSearch, out TestModuleAttribute moduleAttribute)
Parameters
moduleGuidCaseInsensitiveStringThe GUID of the module created by the returned factory method.
moduleNamestringThe name of the module created by the returned factory method.
containerTypeTypeA Type that resides in the same assembly as the searched test module.
assemblyPathsToSearchIList<string>The paths to assemblies that are searched for the test module.
moduleAttributeTestModuleAttributeWhen this methods returns contains the TestModuleAttribute that the found test module is marked with or
nullif no test module was found.
Returns
- TestModuleActivator.TestModuleFactoryMethod
A factory method that can be used to create the specified ITestModule instance or
nullif no test module satisfying the specified arguments was found.