Example #1
0
        protected virtual Assembly[] GetAssembliesToScan(ConventionData data)
        {
            if (data.Assemblies != null)
            {
                return(data.Assemblies);
            }
            var assembly              = Assembly.GetCallingAssembly();
            var companyName           = assembly.FullName.Substring(0, assembly.FullName.IndexOf('.'));
            var assemblyNames         = assembly.GetReferencedAssemblies();
            var applicationAssemblies = Array.FindAll(assemblyNames, n => n.FullName.StartsWith(companyName));

            return(Array.ConvertAll(applicationAssemblies, Assembly.Load));
        }
Example #2
0
 protected virtual Type[] GetTypesToTest(ConventionData data)
 {
     return
         (GetAssembliesToScan(data).SelectMany(a => a.GetTypes()).Where(data.Types.Invoke).OrderBy(t => t.FullName)
          .ToArray());
 }