public TestSuite Build(string assemblyName, bool autoSuites, bool checkCompatibility) { // Change currentDirectory in case assembly references unmanaged dlls // and so that any addins are able to access the directory easily. using (new DirectorySwapper(Path.GetDirectoryName(assemblyName))) { this.assembly = Load(assemblyName); if (this.assembly == null) { return(null); } if (checkCompatibility) { Compatibility.CheckAttributes(assembly); } IList fixtures = GetFixtures(assembly, null); return(BuildTestAssembly(this.assembly, assemblyName, fixtures, autoSuites)); } }
public Test Build(string assemblyName, string testName, bool autoSuites, bool checkCompatibility) { if (testName == null || testName == string.Empty) { return(Build(assemblyName, autoSuites, checkCompatibility)); } // Change currentDirectory in case assembly references unmanaged dlls // and so that any addins are able to access the directory easily. using (new DirectorySwapper(Path.GetDirectoryName(assemblyName))) { this.assembly = Load(assemblyName); if (assembly == null) { return(null); } if (checkCompatibility) { Compatibility.CheckAttributes(assembly); } // If provided test name is actually the name of // a type, we handle it specially Type testType = assembly.GetType(testName); if (testType != null) { return(Build(assembly, assemblyName, testType, autoSuites)); } // Assume that testName is a namespace and get all fixtures in it IList fixtures = GetFixtures(assembly, testName); if (fixtures.Count > 0) { return(BuildTestAssembly(this.assembly, assemblyName, fixtures, autoSuites)); } return(null); } }